I'm using tabbed dock widgets which remain docked to the mainwindow. I want to override the dock widget behavior as follows:
1) clicking the close button on the dock widget title bar shrinks rather than closes the dock window.
2) clicking on the tab when the dock widget is shrunk causes it to expand to normal size.
I've implemented #1 by reimplementing closeEvent() in a subclass of QDockWidget. I then set the minimum and maximum size to 0 and update the geometry. It works fine.
By restoring the min/max size and updating the geometry again I get the widget to restore its original size, manually.
However, I don't know how to catch the mouseButtonPress event on the tab bar for the dock widgets. The event isn't propagated to the QDockWidget itself, and there is no API for getting a handle to the tab bar. I've tried installing an event filter on the dockWidget->parentWidget(), but that seems to be the QMainWindow, not the tab bar.
Any ideas on how to catch a click on the tabBar tabs?
Using Qt 4.5.1
Thx.
-Brian
Bookmarks