PDA

View Full Version : QDockWidget/Central Widget Problem



Lemming
9th June 2006, 21:11
Hi!

I'm working on the application with the user interface, based around the docking widgets. The ide is that all parts of the UI should be resizable, movable and floatable. The problem is that there is no central widget in my application. This causes some empty space that should not be there. Covering this space by resizing the widgets causes two splitters to become adjacent (and that is definetely not good). The attached screenshots showcase the nature of the problem.

Is there any known way to deal with this problem? Probably there can be some kind of a set-up for dock widgets and corners that will help (can't think of one now) or some other workaround?

Thank You

/Lemming/

fullmetalcoder
11th June 2006, 12:01
my understanding of your screenshots is that your app aims to be some sort of scrip IDE. What's wrong with setting the "Javascript pane" as central widget? It wouldn't be directly resizable or movable but moving and resizing other dock widgets would give the impression that it is...

Anyway, a main windows with only dockable components seems a bad idea to me... there should be at least one "static" component (i.e central widget), whatever you put inside...

Lemming
12th June 2006, 13:36
Yes, this is a Script IDE... sort of...

And there will be VB Script and Applescript panes as well. And they are required to be visible at the same time. Therefore turning one of the script panes into a central widget doesn't seem to be an option...

jwintz
12th June 2006, 14:06
And how about some kind of template general script pane as a central widget which can be specialized for a specific kind of script within a script manager which would allow the edition of several scripts in maybe different script languages ?

Another idea is to have a document manager like the kate one as a central widget and docks for each kind of script language which features specific actions meeting the script language requirements ...

I know it is never funny to change its application architecture ... but I agree with fullmetalcoder, an application with only dock widget is not very common and I think the QMainWindow has not been designed to meet this purpose ...

Usability
17th May 2007, 12:13
Hi!

I'm working on the application with the user interface, based around the docking widgets. The ide is that all parts of the UI should be resizable, movable and floatable. The problem is that there is no central widget in my application.
/Lemming/


It turns out that you can work with a QMainWindow populated only with QDockWidgets, and have those widgets share all available space, provided you follow 2 requirements:

1.
All the QDockWidgets must have the same setting for docWidgetArea, e.g. Qt:BottomDockWidgetArea. You cannot mix, bottom, left or right. Of course you can set allowedAreas to Qt:AllDockWidgetAreas and the user can then distribute them as they wish.

2.
There must be no central widget. Designer always creates one of these called centralwidget, so simply delete the sucker in your QMainWindow constructor.

Arthur
1st March 2010, 10:55
Hello,

I tried this with the dockwidgets example delivered in Qt 4.4.1

- setCentralWidget(0) in the intialization
- All QDockWidgets have Qt::AllDockWidgetAreas as dock settings

It seems that I dock the QWidgets horizontally and I can create tabs, but I cannot arrange them vertically.

Is there any solution to this?

FelixB
9th June 2011, 08:54
Hi,

I was facing the same problem as Arthur: I have a QMainWindow without central widget and was not able to arrange QDockWidgets vertically. Finally I found a solution:

QMainWindow->setDockNestingEnabled(true)

Felix

mkh
3rd April 2016, 10:52
This should do the trick:


centralWidget()->hide();