Pregunta

maya menu example

I work on creating a tool for maya with pyqt4.
And in my tool, there is some menus on QMenuBar.
In that situation, I hope to create a menu + option menu style like above image.
As you see there is "New Scene" menu and square icon at the right side of "New Scene".
If I select just "New Scene", it works as creating a new scene.
And if I select square icon of "New Scene", it pops up option window for creating a new scene.
That's the one I hope to do.
How can I do this?

¿Fue útil?

Solución

Derive from QWidgetAction (docs) to create a widget that is basically a blend of a QLabel and a QPushButton. Note You'll probably have to subclass QLabel in order to provide a rollover effect in terms of QStyle.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top