diff options
author | Eike Ziller <eike.ziller@qt.io> | 2016-09-26 15:13:44 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2016-09-30 08:16:47 +0000 |
commit | 79be19a8a024e70c572ee351493d648d5cbb50ee (patch) | |
tree | 19f478864be56a5aa8d38e54bcfefb913e837d56 /src/plugins/coreplugin/icore.cpp | |
parent | 9c9485e15b9d285c92250909c432af2ee67e8de9 (diff) |
ICore: Make sure main window is initialized
Initialize main window even if no ICore instance is created, so in that
case methods like raiseWindow and dialogParent will still work.
Change-Id: I7b435dedac574bcc120e996c198c413fd5ccfe6f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/icore.cpp')
-rw-r--r-- | src/plugins/coreplugin/icore.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 6f16befc91..df9a58d297 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -297,8 +297,8 @@ using namespace ExtensionSystem; namespace Core { // The Core Singleton -static ICore *m_instance = 0; -static MainWindow *m_mainwindow; +static ICore *m_instance = nullptr; +static MainWindow *m_mainwindow = nullptr; ICore *ICore::instance() { @@ -517,7 +517,7 @@ void ICore::raiseWindow(QWidget *widget) if (!widget) return; QWidget *window = widget->window(); - if (window == m_mainwindow) { + if (window && window == m_mainwindow) { m_mainwindow->raiseWindow(); } else { window->raise(); |