diff --git a/src/blackgui/infoarea.cpp b/src/blackgui/infoarea.cpp index e405664c4..de987cc8b 100644 --- a/src/blackgui/infoarea.cpp +++ b/src/blackgui/infoarea.cpp @@ -51,7 +51,12 @@ namespace BlackGui void CInfoArea::initInfoArea() { - // after(!) GUI is setup + // initInfoArea() needs be called after(!) GUI is setup + + // Ref T184, child areas are now "cached" in m_childInfoAreas + // 1) the original version did always use "getChildInfoAreas", so if there are ever any issues T184 might be reverted + // 2) m_childInfoAreas needs to be initialized before findOwnDockWidgetInfoAreas + m_childInfoAreas = this->getChildInfoAreas(); if (m_dockWidgetInfoAreas.isEmpty()) { m_dockWidgetInfoAreas = this->findOwnDockWidgetInfoAreas(); @@ -476,7 +481,7 @@ namespace BlackGui { dw->displayStatusMessage(statusMessage); } - for (CInfoArea *ia : this->getChildInfoAreas()) + for (CInfoArea *ia : m_childInfoAreas) { ia->displayStatusMessage(statusMessage); } @@ -488,7 +493,7 @@ namespace BlackGui { dw->displayStatusMessages(statusMessages); } - for (CInfoArea *ia : this->getChildInfoAreas()) + for (CInfoArea *ia : m_childInfoAreas) { ia->displayStatusMessages(statusMessages); } @@ -642,11 +647,10 @@ namespace BlackGui if (infoAreas.isEmpty()) { return infoAreas; } // nested info areas? - QList childInfoAreas = this->getChildInfoAreas(); - if (childInfoAreas.isEmpty()) { return infoAreas; } + if (m_childInfoAreas.isEmpty()) { return infoAreas; } // we have child info areas (nested), we need to remove those from the list - for (CInfoArea *ia : childInfoAreas) + for (CInfoArea *ia : m_childInfoAreas) { QList nestedDockWidgets = ia->m_dockWidgetInfoAreas; if (nestedDockWidgets.isEmpty()) { continue; } diff --git a/src/blackgui/infoarea.h b/src/blackgui/infoarea.h index e6f70f77f..01d2fbef8 100644 --- a/src/blackgui/infoarea.h +++ b/src/blackgui/infoarea.h @@ -190,7 +190,8 @@ namespace BlackGui void ps_toggleTabBarLocked(bool locked); private: - QList m_dockWidgetInfoAreas ; + QList m_dockWidgetInfoAreas; + QList m_childInfoAreas; QTabBar *m_tabBar = nullptr; bool m_showTabTexts = true; //!< texts for tabs bool m_infoAreaFloating = false; //!< whole info area floating? @@ -234,10 +235,12 @@ namespace BlackGui void connectTopLevelChanged(); //! Nested info areas + //! \remark weak performance as discussed in T184 + //! \remark result stored in m_childInfoAreas QList getChildInfoAreas() const { return this->findChildren(); } //! Direct dock widget areas, not the nested dock widget areas - //! \remarks result stored in m_dockableWidgets + //! \remark result stored in m_dockableWidgets QList findOwnDockWidgetInfoAreas() const; private slots: