PDA

View Full Version : QDockWidget: disable double click on title bar



ElectroQt
9th October 2008, 18:41
Howdy,

I have some QDockWidget's and I want to disable the double click on the title bar. At the moment, I'm porting a windows MFC app to Qt, and it's not using a QMainWindow yet, so double clicking on the titlebar hides the window, rather than docking/undocking it.

Is there an easy way to do this, or should I just not use QDockWidget until I have a QMainWindow?

Many thanks!

jpn
9th October 2008, 19:23
You can temporarily filter out the mouse double click event with an event filter (http://doc.trolltech.com/4.4/qobject.html#eventFilter).

ElectroQt
9th October 2008, 23:22
Thanks for the quick response, that worked a treat - once I realised that the correct event type was QEvent::NonClientAreaMouseButtonDblClick :)