From dec934cd967335898f8dbd9beb24c28833b6294e Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 7 Aug 2012 11:52:43 +0200 Subject: Avoid potential crash. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The setGeometry call triggers a resizeEvent() so make sure the backing store is created before that. Change-Id: I26aa3ef6c0515311e3ca21f938a92ca1a20d0030 Reviewed-by: Samuel Rødal --- examples/gui/rasterwindow/rasterwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/gui') diff --git a/examples/gui/rasterwindow/rasterwindow.cpp b/examples/gui/rasterwindow/rasterwindow.cpp index e999ed92b1..9424a90b95 100644 --- a/examples/gui/rasterwindow/rasterwindow.cpp +++ b/examples/gui/rasterwindow/rasterwindow.cpp @@ -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] -- cgit v1.2.3