Dockarea within own widget
-
I want to be able to "tear off" part of a widget which is currently a grid layout containing a label, tabbed widget and a tableview.
I imagine that I could place all of those inside a dock widget, but how do I create an area within my widget that can contain that dock widget? There doesn't seem to be anything I can find that will accept dock widgets being dropped on them ...
-
I want to be able to "tear off" part of a widget which is currently a grid layout containing a label, tabbed widget and a tableview.
I imagine that I could place all of those inside a dock widget, but how do I create an area within my widget that can contain that dock widget? There doesn't seem to be anything I can find that will accept dock widgets being dropped on them ...
@Perdrix said in Dockarea within own widget:
but how do I create an area within my widget that can contain that dock widget?
The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop.
?
-
Hi,
Dock area is only available in QMainWindow.
Are you using one or do you want your widget to act like one ?
If the later, there are projects providing docking like KDAB's KDDockWidgets.
-
Yes I'm using a QMainWindow, but I don't want this to be docked in any of its dock areas in the initial case, but in a dock area within my own widget.
David
-
How to persuade Qt Designer to insert a QMainWindow into my widget? I tried adding a QWidget and tried to promote it to a QMainWindow and Designer complained:
Thanks
D. -
Does that mainwindow.h have to be created by me ... It's odd that Qt Designer recognised MainWindow immediately as something it understood!
-
I managed to get that concept working but creating a main window form wouldn't let me specify the class name for the main window or the header file, so I manually edited the ui file to add:
<customwidgets> <customwidget> <class>DSS::BayWindow</class> <extends>QMainWindow</extends> <header>baywindow.h</header> <container>1</container> </customwidget> </customwidgets>
and changed the start to look like this:
<class>StackingDlg</class> <widget class="DSS::BayWindow" name="StackingDlg">
Which has got me started! I have however hit a small problem that I'm sure is obvious to you mavens! I've so far failed to get the contents of the central widget to expand to fill it :(
What have I missed - the picture control (lower horizontal layout) is set to Expanding, Expanding so I though that would force the issue, but it doesn't seem to have done it.
I'm having the identical problem with the DockWidget: