Window example: delay showing the splash until Component.onCompleted
authorShawn Rutledge <shawn.rutledge@digia.com>
Thu, 11 Jul 2013 08:58:16 +0000 (10:58 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 11 Jul 2013 14:55:42 +0000 (16:55 +0200)
Otherwise it will have the wrong size on KDE.

Task-number: QTBUG-32223
Change-Id: I3ed92ff8aead5c6e5a37a5189c7103a5383087ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
examples/quick/window/Splash.qml

index c981bd2..995e264 100644 (file)
@@ -44,9 +44,6 @@ import QtQuick.Window 2.1
 //! [splash-properties]
 Window {
     id: splash
-    visible: true
-    width: splashImage.width
-    height: splashImage.height
     color: "transparent"
     title: "Splash Window"
     modality: Qt.ApplicationModal
@@ -58,6 +55,8 @@ Window {
     x: (Screen.width - splashImage.width) / 2
     y: (Screen.height - splashImage.height) / 2
 //! [screen-properties]
+    width: splashImage.width
+    height: splashImage.height
 
     Image {
         id: splashImage
@@ -76,4 +75,5 @@ Window {
         }
     }
     //! [timer]
+    Component.onCompleted: visible = true
 }