Avoid potential crash.
authorGunnar Sletta <gunnar.sletta@nokia.com>
Tue, 7 Aug 2012 09:52:43 +0000 (11:52 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 8 Aug 2012 10:04:49 +0000 (12:04 +0200)
The setGeometry call triggers a resizeEvent() so make sure the backing
store is created before that.

Change-Id: I26aa3ef6c0515311e3ca21f938a92ca1a20d0030
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
examples/gui/rasterwindow/rasterwindow.cpp

index e999ed9..9424a90 100644 (file)
@@ -45,11 +45,11 @@ RasterWindow::RasterWindow(QWindow *parent)
     : QWindow(parent)
     , m_update_pending(false)
 {
+    m_backingStore = new QBackingStore(this);
     create();
 
     setGeometry(100, 100, 300, 200);
 
-    m_backingStore = new QBackingStore(this);
 }
 //! [1]