Seems like you are on the right path to implementing that solution. Here are a couple adjustments that might help: http://pastebin.com/tscd7LTk
First off, I think there is a bug in the menu not properly responding to a QWidgetAction trigger. The docs say your custom widget should be calling that to notify it of a trigger action. Even after I added it to your code, it wasn't working. Ref this post: http://www.qtcentre.org/threads/29035-Correct-way-for-QMenu-exec%28%29-to-return-QWidgetAction So I added that workaround, and it seems to work right. It also requires that you properly parent your actions to the menu instead of the main window. Also, you can make your stylesheet changes more manageable by adding them all in one place to your widget, and using object names to specifically target certain ones. I made some changes to the style that gets the entire row to change color on hover. There is a bit of a delay though between when your mouse is hovering the container widget vs when it enters the label. Maybe you can fix that with forwarding an event or something so it gets the hover event earlier. On Thursday, September 19, 2013 6:52:03 AM UTC+12, Jesse wrote: > I really like the secondary option offered on Maya menus presented as a > little square showing that there are other settings that can be tweaked. > > > I'd like to use this idea for some of my studio's internal tools. I have a > partially working implementation by subclassing QAction, but my new QActions > are not quite working as I want. They don't hover or hide the menu when > clicked. > > > > > Does anyone know of a way to implement the maya style secondary menu actions? > I can't seem to find the right search terms to yield anything from google > searches. > > > Cheers, > > > jesse -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
