PDA

View Full Version : Disable dragging a QDockWidget with the mouse



jl_287
29th January 2015, 23:47
Hello,

I have a QDockWidget that is floating. It does not have a frame or frame's Titlebar. but it does have the regular QDockWidget Title. Normally users drag the QDockWidget with the mouse, but I want to disable this.
If the QDockWidget is floating, I want it to remain in a fixed position which I set using the move function. The user should not be allowed to drag it. However, the user should still be able to dock/undock it by pressing the little dock/undock button on the right of the QDockWidget title.

Is what I am hoping to achieve possible?

Thanks,
jl_287

wysota
31st January 2015, 15:21
The most obvious solution is to not make the widget a QDockWidget. However in my personal opinion I would really stay away from your application if you didn't allow me to move windows on my desktop the way I like (of course I could still do it using the means my system provides).