File tree Expand file tree Collapse file tree 3 files changed +36
-9
lines changed Expand file tree Collapse file tree 3 files changed +36
-9
lines changed Original file line number Diff line number Diff line change @@ -378,11 +378,19 @@ int CAutoHideSideBar::spacing() const
378
378
return d->TabsLayout ->spacing ();
379
379
}
380
380
381
+
381
382
// ===========================================================================
382
383
void CAutoHideSideBar::setSpacing (int Spacing)
383
384
{
384
385
d->TabsLayout ->setSpacing (Spacing);
385
386
}
386
387
388
+
389
+ // ===========================================================================
390
+ CDockContainerWidget* CAutoHideSideBar::dockContainer () const
391
+ {
392
+ return d->ContainerWidget ;
393
+ }
394
+
387
395
} // namespace ads
388
396
Original file line number Diff line number Diff line change @@ -163,6 +163,11 @@ class ADS_EXPORT CAutoHideSideBar : public QScrollArea
163
163
* Setter for spacing property - sets the spacing
164
164
*/
165
165
void setSpacing (int Spacing);
166
+
167
+ /* *
168
+ * Returns the dock container that hosts this sideBar()
169
+ */
170
+ CDockContainerWidget* dockContainer () const ;
166
171
};
167
172
} // namespace ads
168
173
// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -248,17 +248,31 @@ void DockWidgetPrivate::updateParentDockArea()
248
248
// ============================================================================
249
249
void DockWidgetPrivate::closeAutoHideDockWidgetsIfNeeded ()
250
250
{
251
- if (_this->dockContainer () && _this->dockContainer ()->openedDockWidgets ().isEmpty () && !_this->dockManager ()->isRestoringState ())
251
+ auto DockContainer = _this->dockContainer ();
252
+ if (!DockContainer)
252
253
{
253
- for (auto autoHideWidget : _this->dockContainer ()->autoHideWidgets ())
254
- {
255
- if (autoHideWidget->dockWidget () == _this)
256
- {
257
- continue ;
258
- }
254
+ return ;
255
+ }
256
+
257
+ if (_this->dockManager ()->isRestoringState ())
258
+ {
259
+ return ;
260
+ }
261
+
262
+ if (!DockContainer->openedDockWidgets ().isEmpty ())
263
+ {
264
+ return ;
265
+ }
266
+
267
+ for (auto autoHideWidget : DockContainer->autoHideWidgets ())
268
+ {
269
+ auto DockWidget = autoHideWidget->dockWidget ();
270
+ if (DockWidget == _this)
271
+ {
272
+ continue ;
273
+ }
259
274
260
- autoHideWidget->dockWidget ()->toggleView (false );
261
- }
275
+ DockWidget->toggleView (false );
262
276
}
263
277
}
264
278
You can’t perform that action at this time.
0 commit comments