How can I display an X close button in the top right corner of subclassed QToolButton, and control its the behavior?
Asked
Active
Viewed 302 times
0
-
I don't know much about Qt, but does this help: http://stackoverflow.com/q/459372/365102 ? – Mateen Ulhaq Feb 17 '12 at 23:00
-
Saw this one, very different widget type. – DragonDrop Feb 17 '12 at 23:30
1 Answers
2
Subclass QToolButton and in constructor of your class e.g. MyToolButton add a child QPushButton on top of your tool button.

Dmitriy
- 5,357
- 8
- 45
- 57
-
How does one add a widget to another widget? There is no addWidget() member available for QToolButton. – DragonDrop Feb 20 '12 at 23:38
-
By specifiyng QToolButton as a parent widget. Or using a layout for QToolButton and adding your widget to the layout. – Dmitriy Feb 21 '12 at 07:32