diff --git a/src/libs/utils/fancymainwindow.cpp b/src/libs/utils/fancymainwindow.cpp index 30e8547a512942907d0fa002eadda57ef0649bdd..4fc91537da7fbb29dbdba00399a5393652a12e17 100644 --- a/src/libs/utils/fancymainwindow.cpp +++ b/src/libs/utils/fancymainwindow.cpp @@ -61,7 +61,6 @@ struct FancyMainWindowPrivate QAction m_menuSeparator1; QAction m_menuSeparator2; QAction m_resetLayoutAction; - QDockWidget *m_toolBarDockWidget; QAction m_autoHideTitleBars; }; @@ -336,7 +335,6 @@ FancyMainWindowPrivate::FancyMainWindowPrivate(FancyMainWindow *parent) : m_menuSeparator1(0), m_menuSeparator2(0), m_resetLayoutAction(FancyMainWindow::tr("Reset to Default Layout"), 0), - m_toolBarDockWidget(0), m_autoHideTitleBars(FancyMainWindow::tr("Automatically Hide View Title Bars"), 0) { m_menuSeparator1.setSeparator(true); @@ -552,14 +550,4 @@ void FancyMainWindow::setDockActionsVisible(bool v) d->m_resetLayoutAction.setVisible(v); } -QDockWidget *FancyMainWindow::toolBarDockWidget() const -{ - return d->m_toolBarDockWidget; -} - -void FancyMainWindow::setToolBarDockWidget(QDockWidget *dock) -{ - d->m_toolBarDockWidget = dock; -} - } // namespace Utils diff --git a/src/libs/utils/fancymainwindow.h b/src/libs/utils/fancymainwindow.h index 4a620ee5e45e9bde6f0314a4894ec26f8878e5f9..1b1cbde4a1acb853eb17b81e424bb67ca62e6b6f 100644 --- a/src/libs/utils/fancymainwindow.h +++ b/src/libs/utils/fancymainwindow.h @@ -65,9 +65,6 @@ public: QAction *resetLayoutAction() const; void addDockActionsToMenu(QMenu *menu); - QDockWidget *toolBarDockWidget() const; - void setToolBarDockWidget(QDockWidget *dock); - bool autoHideTitleBars() const; signals: diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 60f629961a9116984360ed8b5c40bda054bcfdf7..cbcc1b6dc0228bc97db1b953c306a873b3529bab 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -70,16 +70,6 @@ DebuggerMainWindow::DebuggerMainWindow() connect(this, &FancyMainWindow::resetLayout, this, &DebuggerMainWindow::resetCurrentPerspective); - - auto dock = new QDockWidget(tr("Toolbar")); - dock->setObjectName(QLatin1String("Toolbar")); - dock->setFeatures(QDockWidget::NoDockWidgetFeatures); - dock->setAllowedAreas(Qt::BottomDockWidgetArea); - dock->setTitleBarWidget(new QWidget(dock)); // hide title bar - dock->setProperty("managed_dockwidget", QLatin1String("true")); - - addDockWidget(Qt::BottomDockWidgetArea, dock); - setToolBarDockWidget(dock); } DebuggerMainWindow::~DebuggerMainWindow() @@ -163,8 +153,6 @@ void DebuggerMainWindow::finalizeSetup() menu.exec(viewButton->mapToGlobal(QPoint())); }); - toolBarDockWidget()->setWidget(toolbar); - Context debugcontext(Debugger::Constants::C_DEBUGMODE); ActionContainer *viewsMenu = ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS); @@ -186,6 +174,17 @@ void DebuggerMainWindow::finalizeSetup() viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE); addDockActionsToMenu(viewsMenu->menu()); + + auto dock = new QDockWidget(tr("Toolbar")); + dock->setObjectName(QLatin1String("Toolbar")); + dock->setFeatures(QDockWidget::NoDockWidgetFeatures); + dock->setAllowedAreas(Qt::BottomDockWidgetArea); + dock->setTitleBarWidget(new QWidget(dock)); // hide title bar + dock->setProperty("managed_dockwidget", QLatin1String("true")); + dock->setWidget(toolbar); + m_toolbarDock = dock; + + addDockWidget(Qt::BottomDockWidgetArea, dock); } void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId, bool fromStoredSettings) @@ -240,7 +239,7 @@ void DebuggerMainWindow::loadPerspectiveHelper(const QByteArray &perspectiveId, addDockWidget(operation.area, dock); QDockWidget *anchor = m_dockForDockId.value(operation.anchorDockId); if (!anchor && operation.area == Qt::BottomDockWidgetArea) - anchor = toolBarDockWidget(); + anchor = m_toolbarDock; if (anchor) { switch (operation.operationType) { case Perspective::AddToTab: diff --git a/src/plugins/debugger/debuggermainwindow.h b/src/plugins/debugger/debuggermainwindow.h index b1aeb1633970778bb32fea0f9689c3317ade85d3..9577e349c1837a2cc81f723d6d2c7938293994d3 100644 --- a/src/plugins/debugger/debuggermainwindow.h +++ b/src/plugins/debugger/debuggermainwindow.h @@ -127,6 +127,7 @@ private: QComboBox *m_perspectiveChooser; QStackedWidget *m_controlsStackWidget; Utils::StatusLabel *m_statusLabel; + QDockWidget *m_toolbarDock; QHash<QByteArray, QDockWidget *> m_dockForDockId; QHash<QByteArray, QWidget *> m_toolbarForPerspectiveId;