From ef8da487a84ef93636220b1ef89b3fc21cca7b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 15 Nov 2011 15:02:03 +0100 Subject: [PATCH] Adding a "helper assert" for when you can create QWindow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit maybe if your trying to instansiate a QWindow before the QApplication has been instansiated. Change-Id: I68ed4ad1dbdfedc242a7cb27c1381d50a3d3dfa4 Reviewed-by: Samuel Rødal --- src/gui/kernel/qwindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index c2a698ef9b..069764e545 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -64,6 +64,11 @@ 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); + QGuiApplicationPrivate::window_list.prepend(this); }