QMainWindowLayout: Fix build with -no-feature-dockwidget

Make deletion of unused tab bars conditional to dockwidget and tabwidget
features.

Task-number: QTBUG-135468
Pick-to: 6.8 6.5
Change-Id: I0ecb55ab20737f401796cdd4ebbc6040e54b5afe
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b37f84ba414f36d941d42f7addb2f8ca1516d3d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Nodir Temirkhodjaev 2025-04-04 19:37:59 +05:00 committed by Qt Cherry-pick Bot
parent 08a65966af
commit 541d53f28d

View File

@ -2727,10 +2727,12 @@ QMainWindowLayout::~QMainWindowLayout()
delete statusbar;
#if QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
// unusedTabBars contains unparented tab bars, which need to be removed manually.
// ~QMainWindowTabBar() removes the bar from unusedTabBars => call qDeleteAll() on a copy.
const auto bars = unusedTabBars;
qDeleteAll(bars);
#endif // QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
}
void QMainWindowLayout::setDockOptions(QMainWindow::DockOptions opts)