aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/openglunderqml/squircle.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-04-25 11:16:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-26 12:57:03 +0200
commitd5e612fb3e9753c762b741d135fabd2b1f8ae1a6 (patch)
treee355cbe7bf1fba9a3841f3cf1e1f95d90b5145b5 /examples/quick/scenegraph/openglunderqml/squircle.cpp
parent1230977b001caf71725afde88d6bdcc978dfe485 (diff)
Re-implemented itemChange must always call QQuickItem::itemChange
Documentation for that fact, and the windowChanged signal. Fix existing QQuickItem subclasses which didn't call QQuickItem::itemChange. Examples should rather connect to the windowChanged() signal. Change-Id: Ieddcdbe69f849ddb120b64be9c5e0a21393b0ed9 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'examples/quick/scenegraph/openglunderqml/squircle.cpp')
-rw-r--r--examples/quick/scenegraph/openglunderqml/squircle.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/examples/quick/scenegraph/openglunderqml/squircle.cpp b/examples/quick/scenegraph/openglunderqml/squircle.cpp
index 84509fb615..8ceb9c5f9e 100644
--- a/examples/quick/scenegraph/openglunderqml/squircle.cpp
+++ b/examples/quick/scenegraph/openglunderqml/squircle.cpp
@@ -51,6 +51,7 @@ Squircle::Squircle()
, m_t(0)
, m_thread_t(0)
{
+ connect(this, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(handleWindowChanged(QQuickWindow*)));
}
//! [7]
@@ -66,17 +67,11 @@ void Squircle::setT(qreal t)
}
//! [8]
-
//! [1]
-void Squircle::itemChange(ItemChange change, const ItemChangeData &)
+void Squircle::handleWindowChanged(QQuickWindow *win)
{
- // The ItemSceneChange event is sent when we are first attached to a window.
- if (change == ItemSceneChange) {
- QQuickWindow *win = window();
- if (!win)
- return;
+ if (win) {
//! [1]
-
// Connect the beforeRendering signal to our paint function.
// Since this call is executed on the rendering thread it must be
// a Qt::DirectConnection