@@ -117,7 +117,7 @@ struct AutoHideDockContainerPrivate
117117 CResizeHandle* ResizeHandle = nullptr ;
118118 QSize Size; // creates invalid size
119119 QPointer<CAutoHideTab> SideTab;
120- QSize InitialDockWidgetSize ;
120+ QSize SizeCache ;
121121
122122 /* *
123123 * Private data constructor
@@ -216,7 +216,7 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockWidget* DockWidget, SideBarL
216216 bool OpaqueResize = CDockManager::testConfigFlag (CDockManager::OpaqueSplitterResize);
217217 d->ResizeHandle ->setOpaqueResize (OpaqueResize);
218218 d->Size = d->DockArea ->size ();
219- d->InitialDockWidgetSize = DockWidget->size ();
219+ d->SizeCache = DockWidget->size ();
220220
221221 addDockWidget (DockWidget);
222222 parent->registerAutoHideWidget (this );
@@ -239,12 +239,6 @@ void CAutoHideDockContainer::updateSize()
239239 }
240240
241241 auto rect = dockContainerParent->contentRect ();
242- qDebug () << " dockContainerParent->contentRect() " << rect;
243- qDebug () << " dockWidget()->rect()" << dockWidget ()->rect ();
244- qDebug () << " dockAreaWidget()->rect(): " << dockAreaWidget ()->rect ();
245- qDebug () << " CAutoHideDockContainer::isVisible " << this ->isVisible ();
246- qDebug () << " CAutoHideDockContainer::rect " << this ->rect ();
247-
248242 switch (sideBarLocation ())
249243 {
250244 case SideBarLocation::SideBarTop:
@@ -279,8 +273,14 @@ void CAutoHideDockContainer::updateSize()
279273 break ;
280274 }
281275
282- qDebug () << " CAutoHideDockContainer::rect (after): " << this ->rect ();
283- qDebug () << " dockAreaWidget()->rect(): " << dockAreaWidget ()->rect ();
276+ if (orientation () == Qt::Horizontal)
277+ {
278+ d->SizeCache .setHeight (this ->height ());
279+ }
280+ else
281+ {
282+ d->SizeCache .setWidth (this ->width ());
283+ }
284284}
285285
286286// ============================================================================
@@ -658,31 +658,24 @@ bool CAutoHideDockContainer::event(QEvent* event)
658658}
659659
660660
661- // ============================================================================
662- QSize CAutoHideDockContainer::initialDockWidgetSize () const
663- {
664- return d->InitialDockWidgetSize ;
665- }
666-
667-
668661// ============================================================================
669662Qt::Orientation CAutoHideDockContainer::orientation () const
670663{
671- return autoHideSideBar ()->orientation ();
664+ return ads::internal::isHorizontalSideBarLocation (d->SideTabBarArea )
665+ ? Qt::Horizontal : Qt::Vertical;
672666}
673667
674668
675669// ============================================================================
676670void CAutoHideDockContainer::resetToInitialDockWidgetSize ()
677671{
678- auto OriginalSize = initialDockWidgetSize ();
679672 if (orientation () == Qt::Horizontal)
680673 {
681- setSize (OriginalSize .height ());
674+ setSize (d-> SizeCache .height ());
682675 }
683676 else
684677 {
685- setSize (OriginalSize .width ());
678+ setSize (d-> SizeCache .width ());
686679 }
687680}
688681
@@ -691,8 +684,6 @@ void CAutoHideDockContainer::resetToInitialDockWidgetSize()
691684void CAutoHideDockContainer::moveToNewSideBarLocation (SideBarLocation NewSideBarLocation,
692685 int TabIndex)
693686{
694- qDebug () << " CAutoHideDockContainer::moveToNewSideBarLocation TabIndex " <<
695- TabIndex << " this->tabIndex: " << this ->tabIndex ();
696687 if (NewSideBarLocation == sideBarLocation () && TabIndex == this ->tabIndex ())
697688 {
698689 return ;
0 commit comments