0

How can I display an X close button in the top right corner of subclassed QToolButton, and control its the behavior?

DragonDrop
  • 211
  • 6
  • 11

1 Answers1

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