Prevent docking on doubleclick
Hello,
Could somebody tell me how I can prevent docking action on mouse doubleclick on title bar. I create my dockable widget as follow:
Code:
d->setAllowedAreas(Qt::NoDockWidgetArea);
d
->setFeatures
( QDockWidget::DockWidgetFloatable|QDockWidget
::DockWidgetMovable|QDockWidget
::DockWidgetClosable );
myView = new SplitCombineFiles( d );
d->setWidget(myView );
d->setFloating ( true );
i would think that i set all flags possible to prevent docking, but no, it still docks on double click.
Thanks in advance.
Re: Prevent docking on doubleclick
You can install an event filter on the dock's title bar widget (available with QDockWidget::titleBarWidget) and ignore any two consecutive mouse press events that appear within QApplication::doubleClickInterval.
See QObject::installEventFilter.
Re: Prevent docking on doubleclick
What do you mean by "install". I would appreciate sample code.
Re: Prevent docking on doubleclick
Never mind, I found sample code. Thanks a lot. Good suggestion.