summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-05-04 12:38:39 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-05-04 13:14:29 +0200
commitf838dcc050217507fd060d4c5dd093eb22ac95af (patch)
treece7745321d32405a3c8265e1975af2ff4169d435 /examples
parent9ff98b92a176a011b16d5bf538a2dcc3f8494ca5 (diff)
Improved handling of child windows.
Don't force-create QWindows until they're explicitly created or shown.
Diffstat (limited to 'examples')
-rw-r--r--examples/qpa/windows/window.cpp11
1 files changed, 3 insertions, 8 deletions
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 <private/qguiapplication_qpa_p.h>
+#include <private/qguiapplication_p.h>
#include <private/qwindowsurface_p.h>
#include <QPainter>
@@ -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());