Hyun-geun Kim
Hyun-geun Kim

Reputation: 1069

qt: can I add option menu at qmenu like maya

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?

Upvotes: 0

Views: 975

Answers (1)

cmannett85
cmannett85

Reputation: 22366

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.

Upvotes: 1

Related Questions