diff options
author | Iikka Eklund <iikka.eklund@digia.com> | 2014-04-01 11:44:26 +0300 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@digia.com> | 2014-04-01 11:44:27 +0300 |
commit | 0ab63b035a649dc1982c867cd37d466d249004b9 (patch) | |
tree | 6de22edcd3957aae3eee698136a000e52ab7f8fe /src/gui/kernel/qwindow.cpp | |
parent | a6f8aa0ae1d5a1d1099df1891ea60b14b6eb6065 (diff) | |
parent | 0cb2c760c219514849ab0f6be8e5368f92dfa5d9 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2a6eb9dd7724931bc89f28bcc156e77c4e26d069
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index fd9e0ad61b..13da58e391 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -159,10 +159,6 @@ QWindow::QWindow(QScreen *targetScreen) d->screen = targetScreen; if (!d->screen) d->screen = QGuiApplication::primaryScreen(); - - //if your applications aborts here, then chances are your creating a QWindow before the - //screen list is populated. - Q_ASSERT(d->screen); d->init(); } @@ -232,6 +228,13 @@ QWindow::~QWindow() void QWindowPrivate::init() { Q_Q(QWindow); + + // If your application aborts here, you are probably creating a QWindow + // before the screen list is populated. + if (!screen) { + qFatal("Cannot create window: no screens available"); + exit(1); + } QObject::connect(screen, SIGNAL(destroyed(QObject*)), q, SLOT(screenDestroyed(QObject*))); QGuiApplicationPrivate::window_list.prepend(q); } |