refs #670, signal when UI tree is build

Motivated by slack discussion RW/KB
This commit is contained in:
Klaus Basan
2016-06-07 01:14:54 +02:00
parent 9bef6854ca
commit d44cacd97d
2 changed files with 10 additions and 3 deletions

View File

@@ -160,14 +160,17 @@ namespace BlackGui
return m; return m;
} }
void CGuiApplication::initMainApplicationWindow(QWidget *mainWindow) const void CGuiApplication::initMainApplicationWindow(QWidget *mainWindow)
{ {
if (!mainWindow) { return; } if (!mainWindow) { return; }
if (this->m_uiSetupCompleted) { return; }
this->m_uiSetupCompleted = true;
const QString name(this->getApplicationNameVersionBetaDev()); const QString name(this->getApplicationNameVersionBetaDev());
mainWindow->setObjectName(QCoreApplication::applicationName()); mainWindow->setObjectName(QCoreApplication::applicationName());
mainWindow->setWindowTitle(name); mainWindow->setWindowTitle(name);
mainWindow->setWindowIcon(m_windowIcon); mainWindow->setWindowIcon(m_windowIcon);
mainWindow->setWindowIconText(name); mainWindow->setWindowIconText(name);
emit this->uiObjectTreeReady();
} }
void CGuiApplication::setWindowIcon(const QPixmap &icon) void CGuiApplication::setWindowIcon(const QPixmap &icon)

View File

@@ -97,7 +97,7 @@ namespace BlackGui
void processEventsToRefreshGui() const; void processEventsToRefreshGui() const;
//! Init the main application window based on information in this application //! Init the main application window based on information in this application
void initMainApplicationWindow(QWidget *mainWindow) const; void initMainApplicationWindow(QWidget *mainWindow);
//! \name print messages generated during parsing / cmd handling //! \name print messages generated during parsing / cmd handling
//! @{ //! @{
@@ -156,6 +156,9 @@ namespace BlackGui
//! Style sheet changed //! Style sheet changed
void styleSheetsChanged(); void styleSheetsChanged();
//! Object tree ready (means ui->setupUi() completed)
void uiObjectTreeReady();
protected slots: protected slots:
//! Startup competed //! Startup competed
virtual void ps_startupCompleted() override; virtual void ps_startupCompleted() override;
@@ -178,7 +181,8 @@ namespace BlackGui
QCommandLineOption m_cmdWindowStateMinimized { "empty" }; //!< window state (minimized) QCommandLineOption m_cmdWindowStateMinimized { "empty" }; //!< window state (minimized)
QCommandLineOption m_cmdWindowMode { "empty" }; //!< window mode (flags: frameless ...) QCommandLineOption m_cmdWindowMode { "empty" }; //!< window mode (flags: frameless ...)
CStyleSheetUtility m_styleSheetUtility{{}, this}; //!< style sheet utility CStyleSheetUtility m_styleSheetUtility{{}, this}; //!< style sheet utility
QScopedPointer<QSplashScreen> m_splashScreen; //!< splash screen QScopedPointer<QSplashScreen> m_splashScreen; //!< splash screen
bool m_uiSetupCompleted = false; //!< ui setup completed
//! Qt help message to formatted HTML //! Qt help message to formatted HTML
static QString beautifyHelpMessage(const QString &helpText); static QString beautifyHelpMessage(const QString &helpText);