QQuickWindow cannot rely on QWindowPrivate.geometry
authorShawn Rutledge <shawn.rutledge@digia.com>
Fri, 23 Nov 2012 16:04:43 +0000 (17:04 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 26 Nov 2012 09:24:07 +0000 (10:24 +0100)
because sometimes geometry has been set on the platform window and
sometimes it's only stored in the QWindow geometry, waiting for the
asynchronous confirmation.  So it should call QWindow::geometry()
instead.

Change-Id: Ifa54792be31440108fae212240a46ae269393eb7
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
src/quick/items/qquickwindow.cpp

index 806766d..99db98d 100644 (file)
@@ -1996,12 +1996,13 @@ bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent
 
 bool QQuickWindowPrivate::isRenderable() const
 {
-    if (geometry.width() <= 0 || geometry.height() <= 0)
+    const QQuickWindow *q = q_func();
+    QRect geom = q->geometry();
+    if (geom.width() <= 0 || geom.height() <= 0)
         return false;
     // Change to be applied after the visibility property is integrated in qtbase:
 //    return visibility != QWindow::Hidden || (renderWithoutShowing && platformWindow);
     // Temporary version which is implementation-agnostic but slightly less efficient:
-    const QQuickWindow *q = q_func();
     return q->isVisible() || (renderWithoutShowing && platformWindow);
 }