aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/threadedanimation
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/scenegraph/threadedanimation')
-rw-r--r--examples/quick/scenegraph/threadedanimation/spinner.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/quick/scenegraph/threadedanimation/spinner.cpp b/examples/quick/scenegraph/threadedanimation/spinner.cpp
index 7b4281aafc..83c4494720 100644
--- a/examples/quick/scenegraph/threadedanimation/spinner.cpp
+++ b/examples/quick/scenegraph/threadedanimation/spinner.cpp
@@ -66,8 +66,8 @@ public:
, m_spinning(false)
, m_window(window)
{
- connect(window, &QQuickWindow::beforeRendering, this, &SpinnerNode::maybeRotate);
- connect(window, &QQuickWindow::frameSwapped, this, &SpinnerNode::maybeUpdate);
+ connect(window, &QQuickWindow::beforeRendering, this, &SpinnerNode::maybeRotate, Qt::DirectConnection);
+ connect(window, &QQuickWindow::frameSwapped, this, &SpinnerNode::maybeUpdate, Qt::DirectConnection);
QImage image(":/scenegraph/threadedanimation/spinner.png");
m_texture = window->createTextureFromImage(image);
@@ -96,6 +96,9 @@ public slots:
matrix.rotate(m_rotation, 0, 0, 1);
matrix.translate(-32, -32);
setMatrix(matrix);
+
+ // If we're inside a QQuickWidget, this call is necessary to ensure the widget gets updated.
+ m_window->update();
}
}