PDA

View Full Version : How to stop autodocking for QDockWidget?



pastispast
22nd January 2011, 17:47
Hi friends,

I want to stop the auto-docking of the dock-widget. Consider my mainwindow layout is like:



----------|------------------|
Dock1 | |
----------| CENTRE |
Dock2 | |
----------|------------------|


I want when I double click on the Dock2(make it float-able) then dock1 should not auto expand(i.e.make Dock2 place blank) similarly for vice-verse.

I have tried with the setFeatures() function with the appropriate arguments but it does not work. I do not want to make the dockwidget fix as I want to resize it.

What I am missing here?

Thanks...

bothorsen
23rd January 2011, 08:31
You can't do that. And I can't see why you would - empty space in a window is pointless.

pastispast
24th January 2011, 08:16
Thanks bothorsen for the reply...

Actually want to give the option to the user to use "dock features" or not, that's why I want to do above one...

Thomas_Lerman
15th November 2011, 23:53
I actually wish that this feature or at least my interpretation existed. It would be nice to have a dock widget that did looked like it was floating all the time, but could be "docked" on some corner without changing the central widget size. Obviously, this would not make sense on many applications. However, it could on some cases and I will try to give a hypothetical example. In Google Earth or some kind of paint application, have a window docked in the bottom-right corner to perform some specific actions. This would not affect the full view of the center widget. I may even want the "docked" widget to not be movable, sizable, etc. However, when the window moves or resizes, the widget would still be in the bottom-right corner. Maybe something like this:


|------------------|
| |
| CENTRAL |
| |
| |------|
| | Dock |
|------------------|

I do realize that this can be done with other methods. I am just saying it would be nice.

Something else that is related: It would be VERY nice as well would be having the ability to
setTitleBarWidget()on more than just a QDockWidget, for example, a QMainWindow, QDialog, etc. Yes, this can also be done with other methods as well.