aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow.cpp
diff options
context:
space:
mode:
authorBalazs Kelemen <kbalazs@webkit.org>2012-09-27 12:24:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-28 18:50:32 +0200
commit75445c228476e4905cef3fb89a849f93f33e768f (patch)
treef8a9cb3a9eca2e85e8893e57078d912870d3ad3a /src/quick/items/qquickwindow.cpp
parente03363dfd1aeddd085c4c86d9a1964da769d7980 (diff)
Allow grabbing windows rendered without showing for testing.
To make QQuickWindowPrivate::setRenderWithoutShowing more useful for autotesting we can allow grabbing such windows. This is safe if the platform window have been created and the window has a valid size. Change-Id: I8b9a2aaeb93935f662b75ef29651730b890441d5 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r--src/quick/items/qquickwindow.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index b0e3db2c87..b657094e29 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -259,9 +259,8 @@ void QQuickWindowPrivate::polishItems()
* This parameter enables that this window can be rendered without
* being shown on screen. This feature is very limited in what it supports.
*
- * There needs to be another window actually showing that we can make current
- * to get a surface to make current AND for this feature to be useful
- * one needs to hook into beforeRender() and set the render tareget.
+ * For this feature to be useful one needs to hook into beforeRender()
+ * and set the render tareget.
*
*/
void QQuickWindowPrivate::setRenderWithoutShowing(bool render)
@@ -1996,6 +1995,13 @@ bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent
return overThreshold;
}
+bool QQuickWindowPrivate::isRenderable() const
+{
+ if (geometry.width() <= 0 || geometry.height() <= 0)
+ return false;
+ return visible || (renderWithoutShowing && platformWindow);
+}
+
/*!
Propagates an event \a e to a QQuickItem \a item on the window.