@@ -201,15 +201,15 @@ CDockContainerWidget* CAutoHideDockContainer::dockContainer() const
201
201
202
202
203
203
// ============================================================================
204
- CAutoHideDockContainer::CAutoHideDockContainer (CDockManager* DockManager , SideBarLocation area, CDockContainerWidget* parent) :
205
- Super (parent),
204
+ CAutoHideDockContainer::CAutoHideDockContainer (CDockWidget* DockWidget , SideBarLocation area, CDockContainerWidget* parent) :
205
+ Super (parent),
206
206
d (new AutoHideDockContainerPrivate(this ))
207
207
{
208
208
hide (); // auto hide dock container is initially always hidden
209
209
d->SideTabBarArea = area;
210
210
d->SideTab = componentsFactory ()->createDockWidgetSideTab (nullptr );
211
211
connect (d->SideTab , &CAutoHideTab::pressed, this , &CAutoHideDockContainer::toggleCollapseState);
212
- d->DockArea = new CDockAreaWidget (DockManager , parent);
212
+ d->DockArea = new CDockAreaWidget (DockWidget-> dockManager () , parent);
213
213
d->DockArea ->setObjectName (" autoHideDockArea" );
214
214
d->DockArea ->setAutoHideDockContainer (this );
215
215
@@ -219,25 +219,20 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockManager* DockManager, SideBa
219
219
d->Layout ->setContentsMargins (0 , 0 , 0 , 0 );
220
220
d->Layout ->setSpacing (0 );
221
221
setLayout (d->Layout );
222
- d->Layout ->addWidget (d->DockArea );
223
222
d->ResizeHandle = new CResizeHandle (edgeFromSideTabBarArea (area), this );
224
223
d->ResizeHandle ->setMinResizeSize (64 );
225
224
bool OpaqueResize = CDockManager::testConfigFlag (CDockManager::OpaqueSplitterResize);
226
225
d->ResizeHandle ->setOpaqueResize (OpaqueResize);
227
226
d->Layout ->insertWidget (resizeHandleLayoutPosition (area), d->ResizeHandle );
228
227
d->Size = d->DockArea ->size ();
229
228
230
- updateSize ();
231
- parent->registerAutoHideWidget (this );
232
- }
233
-
234
-
235
- // ============================================================================
236
- CAutoHideDockContainer::CAutoHideDockContainer (CDockWidget* DockWidget, SideBarLocation area, CDockContainerWidget* parent) :
237
- CAutoHideDockContainer (DockWidget->dockManager (), area, parent)
238
- {
239
229
addDockWidget (DockWidget);
240
- hide ();
230
+ parent->registerAutoHideWidget (this );
231
+ // The dock area should not be added to the layout before it contains the
232
+ // dock widget. If you add it to the layout before it contains the dock widget
233
+ // then you will likely see this warning for OpenGL widgets or QAxWidgets:
234
+ // setGeometry: Unable to set geometry XxY+Width+Height on QWidgetWindow/'WidgetClassWindow
235
+ d->Layout ->addWidget (d->DockArea );
241
236
}
242
237
243
238
0 commit comments