From f838dcc050217507fd060d4c5dd093eb22ac95af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 4 May 2011 12:38:39 +0200 Subject: Improved handling of child windows. Don't force-create QWindows until they're explicitly created or shown. --- examples/qpa/windows/window.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/qpa/windows/window.cpp b/examples/qpa/windows/window.cpp index 0f3355b86b..d08db5714b 100644 --- a/examples/qpa/windows/window.cpp +++ b/examples/qpa/windows/window.cpp @@ -1,6 +1,6 @@ #include "window.h" -#include +#include #include #include @@ -15,22 +15,17 @@ QColor colorTable[] = }; Window::Window(QWindow *parent) - : QWindow(0) + : QWindow(parent) , m_backgroundColorIndex(colorIndexId++) { setSurfaceType(RasterSurface); setWindowTitle(QLatin1String("Window")); if (parent) - setGeometry(QRect(10, 10, 40, 40)); + setGeometry(QRect(160, 120, 320, 240)); else setGeometry(QRect(10, 10, 640, 480)); - if (parent) { - setParent(parent); - setGeometry(QRect(160, 120, 320, 240)); - } - create(); QGuiApplicationPrivate::platformIntegration()->createWindowSurface(this, winId()); -- cgit v1.2.3