aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/examples/tst_examples.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2012-12-05 06:27:47 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-18 12:26:55 +0100
commitebe8b9408cfcd953fae80514aa67e49221541bed (patch)
treea9728a64f5f462dc45dabce591f67140738b0edc /tests/auto/quick/examples/tst_examples.cpp
parent9c54d0ef8f6442e32d5762edccef46db80b68681 (diff)
Complete rewrite of threaded render loop.
This change starts using the superior implementation of the scene graph render loop which has been worked on in the scenegraph-playground project for a while. It uses a far more straightforward locking/sync paradigm compared to the existing one and is less deadlock and error prone. It also enables the scene graph thread to run on its own when the GUI thread is blocked, enabling threaded animations. This changes also introduces a naming change inside Qt Quick from "Window Manager" -> "Render Loop" as that fits better to what the code does. Change-Id: I1c2170ee04fcbef79660bd7dae6cace647cdb276 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tests/auto/quick/examples/tst_examples.cpp')
-rw-r--r--tests/auto/quick/examples/tst_examples.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp
index 7055fb6e03..9c5fb88af2 100644
--- a/tests/auto/quick/examples/tst_examples.cpp
+++ b/tests/auto/quick/examples/tst_examples.cpp
@@ -82,11 +82,9 @@ private:
QStringList findQmlFiles(const QDir &);
QQmlEngine engine;
-
- QQuickWindow *window;
};
-tst_examples::tst_examples() : window(0)
+tst_examples::tst_examples()
{
// Add files to exclude here
excludedFiles << "examples/quick/canvas/tiger/tiger.qml"; // QTBUG-26528
@@ -94,7 +92,7 @@ tst_examples::tst_examples() : window(0)
// Add directories you want excluded here (don't add examples/, because they install to examples/qtdeclarative/)
excludedDirs << "shared"; //Not an example
- excludedDirs << "qtquick/text/fonts"; // QTBUG-21415
+ excludedDirs << "quick/text/fonts"; // QTBUG-29004
excludedDirs << "snippets/qml/path"; //No root QQuickItem
excludedDirs << "tutorials/gettingStartedQml"; //C++ example, but no cpp files in root dir
@@ -120,7 +118,6 @@ tst_examples::tst_examples() : window(0)
tst_examples::~tst_examples()
{
- delete window;
}
void tst_examples::init()
@@ -260,6 +257,9 @@ void tst_examples::sgexamples_data()
void tst_examples::sgexamples()
{
QFETCH(QString, file);
+ QQuickWindow window;
+ window.setPersistentOpenGLContext(true);
+ window.setPersistentSceneGraph(true);
QQmlComponent component(&engine, QUrl::fromLocalFile(file));
if (component.status() == QQmlComponent::Error)
@@ -272,13 +272,11 @@ void tst_examples::sgexamples()
component.completeCreate();
QVERIFY(root);
- if (!window) {
- window = new QQuickWindow();
- window->resize(240, 320);
- window->show();
- QVERIFY(QTest::qWaitForWindowExposed(window));
- }
- root->setParentItem(window->contentItem());
+ window.resize(240, 320);
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+
+ root->setParentItem(window.contentItem());
component.completeCreate();
qApp->processEvents();
@@ -303,6 +301,8 @@ void tst_examples::sgsnippets_data()
void tst_examples::sgsnippets()
{
+ QQuickWindow window;
+
QFETCH(QString, file);
QQmlComponent component(&engine, QUrl::fromLocalFile(file));
@@ -316,13 +316,11 @@ void tst_examples::sgsnippets()
component.completeCreate();
QVERIFY(root);
- if (!window) {
- window = new QQuickWindow();
- window->resize(240, 320);
- window->show();
- QVERIFY(QTest::qWaitForWindowExposed(window));
- }
- root->setParentItem(window->contentItem());
+ window.resize(240, 320);
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+
+ root->setParentItem(window.contentItem());
component.completeCreate();
qApp->processEvents();