From 1e44d36ef7f43b6740c23530ae511a98f2a59105 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 18 May 2016 14:24:10 +0200 Subject: Fix links in changelog Use https and qt.io links. Change-Id: I089098317e38b52484a23bdfad128ef47eec8a21 Reviewed-by: Robin Burchell --- dist/changes-5.6.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/changes-5.6.1 b/dist/changes-5.6.1 index 5a3c9b62e6..9506987cd3 100644 --- a/dist/changes-5.6.1 +++ b/dist/changes-5.6.1 @@ -4,7 +4,7 @@ compatibility (source and binary) with Qt 5.6.0. For more details, refer to the online documentation included in this distribution. The documentation is also available online: - http://qt-project.org/doc/qt-5.6 + https://doc.qt.io/qt-5.6 The Qt version 5.6 series is binary compatible with the 5.5.x series. Applications compiled for 5.5 will continue to run with 5.6. @@ -12,7 +12,7 @@ Applications compiled for 5.5 will continue to run with 5.6. Some of the changes listed in this file include issue tracking numbers corresponding to tasks in the Qt Bug Tracker: - http://bugreports.qt-project.org/ + https://bugreports.qt.io/ Each of these identifiers can be entered in the bug tracker to obtain more information about a particular change. -- cgit v1.2.3 From a82094b63b8993630c37f7a71dac19d3f96b2804 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 19 May 2016 13:26:40 +0200 Subject: Bump version Change-Id: Id97d3672ea1bd153df57f8986994accd70ae798f --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 5c42719444..9665d2902a 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) CONFIG += qt_example_installs CONFIG += warning_clean -MODULE_VERSION = 5.6.1 +MODULE_VERSION = 5.6.2 -- cgit v1.2.3 From 18e77550f149722e0554f24ddfa326e03a9fef10 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 19 May 2016 15:56:10 -0700 Subject: Workaround for crashes in QtQml code relating to null this pointers When compiled in release mode with GCC 6, QtQml crashes. This option gets works around the issue by instructing the compiler not to delete null pointer checks for pointers that the standard says cannot be null, yet apparently are. This is a temporary workaround until a proper solution is found. Change-Id: Id3aab65533904562a6cbfffd14501a185fc91179 Reviewed-by: Lars Knoll --- src/qml/qml.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qml/qml.pro b/src/qml/qml.pro index e30c39c8b9..f4862a17a6 100644 --- a/src/qml/qml.pro +++ b/src/qml/qml.pro @@ -16,6 +16,11 @@ exists("qqml_enable_gcov") { LIBS_PRIVATE += -lgcov } +greaterThan(QT_GCC_MAJOR_VERSION, 5) { + # Our code is bad. Temporary workaround. + QMAKE_CXXFLAGS += -fno-delete-null-pointer-checks +} + QMAKE_DOCS = $$PWD/doc/qtqml.qdocconf # 2415: variable "xx" of static storage duration was declared but never referenced -- cgit v1.2.3 From e7da97bf71108a0acd72629e383f884e2d756477 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 9 Feb 2015 01:16:51 +0100 Subject: QQuickWindow: Only send focus events to items that actually gain focus Sending focus events may result in further changes to which item actually has focus, so we cannot blindly send the focus events without first checking that it hasn't subsequently changed. To accomplish this, we delay sending events as long as possible, ensuring that all necessary bookkeeping is done first to ensure internal consistency. Task-number: QTBUG-40145 Change-Id: I7d93b3f8e3fea2ecce2151c88c29601deda12453 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickwindow.cpp | 31 ++++++++++++---- .../qquicktextinput/data/focusOnlyOneOnPress.qml | 32 +++++++++++++++++ .../quick/qquicktextinput/tst_qquicktextinput.cpp | 41 ++++++++++++++++++++++ 3 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 tests/auto/quick/qquicktextinput/data/focusOnlyOneOnPress.qml diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index ef534fe35d..14e7915dba 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -785,8 +785,10 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q QQuickItemPrivate *scopePrivate = scope ? QQuickItemPrivate::get(scope) : 0; QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); + QQuickItem *oldActiveFocusItem = 0; QQuickItem *currentActiveFocusItem = activeFocusItem; QQuickItem *newActiveFocusItem = 0; + bool sendFocusIn = false; lastFocusReason = reason; @@ -794,7 +796,6 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q // Does this change the active focus? if (item == contentItem || scopePrivate->activeFocus) { - QQuickItem *oldActiveFocusItem = 0; oldActiveFocusItem = activeFocusItem; if (item->isEnabled()) { newActiveFocusItem = item; @@ -813,8 +814,6 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q #endif activeFocusItem = 0; - QFocusEvent event(QEvent::FocusOut, reason); - q->sendEvent(oldActiveFocusItem, &event); QQuickItem *afi = oldActiveFocusItem; while (afi && afi != scope) { @@ -859,7 +858,19 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q afi = afi->parentItem(); } updateFocusItemTransform(); + sendFocusIn = true; + } + + // Now that all the state is changed, emit signals & events + // We must do this last, as this process may result in further changes to + // focus. + if (oldActiveFocusItem) { + QFocusEvent event(QEvent::FocusOut, reason); + q->sendEvent(oldActiveFocusItem, &event); + } + // Make sure that the FocusOut didn't result in another focus change. + if (sendFocusIn && activeFocusItem == newActiveFocusItem) { QFocusEvent event(QEvent::FocusIn, reason); q->sendEvent(newActiveFocusItem, &event); } @@ -912,9 +923,6 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, activeFocusItem = 0; if (oldActiveFocusItem) { - QFocusEvent event(QEvent::FocusOut, reason); - q->sendEvent(oldActiveFocusItem, &event); - QQuickItem *afi = oldActiveFocusItem; while (afi && afi != scope) { if (QQuickItemPrivate::get(afi)->activeFocus) { @@ -944,7 +952,18 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, Q_ASSERT(newActiveFocusItem == scope); activeFocusItem = scope; updateFocusItemTransform(); + } + + // Now that all the state is changed, emit signals & events + // We must do this last, as this process may result in further changes to + // focus. + if (oldActiveFocusItem) { + QFocusEvent event(QEvent::FocusOut, reason); + q->sendEvent(oldActiveFocusItem, &event); + } + // Make sure that the FocusOut didn't result in another focus change. + if (newActiveFocusItem && activeFocusItem == newActiveFocusItem) { QFocusEvent event(QEvent::FocusIn, reason); q->sendEvent(newActiveFocusItem, &event); } diff --git a/tests/auto/quick/qquicktextinput/data/focusOnlyOneOnPress.qml b/tests/auto/quick/qquicktextinput/data/focusOnlyOneOnPress.qml new file mode 100644 index 0000000000..037b36c8ff --- /dev/null +++ b/tests/auto/quick/qquicktextinput/data/focusOnlyOneOnPress.qml @@ -0,0 +1,32 @@ +import QtQuick 2.2 + +Rectangle { + width: 400 + height: 400 + + Column { + spacing: 5 + TextInput { + objectName: "first" + onEditingFinished: second.focus = true + width: 100 + Rectangle { anchors.fill: parent; color: parent.activeFocus ? "red" : "blue"; opacity: 0.3 } + } + TextInput { + id: second + objectName: "second" + onEditingFinished: third.focus = true + width: 100 + Rectangle { anchors.fill: parent; color: parent.activeFocus ? "red" : "blue"; opacity: 0.3 } + } + TextInput { + objectName: "third" + id: third + width: 100 + Rectangle { anchors.fill: parent; color: parent.activeFocus ? "red" : "blue"; opacity: 0.3 } + } + Component.onCompleted: { + second.focus = true + } + } +} diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 70d3906ff3..e57a95184c 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -158,6 +158,7 @@ private slots: #endif void readOnly(); void focusOnPress(); + void focusOnPressOnlyOneItem(); void openInputPanel(); void setHAlignClearCache(); @@ -3457,6 +3458,46 @@ void tst_qquicktextinput::focusOnPress() QTest::mouseRelease(&window, Qt::LeftButton, noModifiers); } +void tst_qquicktextinput::focusOnPressOnlyOneItem() +{ + QQuickView window(testFileUrl("focusOnlyOneOnPress.qml")); + window.show(); + window.requestActivate(); + QTest::qWaitForWindowActive(&window); + + QQuickTextInput *first = window.rootObject()->findChild("first"); + QQuickTextInput *second = window.rootObject()->findChild("second"); + QQuickTextInput *third = window.rootObject()->findChild("third"); + + // second is focused onComplete + QVERIFY(second->hasActiveFocus()); + + // and first will try focus when we press it + QVERIFY(first->focusOnPress()); + + // write some text to start editing + QTest::keyClick(&window, Qt::Key_A); + + // click the first input. naturally, we are giving focus on press, but + // second's editingFinished also attempts to assign focus. lastly, focus + // should bounce back to second from first's editingFinished signal. + // + // this is a contrived example to be sure, but at the end of this, the + // important thing is that only one thing should have activeFocus. + Qt::KeyboardModifiers noModifiers = 0; + QTest::mousePress(&window, Qt::LeftButton, noModifiers, QPoint(10, 10)); + + // make sure the press is processed. + QGuiApplication::processEvents(); + + QVERIFY(second->hasActiveFocus()); // make sure it's still there + QVERIFY(!third->hasActiveFocus()); // make sure it didn't end up anywhere else + QVERIFY(!first->hasActiveFocus()); // make sure it didn't end up anywhere else + + // reset state + QTest::mouseRelease(&window, Qt::LeftButton, noModifiers, QPoint(10, 10)); +} + void tst_qquicktextinput::openInputPanel() { PlatformInputContext platformInputContext; -- cgit v1.2.3 From 82b0b31fe47a6a54c500f2cbea45b37fc28f3bee Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Mon, 2 May 2016 13:11:26 +0200 Subject: Fix crash for unknown QQmlListModel roles in debug builds If a role is unknown, trying to access it will crash in getExistingRole. Fixed that and now return QVariant() for unknown roles. Change-Id: Iad5c1292a4faee893fbc5a69984cf776aca85d70 Reviewed-by: Shawn Rutledge Reviewed-by: Robin Burchell --- src/qml/types/qqmllistmodel.cpp | 2 ++ tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 4b0aa47c63..3d71621290 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -392,6 +392,8 @@ void ListModel::updateCacheIndices() QVariant ListModel::getProperty(int elementIndex, int roleIndex, const QQmlListModel *owner, QV4::ExecutionEngine *eng) { + if (roleIndex >= m_layout->roleCount()) + return QVariant(); ListElement *e = elements[elementIndex]; const ListLayout::Role &r = m_layout->getExistingRole(roleIndex); return e->getProperty(r, owner, eng); diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp index d26c1c584b..6b1deceaf2 100644 --- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp +++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp @@ -110,6 +110,7 @@ private slots: void get_nested(); void get_nested_data(); void crash_model_with_multiple_roles(); + void crash_model_with_unknown_roles(); void set_model_cache(); void property_changes(); void property_changes_data(); @@ -968,6 +969,21 @@ void tst_qqmllistmodel::crash_model_with_multiple_roles() delete rootItem; } +void tst_qqmllistmodel::crash_model_with_unknown_roles() +{ + QQmlEngine eng; + QQmlComponent component(&eng, testFileUrl("multipleroles.qml")); + QScopedPointer rootItem(component.create()); + QVERIFY(component.errorString().isEmpty()); + QVERIFY(rootItem != 0); + QQmlListModel *model = rootItem->findChild("listModel"); + QVERIFY(model != 0); + + // used to cause a crash in debug builds + model->index(0, 0, QModelIndex()).data(Qt::DisplayRole); + model->index(0, 0, QModelIndex()).data(Qt::UserRole); +} + //QTBUG-15190 void tst_qqmllistmodel::set_model_cache() { -- cgit v1.2.3 From 40a80ec9d712d8c40ebd6a6373322c3332ff5b50 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 23 May 2016 16:01:44 +0200 Subject: Avoid Canvas crashes with qtquickcompiler Change-Id: Ic87052308706b8ef71e2f27837abfbaea57c43cc Task-number: QTBUG-49692 Reviewed-by: Mitch Curtis --- src/quick/items/context2d/qquickcanvasitem.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 9fb49f9c9e..47ac2c49da 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -675,10 +675,14 @@ void QQuickCanvasItem::itemChange(QQuickItem::ItemChange change, const QQuickIte QSGRenderContext *context = QQuickWindowPrivate::get(d->window)->context; // Rendering to FramebufferObject needs a valid OpenGL context. - if (context != 0 && (d->renderTarget != FramebufferObject || context->isValid())) - sceneGraphInitialized(); - else + if (context != 0 && (d->renderTarget != FramebufferObject || context->isValid())) { + // Defer the call. In some (arguably incorrect) cases we get here due + // to ItemSceneChange with the user-supplied property values not yet + // set. Work this around by a deferred invoke. (QTBUG-49692) + QMetaObject::invokeMethod(this, "sceneGraphInitialized", Qt::QueuedConnection); + } else { connect(d->window, SIGNAL(sceneGraphInitialized()), SLOT(sceneGraphInitialized())); + } } void QQuickCanvasItem::updatePolish() -- cgit v1.2.3 From ba87f2a375b33564ea2b6484d2c22a37ff979804 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 20 Apr 2016 21:23:02 +0200 Subject: do not enable example installs explicitly any more it's done centrally now. Change-Id: I4c0641f988da7c6bd0522453a2c7e10c8d640f02 Reviewed-by: Simon Hausmann --- .qmake.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 9665d2902a..c945d77ed8 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,5 +1,4 @@ load(qt_build_config) -CONFIG += qt_example_installs CONFIG += warning_clean MODULE_VERSION = 5.6.2 -- cgit v1.2.3 From 441baca74eba3cfcb6a63b0a63be54e6a038fba7 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 24 May 2016 13:38:10 +0200 Subject: Fix tst_qquicktext::lineLaidOutRelayout() with > 1 font MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When more than one font is needed to display the text in the layout, then the line height of the layout may not be constant. This rewrites the test to properly handle this case. Task-number: QTBUG-51934 Change-Id: I0e0cdfdc06b4a39684b33d10efdd58f98dea06b8 Reviewed-by: Tony Sarajärvi Reviewed-by: Simon Hausmann --- tests/auto/quick/qquicktext/tst_qquicktext.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index 0e8811bb17..50c75046a6 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -2772,18 +2772,19 @@ void tst_qquicktext::lineLaidOutRelayout() QVERIFY(!textPrivate->extra.isAllocated()); - qreal maxH = 0; + qreal y = 0.0; for (int i = 0; i < textPrivate->layout.lineCount(); ++i) { QTextLine line = textPrivate->layout.lineAt(i); const QRectF r = line.rect(); - const qreal h = line.height(); if (r.x() == 0) { - QCOMPARE(r.y(), i * h); - maxH = qMax(maxH, r.y() + h); + QCOMPARE(r.y(), y); } else { + if (qFuzzyIsNull(r.y())) + y = 0.0; QCOMPARE(r.x(), myText->width() / 2); - QCOMPARE(r.y(), i * h - maxH); + QCOMPARE(r.y(), y); } + y += line.height(); } delete window; -- cgit v1.2.3 From 3b2a72068f86258511fae8fd4764f0f535e5d4c8 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 25 May 2016 11:41:20 +0200 Subject: Flickable: MovementEndingTimerInterval is used only on OS X MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After 9b8d0bff, some compilers complain that it's an unused variable. Change-Id: I4a89ce7a7d73cfc039a2e2d1ad48ec7d073cf7cc Reviewed-by: Jan Arve Sæther --- src/quick/items/qquickflickable.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 7d602db57e..32d445dbc5 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -59,7 +59,9 @@ static const int FlickThreshold = 15; // will ensure the Flickable retains the grab on consecutive flicks. static const int RetainGrabVelocity = 100; +#ifdef Q_OS_OSX static const int MovementEndingTimerInterval = 100; +#endif static qreal EaseOvershoot(qreal t) { return qAtan(t); -- cgit v1.2.3 From 0e0535284379e6b740d439fa3dba2e2b5f695756 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 24 May 2016 16:22:33 +0200 Subject: QmlProfiler: When flushing data, send it in the right order Some of the adapters immediately return dataReady() when reportData() is invoked. This means that there is only one adapter in the start times list then, which in turn causes all the data from that adapter to be sent at once, without caring for the other adapters' timestamps. Change-Id: Ic1e12fdcefb0a691067518fba100368f13c927f7 Task-number: QTBUG-53590 Reviewed-by: Simon Hausmann --- src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp | 8 ++++++-- .../qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp index 2654cf662b..a5ee494ced 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp @@ -407,20 +407,24 @@ void QQmlProfilerServiceImpl::messageReceived(const QByteArray &message) void QQmlProfilerServiceImpl::flush() { QMutexLocker lock(&m_configMutex); + QList reporting; foreach (QQmlAbstractProfilerAdapter *profiler, m_engineProfilers) { if (profiler->isRunning()) { m_startTimes.insert(-1, profiler); - profiler->reportData(); + reporting.append(profiler); } } foreach (QQmlAbstractProfilerAdapter *profiler, m_globalProfilers) { if (profiler->isRunning()) { m_startTimes.insert(-1, profiler); - profiler->reportData(); + reporting.append(profiler); } } + + foreach (QQmlAbstractProfilerAdapter *profiler, reporting) + profiler->reportData(); } QT_END_NAMESPACE diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 0e63e18952..670d58e4fd 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -135,7 +135,7 @@ public: }; QQmlProfilerClient(QQmlDebugConnection *connection) - : QQmlDebugClient(QLatin1String("CanvasFrameRate"), connection) + : QQmlDebugClient(QLatin1String("CanvasFrameRate"), connection), lastTimestamp(-1) { } @@ -145,6 +145,8 @@ public: QVector asynchronousMessages; QVector pixmapMessages; + qint64 lastTimestamp; + void setTraceState(bool enabled, quint32 flushInterval = 0) { QByteArray message; QDataStream stream(&message, QIODevice::WriteOnly); @@ -343,6 +345,10 @@ void QQmlProfilerClient::messageReceived(const QByteArray &message) break; } QVERIFY(stream.atEnd()); + + QVERIFY(data.time >= lastTimestamp); + lastTimestamp = data.time; + if (data.messageType == QQmlProfilerClient::PixmapCacheEvent) pixmapMessages.append(data); else if (data.messageType == QQmlProfilerClient::SceneGraphFrame || -- cgit v1.2.3 From 7dcda224fe73cb51a29e8946afd641a989d7209a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 25 May 2016 16:22:44 +0200 Subject: Fix crash with SignalTransition Don't crash when using SignalTransition with a signal object instead of the slot used to emit the signal. A signal object is just as good. Task-number: QTBUG-53596 Change-Id: I8a419d16ec0c257c9a798a83ee5bad338794cdd2 Reviewed-by: Michael Brasser --- src/imports/statemachine/signaltransition.cpp | 26 ++++++-- src/qml/jsruntime/qv4qobjectwrapper_p.h | 2 +- .../qmltest/statemachine/tst_signaltransition.qml | 76 ++++++++++++++++++++++ 3 files changed, 96 insertions(+), 8 deletions(-) create mode 100644 tests/auto/qmltest/statemachine/tst_signaltransition.qml diff --git a/src/imports/statemachine/signaltransition.cpp b/src/imports/statemachine/signaltransition.cpp index 33ee11cbe7..4f6c769324 100644 --- a/src/imports/statemachine/signaltransition.cpp +++ b/src/imports/statemachine/signaltransition.cpp @@ -105,15 +105,27 @@ void SignalTransition::setSignal(const QJSValue &signal) QV4::ExecutionEngine *jsEngine = QV8Engine::getV4(QQmlEngine::contextForObject(this)->engine()); QV4::Scope scope(jsEngine); - QV4::Scoped qobjectSignal(scope, QJSValuePrivate::convertedToValue(jsEngine, m_signal)); - Q_ASSERT(qobjectSignal); - - QObject *sender = qobjectSignal->object(); - Q_ASSERT(sender); - QMetaMethod metaMethod = sender->metaObject()->method(qobjectSignal->methodIndex()); + QObject *sender; + QMetaMethod signalMethod; + + QV4::ScopedValue value(scope, QJSValuePrivate::convertedToValue(jsEngine, m_signal)); + + // Did we get the "slot" that can be used to invoke the signal? + if (QV4::QObjectMethod *signalSlot = value->as()) { + sender = signalSlot->object(); + Q_ASSERT(sender); + signalMethod = sender->metaObject()->method(signalSlot->methodIndex()); + } else if (QV4::QmlSignalHandler *signalObject = value->as()) { // or did we get the signal object (the one with the connect()/disconnect() functions) ? + sender = signalObject->object(); + Q_ASSERT(sender); + signalMethod = sender->metaObject()->method(signalObject->signalIndex()); + } else { + qmlInfo(this) << tr("Specified signal does not exist."); + return; + } QSignalTransition::setSenderObject(sender); - QSignalTransition::setSignal(metaMethod.methodSignature()); + QSignalTransition::setSignal(signalMethod.methodSignature()); connectTriggered(); } diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h index 1126013806..0fc39b222f 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h @@ -166,7 +166,7 @@ struct Q_QML_EXPORT QObjectMethod : public QV4::FunctionObject static void markObjects(Heap::Base *that, QV4::ExecutionEngine *e); }; -struct QmlSignalHandler : public QV4::Object +struct Q_QML_EXPORT QmlSignalHandler : public QV4::Object { V4_OBJECT2(QmlSignalHandler, QV4::Object) V4_PROTOTYPE(signalHandlerPrototype) diff --git a/tests/auto/qmltest/statemachine/tst_signaltransition.qml b/tests/auto/qmltest/statemachine/tst_signaltransition.qml new file mode 100644 index 0000000000..0e35207670 --- /dev/null +++ b/tests/auto/qmltest/statemachine/tst_signaltransition.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Ford Motor Company +** Copyright (C) 2016 The Qt Company +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtTest 1.1 +import QtQml.StateMachine 1.0 + +TestCase { + id: testCase + StateMachine { + id: machine + initialState: startState + State { + id: startState + SignalTransition { + id: signalTrans + signal: testCase.onMysignal + targetState: finalState + } + } + FinalState { + id: finalState + } + } + + SignalSpy { + id: finalStateActive + target: finalState + signalName: "activeChanged" + } + + signal mysignal() + + name: "testSignalTransition" + function test_signalTransition() + { + // Start statemachine, should not have reached finalState yet. + machine.start() + tryCompare(finalStateActive, "count", 0) + tryCompare(machine, "running", true) + + testCase.mysignal() + tryCompare(finalStateActive, "count", 1) + tryCompare(machine, "running", false) + } +} -- cgit v1.2.3 From 181229127b439c9c2200a39daf70bd4f50f5670e Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 26 May 2016 13:05:22 +0200 Subject: scene graph: document the qt.scenegraph.info category not env QSG_INFO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use of the env var has been obsolete for some time, since change 7a8cc93a0546bc38c54343d640e63062c3b398b2, although it's still supported for backwards compatibility. Change-Id: Ibe57de2298c33bfa7df5a95c714d69403a0e9166 Reviewed-by: Topi Reiniö --- src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc index 443d189f58..9ccb05cdf1 100644 --- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc +++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc @@ -180,8 +180,8 @@ dedicated thread. Qt attempts to choose a suitable loop based on the platform and possibly the graphics drivers in use. When this is not satisfactory, or for testing purposes, the environment variable \c QSG_RENDER_LOOP can be used to force the usage of a given loop. To -verify which render loop is in use, launch the application with -\c QSG_INFO set to \c 1. +verify which render loop is in use, enable the \c qt.scenegraph.info +\l {QLoggingCategory}{logging category}. \note The \c threaded and \c windows render loops rely on the OpenGL implementation for throttling by requesting a swap interval of 1. Some -- cgit v1.2.3 From cba2ef0a37f1e6972f1eb641c7157f9c69861c13 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 20 May 2016 16:18:46 +0200 Subject: Fix grammar in PathView docs Change-Id: Ibce14fddcbb608ffddb69f01e168d10c924c2957 Reviewed-by: Frank Meerkoetter Reviewed-by: Shawn Rutledge Reviewed-by: Simon Hausmann Reviewed-by: Andy Shaw --- src/quick/items/qquickpathview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index deb5582495..73146f015e 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -1019,7 +1019,7 @@ void QQuickPathView::setHighlightMoveDuration(int duration) /*! \qmlproperty real QtQuick::PathView::dragMargin - This property holds the maximum distance from the path that initiate mouse dragging. + This property holds the maximum distance from the path that initiates mouse dragging. By default the path can only be dragged by clicking on an item. If dragMargin is greater than zero, a drag can be initiated by clicking -- cgit v1.2.3 From dbf7efde1e04ac0ff445f64438078d87eb035b68 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 26 May 2016 17:22:34 +0200 Subject: V4: Mirror jsAlloc behavior at stack allocation. Allocating from the JS stack will zero out the memory, and thus indicate to valgrind that memory is not uninitialized. By first marking the whole stack as uninitialized and only then allocating 2 entries, the behavior for those two entries will now match the allocation behavior. This fixes a false positive when using valgrind. Change-Id: Icdb5279e1cfbfe6b5c385cc42c556edf721fa74b Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4engine.cpp | 8 ++++---- src/qml/jsruntime/qv4scopedvalue_p.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index fefc5b6308..5dc3e6151f 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -170,6 +170,10 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) /* writable */ true, /* executable */ false, /* includesGuardPages */ true); jsStackBase = (Value *)jsStack->base(); +#ifdef V4_USE_VALGRIND + VALGRIND_MAKE_MEM_UNDEFINED(jsStackBase, 2*JSStackLimit); +#endif + jsStackTop = jsStackBase; exceptionValue = jsAlloca(1); @@ -179,10 +183,6 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) typedArrayCtors = static_cast(jsAlloca(NTypedArrayTypes)); jsStrings = jsAlloca(NJSStrings); -#ifdef V4_USE_VALGRIND - VALGRIND_MAKE_MEM_UNDEFINED(jsStackBase, 2*JSStackLimit); -#endif - // set up stack limits jsStackLimit = jsStackBase + JSStackLimit/sizeof(Value); diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index d7fd44e1d6..ca7efb1e79 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -82,7 +82,7 @@ struct Scope { memset(mark, 0, (engine->jsStackTop - mark)*sizeof(Value)); #endif #ifdef V4_USE_VALGRIND - VALGRIND_MAKE_MEM_UNDEFINED(mark, engine->jsStackLimit - mark); + VALGRIND_MAKE_MEM_UNDEFINED(mark, (engine->jsStackLimit - mark) * sizeof(Value)); #endif engine->jsStackTop = mark; } -- cgit v1.2.3 From 72ee8417fa2d7789e8ccd09a54db8af9b0f1c366 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 19 May 2016 17:57:44 +0200 Subject: RegAllocInfo: Initialize member _currentStmt. As pointed out by Coverity (CID 22368). Change-Id: I67bdda3f747b68a0197a4cb2e2aa750aa322b6ba Reviewed-by: Simon Hausmann --- src/qml/jit/qv4regalloc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp index d1d97c8f84..82ae60a8f0 100644 --- a/src/qml/jit/qv4regalloc.cpp +++ b/src/qml/jit/qv4regalloc.cpp @@ -833,6 +833,7 @@ public: , _assignedSpillSlots(assignedSpillSlots) , _intRegs(intRegs) , _fpRegs(fpRegs) + , _currentStmt(0) { _unprocessed = unprocessed; _liveAtStart.reserve(function->basicBlockCount()); -- cgit v1.2.3 From ddb60df2634ae97ae85ea5b6021283be098efed4 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 20 May 2016 14:57:25 +0200 Subject: QQuickTextNodeEngine: early out if no document layout. As Coverity (CID 22302) points out, qobject_cast<> can return NULL; if we don't get a document layout, then we have no frame decorations to add to it. Change-Id: I2cd428456b3a3b24a28a5dd18ce948a8e95d21cb Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/items/qquicktextnodeengine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp index 18cb1d0083..417e2483df 100644 --- a/src/quick/items/qquicktextnodeengine.cpp +++ b/src/quick/items/qquicktextnodeengine.cpp @@ -636,9 +636,12 @@ void QQuickTextNodeEngine::addBorder(const QRectF &rect, qreal border, void QQuickTextNodeEngine::addFrameDecorations(QTextDocument *document, QTextFrame *frame) { QTextDocumentLayout *documentLayout = qobject_cast(document->documentLayout()); - QTextFrameFormat frameFormat = frame->format().toFrameFormat(); + if (Q_UNLIKELY(!documentLayout)) + return; + QTextFrameFormat frameFormat = frame->format().toFrameFormat(); QTextTable *table = qobject_cast(frame); + QRectF boundingRect = table == 0 ? documentLayout->frameBoundingRect(frame) : documentLayout->tableBoundingRect(table); -- cgit v1.2.3 From 32e0c5f96dac3f8afe187259929dd87012e1a464 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Wed, 1 Jun 2016 22:25:30 +0200 Subject: Compile Fix for OpenBSD in C++11 mode Add a __cplusplus condition to an already existing OpenBSD defined part to activate the code only on older gcc compilers. Change-Id: Ied8719dc35bf203ecbadd1099d711c027722121c Reviewed-by: Simon Hausmann --- src/3rdparty/masm/wtf/MathExtras.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/masm/wtf/MathExtras.h b/src/3rdparty/masm/wtf/MathExtras.h index 9ded0ab736..28a189b6e6 100644 --- a/src/3rdparty/masm/wtf/MathExtras.h +++ b/src/3rdparty/masm/wtf/MathExtras.h @@ -106,7 +106,7 @@ inline bool isinf(double x) { return !finite(x) && !isnand(x); } #endif -#if OS(OPENBSD) +#if OS(OPENBSD) && __cplusplus < 201103L namespace std { -- cgit v1.2.3 From 38b11b7b52b418629ff2d245dad70edf20eb520c Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 1 Jun 2016 10:03:32 +0200 Subject: Removed insignificant of qmltest again Blacklisted or skipped broken and unstable test functions. Some are moved to tests/auto/qmltest-blacklist folder. Task-number: QTBUG-33723 Task-number: QTBUG-38290 Task-number: QTBUG-53778 Task-number: QTBUG-53779 Task-number: QTBUG-53780 Task-number: QTBUG-53781 Task-number: QTBUG-53782 Task-number: QTBUG-53785 Task-number: QTBUG-53793 Change-Id: I35594d0d054f4f5719f6549536a1fc5bd7e2518f Reviewed-by: Simon Hausmann --- tests/auto/qmltest-blacklist/animators/Box.qml | 62 +++++++ .../qmltest-blacklist/animators/tst_behavior.qml | 67 +++++++ .../auto/qmltest-blacklist/animators/tst_mixed.qml | 171 ++++++++++++++++++ .../animators/tst_mixedparallel.qml | 66 +++++++ .../animators/tst_mixedsequential.qml | 66 +++++++ .../animators/tst_multiwindow.qml | 95 ++++++++++ .../qmltest-blacklist/animators/tst_nested.qml | 84 +++++++++ tests/auto/qmltest-blacklist/animators/tst_on.qml | 71 ++++++++ .../qmltest-blacklist/animators/tst_opacity.qml | 67 +++++++ .../qmltest-blacklist/animators/tst_parallel.qml | 66 +++++++ .../qmltest-blacklist/animators/tst_restart.qml | 77 ++++++++ .../qmltest-blacklist/animators/tst_rotation.qml | 65 +++++++ .../auto/qmltest-blacklist/animators/tst_scale.qml | 66 +++++++ .../qmltest-blacklist/animators/tst_sequential.qml | 66 +++++++ .../animators/tst_targetdestroyed.qml | 77 ++++++++ .../animators/tst_transformorigin.qml | 152 ++++++++++++++++ .../qmltest-blacklist/animators/tst_transition.qml | 83 +++++++++ tests/auto/qmltest-blacklist/animators/tst_x.qml | 68 +++++++ tests/auto/qmltest-blacklist/animators/tst_y.qml | 68 +++++++ .../animators/tst_zeroduration.qml | 35 ++++ .../item/tst_layerInPositioner.qml | 199 +++++++++++++++++++++ .../itemgrabber/tst_itemgrabber.qml | 152 ++++++++++++++++ tests/auto/qmltest/BLACKLIST | 7 + tests/auto/qmltest/animators/Box.qml | 62 ------- tests/auto/qmltest/animators/tst_behavior.qml | 67 ------- tests/auto/qmltest/animators/tst_mixed.qml | 171 ------------------ tests/auto/qmltest/animators/tst_mixedparallel.qml | 66 ------- .../auto/qmltest/animators/tst_mixedsequential.qml | 66 ------- tests/auto/qmltest/animators/tst_multiwindow.qml | 95 ---------- tests/auto/qmltest/animators/tst_nested.qml | 84 --------- tests/auto/qmltest/animators/tst_on.qml | 71 -------- tests/auto/qmltest/animators/tst_opacity.qml | 67 ------- tests/auto/qmltest/animators/tst_parallel.qml | 66 ------- tests/auto/qmltest/animators/tst_restart.qml | 77 -------- tests/auto/qmltest/animators/tst_rotation.qml | 65 ------- tests/auto/qmltest/animators/tst_scale.qml | 66 ------- tests/auto/qmltest/animators/tst_sequential.qml | 66 ------- .../auto/qmltest/animators/tst_targetdestroyed.qml | 77 -------- .../auto/qmltest/animators/tst_transformorigin.qml | 152 ---------------- tests/auto/qmltest/animators/tst_transition.qml | 83 --------- tests/auto/qmltest/animators/tst_x.qml | 68 ------- tests/auto/qmltest/animators/tst_y.qml | 68 ------- tests/auto/qmltest/animators/tst_zeroduration.qml | 35 ---- tests/auto/qmltest/item/tst_layerInPositioner.qml | 199 --------------------- tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml | 152 ---------------- tests/auto/qmltest/listview/tst_listview.qml | 2 + tests/auto/qmltest/qmltest.pro | 4 +- tests/auto/qmltest/window/tst_clickwindow.qml | 2 + 48 files changed, 1936 insertions(+), 1925 deletions(-) create mode 100644 tests/auto/qmltest-blacklist/animators/Box.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_behavior.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_mixed.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_mixedparallel.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_mixedsequential.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_multiwindow.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_nested.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_on.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_opacity.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_parallel.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_restart.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_rotation.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_scale.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_sequential.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_targetdestroyed.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_transformorigin.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_transition.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_x.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_y.qml create mode 100644 tests/auto/qmltest-blacklist/animators/tst_zeroduration.qml create mode 100644 tests/auto/qmltest-blacklist/item/tst_layerInPositioner.qml create mode 100644 tests/auto/qmltest-blacklist/itemgrabber/tst_itemgrabber.qml delete mode 100644 tests/auto/qmltest/animators/Box.qml delete mode 100644 tests/auto/qmltest/animators/tst_behavior.qml delete mode 100644 tests/auto/qmltest/animators/tst_mixed.qml delete mode 100644 tests/auto/qmltest/animators/tst_mixedparallel.qml delete mode 100644 tests/auto/qmltest/animators/tst_mixedsequential.qml delete mode 100644 tests/auto/qmltest/animators/tst_multiwindow.qml delete mode 100644 tests/auto/qmltest/animators/tst_nested.qml delete mode 100644 tests/auto/qmltest/animators/tst_on.qml delete mode 100644 tests/auto/qmltest/animators/tst_opacity.qml delete mode 100644 tests/auto/qmltest/animators/tst_parallel.qml delete mode 100644 tests/auto/qmltest/animators/tst_restart.qml delete mode 100644 tests/auto/qmltest/animators/tst_rotation.qml delete mode 100644 tests/auto/qmltest/animators/tst_scale.qml delete mode 100644 tests/auto/qmltest/animators/tst_sequential.qml delete mode 100644 tests/auto/qmltest/animators/tst_targetdestroyed.qml delete mode 100644 tests/auto/qmltest/animators/tst_transformorigin.qml delete mode 100644 tests/auto/qmltest/animators/tst_transition.qml delete mode 100644 tests/auto/qmltest/animators/tst_x.qml delete mode 100644 tests/auto/qmltest/animators/tst_y.qml delete mode 100644 tests/auto/qmltest/animators/tst_zeroduration.qml delete mode 100644 tests/auto/qmltest/item/tst_layerInPositioner.qml delete mode 100644 tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml diff --git a/tests/auto/qmltest-blacklist/animators/Box.qml b/tests/auto/qmltest-blacklist/animators/Box.qml new file mode 100644 index 0000000000..46218bed3f --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/Box.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 + +Rectangle { + id: box + gradient: Gradient { + GradientStop { position: 0.1; color: "red" } + GradientStop { position: 0.9; color: "blue" } + } + width: 100 + height: 100 + anchors.centerIn: parent + antialiasing: true + + property int rotationChangeCounter: 0 + onRotationChanged: ++rotationChangeCounter; + + property int scaleChangeCounter: 0 + onScaleChanged: ++scaleChangeCounter; + + property int opacityChangeCounter: 0 + onOpacityChanged: ++opacityChangeCounter + + property int xChangeCounter: 0; + onXChanged: ++xChangeCounter; + + property int yChangeCounter: 0; + onYChanged: ++yChangeCounter; + +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_behavior.qml b/tests/auto/qmltest-blacklist/animators/tst_behavior.qml new file mode 100644 index 0000000000..91145909d0 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_behavior.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testcase + name: "animators-behavior" + when: box.scale == 2 + function test_endresult() { + compare(box.scaleChangeCounter, 1); + compare(box.scale, 2); + var image = grabImage(root); + + verify(image.pixel(0, 0) == Qt.rgba(1, 0, 0)); + verify(image.pixel(199, 199) == Qt.rgba(0, 0, 1)); + } + } + + Box { + id: box + Behavior on scale { ScaleAnimator { id: animation; duration: 100; } } + } + + Timer { + interval: 100; + repeat: false + running: true + onTriggered: box.scale = 2 + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_mixed.qml b/tests/auto/qmltest-blacklist/animators/tst_mixed.qml new file mode 100644 index 0000000000..a738baba25 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_mixed.qml @@ -0,0 +1,171 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Jolla Ltd, author: +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-mixed" + when: !rootAnimation.running + function test_endresult() { + compare(box.rootStart, 2); + compare(box.rootEnd, 2); + + compare(parallelWithOneSequential.before, 4); + compare(parallelWithOneSequential.scaleUpdates, 4); + + compare(parallelWithTwoSequentialNormalEndsLast.beforeAnimator, 4); + compare(parallelWithTwoSequentialNormalEndsLast.scaleUpdates, 4); + compare(parallelWithTwoSequentialNormalEndsLast.afterAnimator, 4); + compare(parallelWithTwoSequentialNormalEndsLast.beforePause, 4); + compare(parallelWithTwoSequentialNormalEndsLast.afterPause, 4); + + compare(parallelWithTwoSequentialNormalEndsFirst.beforeAnimator, 4); + compare(parallelWithTwoSequentialNormalEndsFirst.scaleUpdates, 4); + compare(parallelWithTwoSequentialNormalEndsFirst.afterAnimator, 4); + compare(parallelWithTwoSequentialNormalEndsFirst.beforePause, 4); + compare(parallelWithTwoSequentialNormalEndsFirst.afterPause, 4); + + } + } + + Box { + id: box + + property int rootStart : 0 + property int rootEnd : 0; + + SequentialAnimation { + id: rootAnimation + + running: true + loops: 2 + + ScriptAction { script: box.rootStart++; } + + ParallelAnimation { + id: parallelWithOneSequential + property int before : 0; + property int scaleUpdates : 0; + loops: 2 + SequentialAnimation { + ScriptAction { script: { + parallelWithOneSequential.before++; + box.scale = 1; + box.scaleChangeCounter = 0; + } + } + ScaleAnimator { target: box; from: 1; to: 2; duration: 100; } + ScriptAction { script: { + parallelWithOneSequential.scaleUpdates += box.scaleChangeCounter; + } + } + } + } + + ParallelAnimation { + id: parallelWithTwoSequentialNormalEndsLast + property int beforeAnimator : 0; + property int scaleUpdates : 0; + property int afterAnimator : 0; + property int beforePause : 0; + property int afterPause : 0; + loops: 2 + SequentialAnimation { + ScriptAction { script: { + parallelWithTwoSequentialNormalEndsLast.beforeAnimator++; + box.scale = 1; + box.scaleChangeCounter = 0; + } + } + ScaleAnimator { target: box; from: 1; to: 2; duration: 100; } + ScriptAction { script: { + parallelWithTwoSequentialNormalEndsLast.scaleUpdates += box.scaleChangeCounter; + parallelWithTwoSequentialNormalEndsLast.afterAnimator++; + } + } + } + SequentialAnimation { + ScriptAction { script: { + parallelWithTwoSequentialNormalEndsLast.beforePause++ + } + } + PauseAnimation { duration: 200 } + ScriptAction { script: { + parallelWithTwoSequentialNormalEndsLast.afterPause++ + } + } + } + } + + ParallelAnimation { + id: parallelWithTwoSequentialNormalEndsFirst + property int beforeAnimator : 0; + property int scaleUpdates : 0; + property int afterAnimator : 0; + property int beforePause : 0; + property int afterPause : 0; + loops: 2 + SequentialAnimation { + ScriptAction { script: { + parallelWithTwoSequentialNormalEndsFirst.beforeAnimator++; + box.scale = 1; + box.scaleChangeCounter = 0; + } + } + ScaleAnimator { target: box; from: 1; to: 2; duration: 200; } + ScriptAction { script: { + parallelWithTwoSequentialNormalEndsFirst.scaleUpdates += box.scaleChangeCounter; + parallelWithTwoSequentialNormalEndsFirst.afterAnimator++; + } + } + } + SequentialAnimation { + ScriptAction { script: parallelWithTwoSequentialNormalEndsFirst.beforePause++ } + PauseAnimation { duration: 100 } + ScriptAction { script: parallelWithTwoSequentialNormalEndsFirst.afterPause++ } + } + } + + ScriptAction { script: box.rootEnd++; } + } + + } + +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_mixedparallel.qml b/tests/auto/qmltest-blacklist/animators/tst_mixedparallel.qml new file mode 100644 index 0000000000..9d36fd10dc --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_mixedparallel.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testcase + name: "animators-mixedparallel" + when: !animation.running + function test_endresult() { + compare(box.rotationChangeCounter, 1); + compare(box.scale, 2); + compare(box.rotation, 180); + var image = grabImage(root); + verify(image.pixel(0, 0) == Qt.rgba(0, 0, 1)); + verify(image.pixel(199, 199) == Qt.rgba(1, 0, 0)); + } + } + + Box { + id: box + ParallelAnimation { + id: animation + NumberAnimation { target: box; property: "scale"; from: 1; to: 2.0; duration: 100; } + RotationAnimator { target: box; from: 0; to: 180; duration: 100; } + running: true + loops: 1; + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_mixedsequential.qml b/tests/auto/qmltest-blacklist/animators/tst_mixedsequential.qml new file mode 100644 index 0000000000..0d58fc788e --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_mixedsequential.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testcase + name: "animators-mixedsequential" + when: !animation.running + function test_endresult() { + compare(box.rotationChangeCounter, 1); + compare(box.scale, 2); + compare(box.rotation, 180); + var image = grabImage(root); + verify(image.pixel(0, 0) == Qt.rgba(0, 0, 1)); + verify(image.pixel(199, 199) == Qt.rgba(1, 0, 0)); + } + } + + Box { + id: box + ParallelAnimation { + id: animation + NumberAnimation { target: box; property: "scale"; from: 1; to: 2.0; duration: 100; } + RotationAnimator { target: box; from: 0; to: 180; duration: 100; } + running: true + loops: 1; + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_multiwindow.qml b/tests/auto/qmltest-blacklist/animators/tst_multiwindow.qml new file mode 100644 index 0000000000..9a817993fe --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_multiwindow.qml @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Jolla Ltd, author: +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 +import QtQuick.Window 2.0 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-mixed" + when: countdown == 0 + function test_endresult() { + verify(true, "Just making sure we didn't crash"); + } + } + + property int countdown: 5; + + Window { + id: window + + width: 100 + height: 100 + + ShaderEffect { + width: 50 + height: 50 + + property real t; + UniformAnimator on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite } + RotationAnimator on rotation { from: 0; to: 360; duration: 1000; loops: Animation.Infinite } + ScaleAnimator on scale { from: 0.5; to: 1.5; duration: 1000; loops: Animation.Infinite } + XAnimator on x { from: 0; to: 50; duration: 1000; loops: Animation.Infinite } + YAnimator on y { from: 0; to: 50; duration: 1000; loops: Animation.Infinite } + OpacityAnimator on opacity { from: 1; to: 0.5; duration: 1000; loops: Animation.Infinite } + + fragmentShader: " + uniform lowp float t; + uniform lowp float qt_Opacity; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(qt_TexCoord0, t, 1) * qt_Opacity; + } + " + } + + visible: true + } + + Timer { + interval: 250 + running: true + repeat: true + onTriggered: { + if (window.visible) + --countdown + window.visible = !window.visible; + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_nested.qml b/tests/auto/qmltest-blacklist/animators/tst_nested.qml new file mode 100644 index 0000000000..85f5d5a922 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_nested.qml @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-nested" + when: !animation.running + function test_endresult() { + compare(box.before, 2); + compare(box.after, 2); + } + } + + Box { + id: box + + anchors.centerIn: undefined + + property int before: 0; + property int after: 0; + + SequentialAnimation { + id: animation; + ScriptAction { script: box.before++; } + ParallelAnimation { + ScaleAnimator { target: box; from: 2.0; to: 1; duration: 100; } + OpacityAnimator { target: box; from: 0; to: 1; duration: 100; } + } + PauseAnimation { duration: 100 } + SequentialAnimation { + ParallelAnimation { + XAnimator { target: box; from: 0; to: 100; duration: 100 } + RotationAnimator { target: box; from: 0; to: 90; duration: 100 } + } + ParallelAnimation { + XAnimator { target: box; from: 100; to: 0; duration: 100 } + RotationAnimator { target: box; from: 90; to: 0; duration: 100 } + } + } + ScriptAction { script: box.after++; } + running: true + loops: 2 + } + } + +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_on.qml b/tests/auto/qmltest-blacklist/animators/tst_on.qml new file mode 100644 index 0000000000..3775350ae5 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_on.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-on" + when: !animx.running && !animy.running + && !anims.running && !animr.running + && !animo.running; + function test_endresult() { + tryCompare(box, 'xChangeCounter', 1); + compare(box.yChangeCounter, 1); + compare(box.scaleChangeCounter, 1); + compare(box.rotationChangeCounter, 1); + compare(box.opacityChangeCounter, 1); + compare(box.x, 100); + compare(box.y, 100); + compare(box.scale, 2); + compare(box.rotation, 180); + compare(box.opacity, 0.5); + } + } + + Box { + id: box + anchors.centerIn: undefined + XAnimator on x { id: animx; from: 0; to: 100; duration: 100 } + YAnimator on y { id: animy; from: 0; to: 100; duration: 100 } + ScaleAnimator on scale { id: anims; from: 1; to: 2; duration: 100 } + RotationAnimator on rotation { id: animr ; from: 0; to: 180; duration: 100 } + OpacityAnimator on opacity { id: animo; from: 1; to: 0.5; duration: 100 } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_opacity.qml b/tests/auto/qmltest-blacklist/animators/tst_opacity.qml new file mode 100644 index 0000000000..72b2c61012 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_opacity.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-opacity" + when: box.opacity == 0.5 + function test_endresult() { + compare(box.opacityChangeCounter, 1); + var image = grabImage(root); + compare(image.red(50, 50), 255); + verify(image.green(50, 50) > 0); + verify(image.blue(50, 50) > 0); + } + } + + Box { + id: box + + OpacityAnimator { + id: animation + target: box + from: 1; + to: 0.5 + duration: 100 + running: true + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_parallel.qml b/tests/auto/qmltest-blacklist/animators/tst_parallel.qml new file mode 100644 index 0000000000..f25bae18d5 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_parallel.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testcase + name: "animators-parallel" + when: !animation.running + function test_endresult() { + compare(box.rotationChangeCounter, 1); + compare(box.scaleChangeCounter, 1); + compare(box.scale, 2); + compare(box.rotation, 180); + var image = grabImage(root); + verify(image.pixel(0, 0) == Qt.rgba(0, 0, 1)); + verify(image.pixel(199, 199) == Qt.rgba(1, 0, 0)); + } + } + + Box { + id: box + ParallelAnimation { + id: animation + ScaleAnimator { target: box; from: 1; to: 2.0; duration: 100; } + RotationAnimator { target: box; from: 0; to: 180; duration: 100; } + running: true + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_restart.qml b/tests/auto/qmltest-blacklist/animators/tst_restart.qml new file mode 100644 index 0000000000..e029ca2059 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_restart.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + property int restartCount: 5; + + TestCase { + id: testcase + name: "animators-restart" + when: root.restartCount == 0 && animation.running == false; + function test_endresult() { + compare(box.scale, 2); + } + } + + Box { + id: box + + ScaleAnimator { + id: animation + target: box; + from: 1; + to: 2.0; + duration: 100; + loops: 1 + running: false; + } + + Timer { + id: timer; + interval: 500 + running: true + repeat: true + onTriggered: { + animation.running = true; + --root.restartCount; + } + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_rotation.qml b/tests/auto/qmltest-blacklist/animators/tst_rotation.qml new file mode 100644 index 0000000000..a91af92ab1 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_rotation.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-rotation" + when: box.rotation == 180 + function test_endresult() { + compare(box.rotationChangeCounter, 1); + var image = grabImage(root); + verify(image.pixel(50, 50) == Qt.rgba(0, 0, 1)); + } + } + + Box { + id: box + RotationAnimator { + id: animation + target: box + from: 0; + to: 180 + duration: 100 + easing.type: Easing.InOutBack + running: true + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_scale.qml b/tests/auto/qmltest-blacklist/animators/tst_scale.qml new file mode 100644 index 0000000000..402468079a --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_scale.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-scale" + when: box.scale == 2; + function test_endresult() { + compare(box.scaleChangeCounter, 1); + var image = grabImage(root); + verify(image.pixel(0, 0) == Qt.rgba(1, 0, 0)); + } + } + + Box { + id: box + + ScaleAnimator { + id: animation + target: box + from: 1; + to: 2.0 + duration: 100 + easing.type: Easing.InOutCubic + running: true + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_sequential.qml b/tests/auto/qmltest-blacklist/animators/tst_sequential.qml new file mode 100644 index 0000000000..f021bbeb7a --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_sequential.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testcase + name: "animators-parallel" + when: !animation.running + function test_endresult() { + compare(box.rotationChangeCounter, 1); + compare(box.scaleChangeCounter, 1); + compare(box.scale, 2); + compare(box.rotation, 180); + var image = grabImage(root); + compare(image.pixel(0, 0), Qt.rgba(0, 0, 1, 1)); + compare(image.pixel(199, 199), Qt.rgba(1, 0, 0, 1)); + } + } + + Box { + id: box + SequentialAnimation { + id: animation + ScaleAnimator { target: box; from: 1; to: 2.0; duration: 100; } + RotationAnimator { target: box; from: 0; to: 180; duration: 100; } + running: true + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_targetdestroyed.qml b/tests/auto/qmltest-blacklist/animators/tst_targetdestroyed.qml new file mode 100644 index 0000000000..bf9efd2162 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_targetdestroyed.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Gunnar Sletta +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testcase + name: "animators-targetdestroyed" + when: false + function test_endresult() { + verify(true, "Got here :)"); + } + } + + Rectangle { + id: box + width: 10 + height: 10 + color: "steelblue" + } + + YAnimator { + id: anim + target: box + from: 0; + to: 100 + duration: 100 + loops: Animation.Infinite + running: true + } + + SequentialAnimation { + running: true + PauseAnimation { duration: 150 } + ScriptAction { script: box.destroy(); } + PauseAnimation { duration: 50 } + ScriptAction { script: anim.destroy(); } + PauseAnimation { duration: 50 } + ScriptAction { script: testcase.when = true } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_transformorigin.qml b/tests/auto/qmltest-blacklist/animators/tst_transformorigin.qml new file mode 100644 index 0000000000..eed93b9843 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_transformorigin.qml @@ -0,0 +1,152 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 300 + height: 300 + + Timer { + id: timer; + running: testCase.windowShown + interval: 1000 + repeat: false + onTriggered: triggered = true; + property bool triggered: false; + } + + TestCase { + id: testCase + name: "animators-transformorigin" + when: timer.triggered + function test_endresult() { + + var image = grabImage(root); + + var white = Qt.rgba(1, 1, 1); + var blue = Qt.rgba(0, 0, 1); + + + // topleft + verify(image.pixel(40, 40) == white); + verify(image.pixel(60, 40) == white); + verify(image.pixel(40, 60) == white); + verify(image.pixel(60, 60) == blue); + + // top + verify(image.pixel(140, 40) == white); + verify(image.pixel(160, 40) == white); + verify(image.pixel(140, 60) == blue); + verify(image.pixel(160, 60) == blue); + + // topright + verify(image.pixel(240, 40) == white); + verify(image.pixel(260, 40) == white); + verify(image.pixel(240, 60) == blue); + verify(image.pixel(260, 60) == white); + + + // left + verify(image.pixel(40, 140) == white); + verify(image.pixel(60, 140) == blue); + verify(image.pixel(40, 160) == white); + verify(image.pixel(60, 160) == blue); + + // center + verify(image.pixel(140, 140) == blue); + verify(image.pixel(160, 140) == blue); + verify(image.pixel(140, 160) == blue); + verify(image.pixel(160, 160) == blue); + + // right + verify(image.pixel(240, 140) == blue); + verify(image.pixel(260, 140) == white); + verify(image.pixel(240, 160) == blue); + verify(image.pixel(260, 160) == white); + + + // bottomleft + verify(image.pixel(40, 240) == white); + verify(image.pixel(60, 240) == blue); + verify(image.pixel(40, 260) == white); + verify(image.pixel(60, 260) == white); + + // bottom + verify(image.pixel(140, 240) == blue); + verify(image.pixel(160, 240) == blue); + verify(image.pixel(140, 260) == white); + verify(image.pixel(160, 260) == white); + + // bottomright + verify(image.pixel(240, 240) == blue); + verify(image.pixel(260, 240) == white); + verify(image.pixel(240, 260) == white); + verify(image.pixel(260, 260) == white); + + } + } + + property var origins: [Item.TopLeft, Item.Top, Item.TopRight, + Item.Left, Item.Center, Item.Right, + Item.BottomLeft, Item.Bottom, Item.BottomRight]; + + Grid { + anchors.fill: parent + rows: 3 + columns: 3 + + Repeater { + model: 9 + Item { + width: 100 + height: 100 + Rectangle { + id: box + color: "blue" + anchors.centerIn: parent + width: 10 + height: 10 + antialiasing: true; + + transformOrigin: root.origins[index]; + + ScaleAnimator { target: box; from: 1; to: 5.5; duration: 100; running: true; } + } + } + } + } + +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_transition.qml b/tests/auto/qmltest-blacklist/animators/tst_transition.qml new file mode 100644 index 0000000000..b02238ef23 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_transition.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testcase + name: "animators-transition" + when: box.scale == 2 + function test_endresult() { + compare(box.scaleChangeCounter, 1); + compare(box.scale, 2); + var image = grabImage(root); + verify(image.pixel(0, 0) == Qt.rgba(1, 0, 0)); + verify(image.pixel(199, 199) == Qt.rgba(0, 0, 1)); + } + } + + states: [ + State { + name: "one" + PropertyChanges { target: box; scale: 1 } + }, + State { + name: "two" + PropertyChanges { target: box; scale: 2 } + } + ] + state: "one" + + transitions: [ + Transition { + ScaleAnimator { duration: 100; } + } + ] + + Box { + id: box + } + + Timer { + interval: 100; + repeat: false + running: true + onTriggered: root.state = "two" + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_x.qml b/tests/auto/qmltest-blacklist/animators/tst_x.qml new file mode 100644 index 0000000000..c462ee87d0 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_x.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-x" + when: box.x == 100 + function test_endresult() { + compare(box.xChangeCounter, 1); + var image = grabImage(root); + verify(image.pixel(100, 0) == Qt.rgba(1, 0, 0)); + verify(image.pixel(99, 0) == Qt.rgba(1, 1, 1)); // outside on the left + } + } + + Box { + id: box + + anchors.centerIn: undefined + + XAnimator { + id: animation + target: box + from: 0; + to: 100 + duration: 100 + running: true + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_y.qml b/tests/auto/qmltest-blacklist/animators/tst_y.qml new file mode 100644 index 0000000000..04487baee0 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_y.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-y" + when: box.y == 100 + function test_endresult() { + compare(box.yChangeCounter, 1); + var image = grabImage(root); + verify(image.pixel(0, 100) == Qt.rgba(1, 0, 0)); + verify(image.pixel(0, 99) == Qt.rgba(1, 1, 1)); // outside on the top + } + } + + Box { + id: box + + anchors.centerIn: undefined + + YAnimator { + id: animation + target: box + from: 0; + to: 100 + duration: 100 + running: true + } + } +} diff --git a/tests/auto/qmltest-blacklist/animators/tst_zeroduration.qml b/tests/auto/qmltest-blacklist/animators/tst_zeroduration.qml new file mode 100644 index 0000000000..83ce235f42 --- /dev/null +++ b/tests/auto/qmltest-blacklist/animators/tst_zeroduration.qml @@ -0,0 +1,35 @@ +import QtQuick 2.2 +import QtTest 1.1 + +Item { + id: root; + width: 200 + height: 200 + + TestCase { + id: testCase + name: "animators-y" + when: box.y == 100 + function test_endresult() { + compare(box.yChangeCounter, 1); + var image = grabImage(root); + verify(image.pixel(0, 100) == Qt.rgba(1, 0, 0)); + verify(image.pixel(0, 99) == Qt.rgba(1, 1, 1)); // outside on the top + } + } + + Box { + id: box + + anchors.centerIn: undefined + + YAnimator { + id: animation + target: box + from: 0; + to: 100 + duration: 0 + running: true + } + } +} diff --git a/tests/auto/qmltest-blacklist/item/tst_layerInPositioner.qml b/tests/auto/qmltest-blacklist/item/tst_layerInPositioner.qml new file mode 100644 index 0000000000..315ff0e5e0 --- /dev/null +++ b/tests/auto/qmltest-blacklist/item/tst_layerInPositioner.qml @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Jolla Ltd, author: +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.4 +import QtTest 1.1 + +Item { + id: root; + width: 400 + height: 400 + + TestCase { + id: testCase + name: "transparentForPositioner" + when: windowShown + function test_endresult() { + var image = grabImage(root); + + // Row of red, green, blue and white box inside blue + // At 10,10, spanning 10x10 pixels each + verify(image.pixel(10, 10) == Qt.rgba(1, 0, 0, 1)); + verify(image.pixel(20, 10) == Qt.rgba(0, 1, 0, 1)); + verify(image.pixel(30, 10) == Qt.rgba(0, 0, 1, 1)); + + // Column of red, green, blue and white box inside blue + // At 10,30, spanning 10x10 pixels each + verify(image.pixel(10, 30) == Qt.rgba(1, 0, 0, 1)); + verify(image.pixel(10, 40) == Qt.rgba(0, 1, 0, 1)); + verify(image.pixel(10, 50) == Qt.rgba(0, 0, 1, 1)); + + // Flow of red, green, blue and white box inside blue + // At 30,30, spanning 10x10 pixels each, wrapping after two boxes + verify(image.pixel(30, 30) == Qt.rgba(1, 0, 0, 1)); + verify(image.pixel(40, 30) == Qt.rgba(0, 1, 0, 1)); + verify(image.pixel(30, 40) == Qt.rgba(0, 0, 1, 1)); + + // Flow of red, green, blue and white box inside blue + // At 100,10, spanning 10x10 pixels each, wrapping after two boxes + verify(image.pixel(60, 10) == Qt.rgba(1, 0, 0, 1)); + verify(image.pixel(70, 10) == Qt.rgba(0, 1, 0, 1)); + verify(image.pixel(60, 20) == Qt.rgba(0, 0, 1, 1)); + } + } + + Component { + id: greenPassThrough + ShaderEffect { + fragmentShader: + " + uniform lowp sampler2D source; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = texture2D(source, qt_TexCoord0) * vec4(0, 1, 0, 1); + } + " + } + } + + Row { + id: theRow + x: 10 + y: 10 + Rectangle { + width: 10 + height: 10 + color: "#ff0000" + layer.enabled: true + } + + Rectangle { + width: 10 + height: 10 + color: "#ffffff" + layer.enabled: true + layer.effect: greenPassThrough + } + + Rectangle { + id: blueInRow + width: 10 + height: 10 + color: "#0000ff" + } + } + + Column { + id: theColumn + x: 10 + y: 30 + Rectangle { + width: 10 + height: 10 + color: "#ff0000" + layer.enabled: true + } + + Rectangle { + width: 10 + height: 10 + color: "#ffffff" + layer.enabled: true + layer.effect: greenPassThrough + } + + Rectangle { + id: blueInColumn + width: 10 + height: 10 + color: "#0000ff" + } + } + + Flow { + id: theFlow + x: 30 + y: 30 + width: 20 + Rectangle { + width: 10 + height: 10 + color: "#ff0000" + layer.enabled: true + } + + Rectangle { + width: 10 + height: 10 + color: "#ffffff" + layer.enabled: true + layer.effect: greenPassThrough + } + + Rectangle { + id: blueInFlow + width: 10 + height: 10 + color: "#0000ff" + } + } + + Grid { + id: theGrid + x: 60 + y: 10 + columns: 2 + Rectangle { + width: 10 + height: 10 + color: "#ff0000" + layer.enabled: true + } + + Rectangle { + width: 10 + height: 10 + color: "#ffffff" + layer.enabled: true + layer.effect: greenPassThrough + } + + Rectangle { + id: blueInGrid + width: 10 + height: 10 + color: "#0000ff" + } + } + +} diff --git a/tests/auto/qmltest-blacklist/itemgrabber/tst_itemgrabber.qml b/tests/auto/qmltest-blacklist/itemgrabber/tst_itemgrabber.qml new file mode 100644 index 0000000000..5d65a1666c --- /dev/null +++ b/tests/auto/qmltest-blacklist/itemgrabber/tst_itemgrabber.qml @@ -0,0 +1,152 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Jolla Ltd, author: +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.4 +import QtTest 1.1 + +Item { + id: root; + width: 400 + height: 400 + + TestCase { + id: testCase + name: "item-grabber" + when: imageOnDisk.ready && imageOnDiskSmall.ready && imageInCache.ready && imageInCacheSmall.ready + function test_endresult() { + var image = grabImage(root); + + // imageOnDisk at (0, 0) - (100x100) + compare(imageOnDisk.width, 100); + compare(imageOnDisk.height, 100); + verify(image.pixel(0, 0) === Qt.rgba(1, 0, 0, 1)); // Use verify because compare doesn't support colors (QTBUG-34878) + verify(image.pixel(99, 99) === Qt.rgba(0, 0, 1, 1)); + + // imageOnDiskSmall at (100, 0) - 50x50 + compare(imageOnDiskSmall.width, 50); + compare(imageOnDiskSmall.height, 50); + verify(image.pixel(100, 0) === Qt.rgba(1, 0, 0, 1)); + verify(image.pixel(149, 49) === Qt.rgba(0, 0, 1, 1)); + + // imageInCache at (0, 100) - 100x100 + compare(imageInCache.width, 100); + compare(imageInCache.height, 100); + verify(image.pixel(0, 100) === Qt.rgba(1, 0, 0, 1)); + verify(image.pixel(99, 199) === Qt.rgba(0, 0, 1, 1)); + + // imageInCacheSmall at (100, 100) - 50x50 + compare(imageInCacheSmall.width, 50); + compare(imageInCacheSmall.height, 50); + verify(image.pixel(100, 100) === Qt.rgba(1, 0, 0, 1)); + verify(image.pixel(149, 149) === Qt.rgba(0, 0, 1, 1)); + + // After all that has been going on, it should only have been called that one time.. + compare(imageOnDisk.callCount, 1); + } + + onWindowShownChanged: { + box.grabToImage(imageOnDisk.handleGrab); + box.grabToImage(imageOnDiskSmall.handleGrab, Qt.size(50, 50)); + box.grabToImage(imageInCache.handleGrab); + box.grabToImage(imageInCacheSmall.handleGrab, Qt.size(50, 50)); + } + + } + + Rectangle { + id: box + width: 100 + height: 100 + color: "red"; + + visible: false + + Rectangle { + anchors.bottom: parent.bottom; + anchors.right: parent.right; + width: 10 + height: 10 + color: "blue"; + } + } + + Image { + id: imageOnDisk + x: 0 + y: 0 + property int callCount: 0; + property bool ready: false; + function handleGrab(result) { + if (!result.saveToFile("image.png")) + print("Error: Failed to save image to disk..."); + source = "image.png"; + ready = true; + ++callCount; + } + } + + Image { + id: imageOnDiskSmall + x: 100 + y: 0 + property bool ready: false; + function handleGrab(result) { + if (!result.saveToFile("image_small.png")) + print("Error: Failed to save image to disk..."); + source = "image_small.png"; + ready = true; + } + } + + Image { + id: imageInCache + x: 0 + y: 100 + property bool ready: false; + function handleGrab(result) { + source = result.url; + ready = true; + } + } + + Image { + id: imageInCacheSmall + x: 100 + y: 100 + property bool ready: false; + function handleGrab(result) { + source = result.url; + ready = true; + } + } +} diff --git a/tests/auto/qmltest/BLACKLIST b/tests/auto/qmltest/BLACKLIST index cd8b1181e0..490e20d5f8 100644 --- a/tests/auto/qmltest/BLACKLIST +++ b/tests/auto/qmltest/BLACKLIST @@ -3,3 +3,10 @@ * [SelfTests::test_blacklistWithData:test2] * +[tst_grabImage::test_equals] +linux +[Text::test_linecount] +osx +windows +[TextInput::test_doublevalidators] +osx diff --git a/tests/auto/qmltest/animators/Box.qml b/tests/auto/qmltest/animators/Box.qml deleted file mode 100644 index 46218bed3f..0000000000 --- a/tests/auto/qmltest/animators/Box.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 - -Rectangle { - id: box - gradient: Gradient { - GradientStop { position: 0.1; color: "red" } - GradientStop { position: 0.9; color: "blue" } - } - width: 100 - height: 100 - anchors.centerIn: parent - antialiasing: true - - property int rotationChangeCounter: 0 - onRotationChanged: ++rotationChangeCounter; - - property int scaleChangeCounter: 0 - onScaleChanged: ++scaleChangeCounter; - - property int opacityChangeCounter: 0 - onOpacityChanged: ++opacityChangeCounter - - property int xChangeCounter: 0; - onXChanged: ++xChangeCounter; - - property int yChangeCounter: 0; - onYChanged: ++yChangeCounter; - -} diff --git a/tests/auto/qmltest/animators/tst_behavior.qml b/tests/auto/qmltest/animators/tst_behavior.qml deleted file mode 100644 index 91145909d0..0000000000 --- a/tests/auto/qmltest/animators/tst_behavior.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testcase - name: "animators-behavior" - when: box.scale == 2 - function test_endresult() { - compare(box.scaleChangeCounter, 1); - compare(box.scale, 2); - var image = grabImage(root); - - verify(image.pixel(0, 0) == Qt.rgba(1, 0, 0)); - verify(image.pixel(199, 199) == Qt.rgba(0, 0, 1)); - } - } - - Box { - id: box - Behavior on scale { ScaleAnimator { id: animation; duration: 100; } } - } - - Timer { - interval: 100; - repeat: false - running: true - onTriggered: box.scale = 2 - } -} diff --git a/tests/auto/qmltest/animators/tst_mixed.qml b/tests/auto/qmltest/animators/tst_mixed.qml deleted file mode 100644 index a738baba25..0000000000 --- a/tests/auto/qmltest/animators/tst_mixed.qml +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Jolla Ltd, author: -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-mixed" - when: !rootAnimation.running - function test_endresult() { - compare(box.rootStart, 2); - compare(box.rootEnd, 2); - - compare(parallelWithOneSequential.before, 4); - compare(parallelWithOneSequential.scaleUpdates, 4); - - compare(parallelWithTwoSequentialNormalEndsLast.beforeAnimator, 4); - compare(parallelWithTwoSequentialNormalEndsLast.scaleUpdates, 4); - compare(parallelWithTwoSequentialNormalEndsLast.afterAnimator, 4); - compare(parallelWithTwoSequentialNormalEndsLast.beforePause, 4); - compare(parallelWithTwoSequentialNormalEndsLast.afterPause, 4); - - compare(parallelWithTwoSequentialNormalEndsFirst.beforeAnimator, 4); - compare(parallelWithTwoSequentialNormalEndsFirst.scaleUpdates, 4); - compare(parallelWithTwoSequentialNormalEndsFirst.afterAnimator, 4); - compare(parallelWithTwoSequentialNormalEndsFirst.beforePause, 4); - compare(parallelWithTwoSequentialNormalEndsFirst.afterPause, 4); - - } - } - - Box { - id: box - - property int rootStart : 0 - property int rootEnd : 0; - - SequentialAnimation { - id: rootAnimation - - running: true - loops: 2 - - ScriptAction { script: box.rootStart++; } - - ParallelAnimation { - id: parallelWithOneSequential - property int before : 0; - property int scaleUpdates : 0; - loops: 2 - SequentialAnimation { - ScriptAction { script: { - parallelWithOneSequential.before++; - box.scale = 1; - box.scaleChangeCounter = 0; - } - } - ScaleAnimator { target: box; from: 1; to: 2; duration: 100; } - ScriptAction { script: { - parallelWithOneSequential.scaleUpdates += box.scaleChangeCounter; - } - } - } - } - - ParallelAnimation { - id: parallelWithTwoSequentialNormalEndsLast - property int beforeAnimator : 0; - property int scaleUpdates : 0; - property int afterAnimator : 0; - property int beforePause : 0; - property int afterPause : 0; - loops: 2 - SequentialAnimation { - ScriptAction { script: { - parallelWithTwoSequentialNormalEndsLast.beforeAnimator++; - box.scale = 1; - box.scaleChangeCounter = 0; - } - } - ScaleAnimator { target: box; from: 1; to: 2; duration: 100; } - ScriptAction { script: { - parallelWithTwoSequentialNormalEndsLast.scaleUpdates += box.scaleChangeCounter; - parallelWithTwoSequentialNormalEndsLast.afterAnimator++; - } - } - } - SequentialAnimation { - ScriptAction { script: { - parallelWithTwoSequentialNormalEndsLast.beforePause++ - } - } - PauseAnimation { duration: 200 } - ScriptAction { script: { - parallelWithTwoSequentialNormalEndsLast.afterPause++ - } - } - } - } - - ParallelAnimation { - id: parallelWithTwoSequentialNormalEndsFirst - property int beforeAnimator : 0; - property int scaleUpdates : 0; - property int afterAnimator : 0; - property int beforePause : 0; - property int afterPause : 0; - loops: 2 - SequentialAnimation { - ScriptAction { script: { - parallelWithTwoSequentialNormalEndsFirst.beforeAnimator++; - box.scale = 1; - box.scaleChangeCounter = 0; - } - } - ScaleAnimator { target: box; from: 1; to: 2; duration: 200; } - ScriptAction { script: { - parallelWithTwoSequentialNormalEndsFirst.scaleUpdates += box.scaleChangeCounter; - parallelWithTwoSequentialNormalEndsFirst.afterAnimator++; - } - } - } - SequentialAnimation { - ScriptAction { script: parallelWithTwoSequentialNormalEndsFirst.beforePause++ } - PauseAnimation { duration: 100 } - ScriptAction { script: parallelWithTwoSequentialNormalEndsFirst.afterPause++ } - } - } - - ScriptAction { script: box.rootEnd++; } - } - - } - -} diff --git a/tests/auto/qmltest/animators/tst_mixedparallel.qml b/tests/auto/qmltest/animators/tst_mixedparallel.qml deleted file mode 100644 index 9d36fd10dc..0000000000 --- a/tests/auto/qmltest/animators/tst_mixedparallel.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testcase - name: "animators-mixedparallel" - when: !animation.running - function test_endresult() { - compare(box.rotationChangeCounter, 1); - compare(box.scale, 2); - compare(box.rotation, 180); - var image = grabImage(root); - verify(image.pixel(0, 0) == Qt.rgba(0, 0, 1)); - verify(image.pixel(199, 199) == Qt.rgba(1, 0, 0)); - } - } - - Box { - id: box - ParallelAnimation { - id: animation - NumberAnimation { target: box; property: "scale"; from: 1; to: 2.0; duration: 100; } - RotationAnimator { target: box; from: 0; to: 180; duration: 100; } - running: true - loops: 1; - } - } -} diff --git a/tests/auto/qmltest/animators/tst_mixedsequential.qml b/tests/auto/qmltest/animators/tst_mixedsequential.qml deleted file mode 100644 index 0d58fc788e..0000000000 --- a/tests/auto/qmltest/animators/tst_mixedsequential.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testcase - name: "animators-mixedsequential" - when: !animation.running - function test_endresult() { - compare(box.rotationChangeCounter, 1); - compare(box.scale, 2); - compare(box.rotation, 180); - var image = grabImage(root); - verify(image.pixel(0, 0) == Qt.rgba(0, 0, 1)); - verify(image.pixel(199, 199) == Qt.rgba(1, 0, 0)); - } - } - - Box { - id: box - ParallelAnimation { - id: animation - NumberAnimation { target: box; property: "scale"; from: 1; to: 2.0; duration: 100; } - RotationAnimator { target: box; from: 0; to: 180; duration: 100; } - running: true - loops: 1; - } - } -} diff --git a/tests/auto/qmltest/animators/tst_multiwindow.qml b/tests/auto/qmltest/animators/tst_multiwindow.qml deleted file mode 100644 index 9a817993fe..0000000000 --- a/tests/auto/qmltest/animators/tst_multiwindow.qml +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Jolla Ltd, author: -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 -import QtQuick.Window 2.0 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-mixed" - when: countdown == 0 - function test_endresult() { - verify(true, "Just making sure we didn't crash"); - } - } - - property int countdown: 5; - - Window { - id: window - - width: 100 - height: 100 - - ShaderEffect { - width: 50 - height: 50 - - property real t; - UniformAnimator on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite } - RotationAnimator on rotation { from: 0; to: 360; duration: 1000; loops: Animation.Infinite } - ScaleAnimator on scale { from: 0.5; to: 1.5; duration: 1000; loops: Animation.Infinite } - XAnimator on x { from: 0; to: 50; duration: 1000; loops: Animation.Infinite } - YAnimator on y { from: 0; to: 50; duration: 1000; loops: Animation.Infinite } - OpacityAnimator on opacity { from: 1; to: 0.5; duration: 1000; loops: Animation.Infinite } - - fragmentShader: " - uniform lowp float t; - uniform lowp float qt_Opacity; - varying highp vec2 qt_TexCoord0; - void main() { - gl_FragColor = vec4(qt_TexCoord0, t, 1) * qt_Opacity; - } - " - } - - visible: true - } - - Timer { - interval: 250 - running: true - repeat: true - onTriggered: { - if (window.visible) - --countdown - window.visible = !window.visible; - } - } -} diff --git a/tests/auto/qmltest/animators/tst_nested.qml b/tests/auto/qmltest/animators/tst_nested.qml deleted file mode 100644 index 85f5d5a922..0000000000 --- a/tests/auto/qmltest/animators/tst_nested.qml +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-nested" - when: !animation.running - function test_endresult() { - compare(box.before, 2); - compare(box.after, 2); - } - } - - Box { - id: box - - anchors.centerIn: undefined - - property int before: 0; - property int after: 0; - - SequentialAnimation { - id: animation; - ScriptAction { script: box.before++; } - ParallelAnimation { - ScaleAnimator { target: box; from: 2.0; to: 1; duration: 100; } - OpacityAnimator { target: box; from: 0; to: 1; duration: 100; } - } - PauseAnimation { duration: 100 } - SequentialAnimation { - ParallelAnimation { - XAnimator { target: box; from: 0; to: 100; duration: 100 } - RotationAnimator { target: box; from: 0; to: 90; duration: 100 } - } - ParallelAnimation { - XAnimator { target: box; from: 100; to: 0; duration: 100 } - RotationAnimator { target: box; from: 90; to: 0; duration: 100 } - } - } - ScriptAction { script: box.after++; } - running: true - loops: 2 - } - } - -} diff --git a/tests/auto/qmltest/animators/tst_on.qml b/tests/auto/qmltest/animators/tst_on.qml deleted file mode 100644 index 3775350ae5..0000000000 --- a/tests/auto/qmltest/animators/tst_on.qml +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-on" - when: !animx.running && !animy.running - && !anims.running && !animr.running - && !animo.running; - function test_endresult() { - tryCompare(box, 'xChangeCounter', 1); - compare(box.yChangeCounter, 1); - compare(box.scaleChangeCounter, 1); - compare(box.rotationChangeCounter, 1); - compare(box.opacityChangeCounter, 1); - compare(box.x, 100); - compare(box.y, 100); - compare(box.scale, 2); - compare(box.rotation, 180); - compare(box.opacity, 0.5); - } - } - - Box { - id: box - anchors.centerIn: undefined - XAnimator on x { id: animx; from: 0; to: 100; duration: 100 } - YAnimator on y { id: animy; from: 0; to: 100; duration: 100 } - ScaleAnimator on scale { id: anims; from: 1; to: 2; duration: 100 } - RotationAnimator on rotation { id: animr ; from: 0; to: 180; duration: 100 } - OpacityAnimator on opacity { id: animo; from: 1; to: 0.5; duration: 100 } - } -} diff --git a/tests/auto/qmltest/animators/tst_opacity.qml b/tests/auto/qmltest/animators/tst_opacity.qml deleted file mode 100644 index 72b2c61012..0000000000 --- a/tests/auto/qmltest/animators/tst_opacity.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-opacity" - when: box.opacity == 0.5 - function test_endresult() { - compare(box.opacityChangeCounter, 1); - var image = grabImage(root); - compare(image.red(50, 50), 255); - verify(image.green(50, 50) > 0); - verify(image.blue(50, 50) > 0); - } - } - - Box { - id: box - - OpacityAnimator { - id: animation - target: box - from: 1; - to: 0.5 - duration: 100 - running: true - } - } -} diff --git a/tests/auto/qmltest/animators/tst_parallel.qml b/tests/auto/qmltest/animators/tst_parallel.qml deleted file mode 100644 index f25bae18d5..0000000000 --- a/tests/auto/qmltest/animators/tst_parallel.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testcase - name: "animators-parallel" - when: !animation.running - function test_endresult() { - compare(box.rotationChangeCounter, 1); - compare(box.scaleChangeCounter, 1); - compare(box.scale, 2); - compare(box.rotation, 180); - var image = grabImage(root); - verify(image.pixel(0, 0) == Qt.rgba(0, 0, 1)); - verify(image.pixel(199, 199) == Qt.rgba(1, 0, 0)); - } - } - - Box { - id: box - ParallelAnimation { - id: animation - ScaleAnimator { target: box; from: 1; to: 2.0; duration: 100; } - RotationAnimator { target: box; from: 0; to: 180; duration: 100; } - running: true - } - } -} diff --git a/tests/auto/qmltest/animators/tst_restart.qml b/tests/auto/qmltest/animators/tst_restart.qml deleted file mode 100644 index e029ca2059..0000000000 --- a/tests/auto/qmltest/animators/tst_restart.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - property int restartCount: 5; - - TestCase { - id: testcase - name: "animators-restart" - when: root.restartCount == 0 && animation.running == false; - function test_endresult() { - compare(box.scale, 2); - } - } - - Box { - id: box - - ScaleAnimator { - id: animation - target: box; - from: 1; - to: 2.0; - duration: 100; - loops: 1 - running: false; - } - - Timer { - id: timer; - interval: 500 - running: true - repeat: true - onTriggered: { - animation.running = true; - --root.restartCount; - } - } - } -} diff --git a/tests/auto/qmltest/animators/tst_rotation.qml b/tests/auto/qmltest/animators/tst_rotation.qml deleted file mode 100644 index a91af92ab1..0000000000 --- a/tests/auto/qmltest/animators/tst_rotation.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-rotation" - when: box.rotation == 180 - function test_endresult() { - compare(box.rotationChangeCounter, 1); - var image = grabImage(root); - verify(image.pixel(50, 50) == Qt.rgba(0, 0, 1)); - } - } - - Box { - id: box - RotationAnimator { - id: animation - target: box - from: 0; - to: 180 - duration: 100 - easing.type: Easing.InOutBack - running: true - } - } -} diff --git a/tests/auto/qmltest/animators/tst_scale.qml b/tests/auto/qmltest/animators/tst_scale.qml deleted file mode 100644 index 402468079a..0000000000 --- a/tests/auto/qmltest/animators/tst_scale.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-scale" - when: box.scale == 2; - function test_endresult() { - compare(box.scaleChangeCounter, 1); - var image = grabImage(root); - verify(image.pixel(0, 0) == Qt.rgba(1, 0, 0)); - } - } - - Box { - id: box - - ScaleAnimator { - id: animation - target: box - from: 1; - to: 2.0 - duration: 100 - easing.type: Easing.InOutCubic - running: true - } - } -} diff --git a/tests/auto/qmltest/animators/tst_sequential.qml b/tests/auto/qmltest/animators/tst_sequential.qml deleted file mode 100644 index f021bbeb7a..0000000000 --- a/tests/auto/qmltest/animators/tst_sequential.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testcase - name: "animators-parallel" - when: !animation.running - function test_endresult() { - compare(box.rotationChangeCounter, 1); - compare(box.scaleChangeCounter, 1); - compare(box.scale, 2); - compare(box.rotation, 180); - var image = grabImage(root); - compare(image.pixel(0, 0), Qt.rgba(0, 0, 1, 1)); - compare(image.pixel(199, 199), Qt.rgba(1, 0, 0, 1)); - } - } - - Box { - id: box - SequentialAnimation { - id: animation - ScaleAnimator { target: box; from: 1; to: 2.0; duration: 100; } - RotationAnimator { target: box; from: 0; to: 180; duration: 100; } - running: true - } - } -} diff --git a/tests/auto/qmltest/animators/tst_targetdestroyed.qml b/tests/auto/qmltest/animators/tst_targetdestroyed.qml deleted file mode 100644 index bf9efd2162..0000000000 --- a/tests/auto/qmltest/animators/tst_targetdestroyed.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Gunnar Sletta -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testcase - name: "animators-targetdestroyed" - when: false - function test_endresult() { - verify(true, "Got here :)"); - } - } - - Rectangle { - id: box - width: 10 - height: 10 - color: "steelblue" - } - - YAnimator { - id: anim - target: box - from: 0; - to: 100 - duration: 100 - loops: Animation.Infinite - running: true - } - - SequentialAnimation { - running: true - PauseAnimation { duration: 150 } - ScriptAction { script: box.destroy(); } - PauseAnimation { duration: 50 } - ScriptAction { script: anim.destroy(); } - PauseAnimation { duration: 50 } - ScriptAction { script: testcase.when = true } - } -} diff --git a/tests/auto/qmltest/animators/tst_transformorigin.qml b/tests/auto/qmltest/animators/tst_transformorigin.qml deleted file mode 100644 index eed93b9843..0000000000 --- a/tests/auto/qmltest/animators/tst_transformorigin.qml +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 300 - height: 300 - - Timer { - id: timer; - running: testCase.windowShown - interval: 1000 - repeat: false - onTriggered: triggered = true; - property bool triggered: false; - } - - TestCase { - id: testCase - name: "animators-transformorigin" - when: timer.triggered - function test_endresult() { - - var image = grabImage(root); - - var white = Qt.rgba(1, 1, 1); - var blue = Qt.rgba(0, 0, 1); - - - // topleft - verify(image.pixel(40, 40) == white); - verify(image.pixel(60, 40) == white); - verify(image.pixel(40, 60) == white); - verify(image.pixel(60, 60) == blue); - - // top - verify(image.pixel(140, 40) == white); - verify(image.pixel(160, 40) == white); - verify(image.pixel(140, 60) == blue); - verify(image.pixel(160, 60) == blue); - - // topright - verify(image.pixel(240, 40) == white); - verify(image.pixel(260, 40) == white); - verify(image.pixel(240, 60) == blue); - verify(image.pixel(260, 60) == white); - - - // left - verify(image.pixel(40, 140) == white); - verify(image.pixel(60, 140) == blue); - verify(image.pixel(40, 160) == white); - verify(image.pixel(60, 160) == blue); - - // center - verify(image.pixel(140, 140) == blue); - verify(image.pixel(160, 140) == blue); - verify(image.pixel(140, 160) == blue); - verify(image.pixel(160, 160) == blue); - - // right - verify(image.pixel(240, 140) == blue); - verify(image.pixel(260, 140) == white); - verify(image.pixel(240, 160) == blue); - verify(image.pixel(260, 160) == white); - - - // bottomleft - verify(image.pixel(40, 240) == white); - verify(image.pixel(60, 240) == blue); - verify(image.pixel(40, 260) == white); - verify(image.pixel(60, 260) == white); - - // bottom - verify(image.pixel(140, 240) == blue); - verify(image.pixel(160, 240) == blue); - verify(image.pixel(140, 260) == white); - verify(image.pixel(160, 260) == white); - - // bottomright - verify(image.pixel(240, 240) == blue); - verify(image.pixel(260, 240) == white); - verify(image.pixel(240, 260) == white); - verify(image.pixel(260, 260) == white); - - } - } - - property var origins: [Item.TopLeft, Item.Top, Item.TopRight, - Item.Left, Item.Center, Item.Right, - Item.BottomLeft, Item.Bottom, Item.BottomRight]; - - Grid { - anchors.fill: parent - rows: 3 - columns: 3 - - Repeater { - model: 9 - Item { - width: 100 - height: 100 - Rectangle { - id: box - color: "blue" - anchors.centerIn: parent - width: 10 - height: 10 - antialiasing: true; - - transformOrigin: root.origins[index]; - - ScaleAnimator { target: box; from: 1; to: 5.5; duration: 100; running: true; } - } - } - } - } - -} diff --git a/tests/auto/qmltest/animators/tst_transition.qml b/tests/auto/qmltest/animators/tst_transition.qml deleted file mode 100644 index b02238ef23..0000000000 --- a/tests/auto/qmltest/animators/tst_transition.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testcase - name: "animators-transition" - when: box.scale == 2 - function test_endresult() { - compare(box.scaleChangeCounter, 1); - compare(box.scale, 2); - var image = grabImage(root); - verify(image.pixel(0, 0) == Qt.rgba(1, 0, 0)); - verify(image.pixel(199, 199) == Qt.rgba(0, 0, 1)); - } - } - - states: [ - State { - name: "one" - PropertyChanges { target: box; scale: 1 } - }, - State { - name: "two" - PropertyChanges { target: box; scale: 2 } - } - ] - state: "one" - - transitions: [ - Transition { - ScaleAnimator { duration: 100; } - } - ] - - Box { - id: box - } - - Timer { - interval: 100; - repeat: false - running: true - onTriggered: root.state = "two" - } -} diff --git a/tests/auto/qmltest/animators/tst_x.qml b/tests/auto/qmltest/animators/tst_x.qml deleted file mode 100644 index c462ee87d0..0000000000 --- a/tests/auto/qmltest/animators/tst_x.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-x" - when: box.x == 100 - function test_endresult() { - compare(box.xChangeCounter, 1); - var image = grabImage(root); - verify(image.pixel(100, 0) == Qt.rgba(1, 0, 0)); - verify(image.pixel(99, 0) == Qt.rgba(1, 1, 1)); // outside on the left - } - } - - Box { - id: box - - anchors.centerIn: undefined - - XAnimator { - id: animation - target: box - from: 0; - to: 100 - duration: 100 - running: true - } - } -} diff --git a/tests/auto/qmltest/animators/tst_y.qml b/tests/auto/qmltest/animators/tst_y.qml deleted file mode 100644 index 04487baee0..0000000000 --- a/tests/auto/qmltest/animators/tst_y.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-y" - when: box.y == 100 - function test_endresult() { - compare(box.yChangeCounter, 1); - var image = grabImage(root); - verify(image.pixel(0, 100) == Qt.rgba(1, 0, 0)); - verify(image.pixel(0, 99) == Qt.rgba(1, 1, 1)); // outside on the top - } - } - - Box { - id: box - - anchors.centerIn: undefined - - YAnimator { - id: animation - target: box - from: 0; - to: 100 - duration: 100 - running: true - } - } -} diff --git a/tests/auto/qmltest/animators/tst_zeroduration.qml b/tests/auto/qmltest/animators/tst_zeroduration.qml deleted file mode 100644 index 83ce235f42..0000000000 --- a/tests/auto/qmltest/animators/tst_zeroduration.qml +++ /dev/null @@ -1,35 +0,0 @@ -import QtQuick 2.2 -import QtTest 1.1 - -Item { - id: root; - width: 200 - height: 200 - - TestCase { - id: testCase - name: "animators-y" - when: box.y == 100 - function test_endresult() { - compare(box.yChangeCounter, 1); - var image = grabImage(root); - verify(image.pixel(0, 100) == Qt.rgba(1, 0, 0)); - verify(image.pixel(0, 99) == Qt.rgba(1, 1, 1)); // outside on the top - } - } - - Box { - id: box - - anchors.centerIn: undefined - - YAnimator { - id: animation - target: box - from: 0; - to: 100 - duration: 0 - running: true - } - } -} diff --git a/tests/auto/qmltest/item/tst_layerInPositioner.qml b/tests/auto/qmltest/item/tst_layerInPositioner.qml deleted file mode 100644 index 315ff0e5e0..0000000000 --- a/tests/auto/qmltest/item/tst_layerInPositioner.qml +++ /dev/null @@ -1,199 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Jolla Ltd, author: -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.4 -import QtTest 1.1 - -Item { - id: root; - width: 400 - height: 400 - - TestCase { - id: testCase - name: "transparentForPositioner" - when: windowShown - function test_endresult() { - var image = grabImage(root); - - // Row of red, green, blue and white box inside blue - // At 10,10, spanning 10x10 pixels each - verify(image.pixel(10, 10) == Qt.rgba(1, 0, 0, 1)); - verify(image.pixel(20, 10) == Qt.rgba(0, 1, 0, 1)); - verify(image.pixel(30, 10) == Qt.rgba(0, 0, 1, 1)); - - // Column of red, green, blue and white box inside blue - // At 10,30, spanning 10x10 pixels each - verify(image.pixel(10, 30) == Qt.rgba(1, 0, 0, 1)); - verify(image.pixel(10, 40) == Qt.rgba(0, 1, 0, 1)); - verify(image.pixel(10, 50) == Qt.rgba(0, 0, 1, 1)); - - // Flow of red, green, blue and white box inside blue - // At 30,30, spanning 10x10 pixels each, wrapping after two boxes - verify(image.pixel(30, 30) == Qt.rgba(1, 0, 0, 1)); - verify(image.pixel(40, 30) == Qt.rgba(0, 1, 0, 1)); - verify(image.pixel(30, 40) == Qt.rgba(0, 0, 1, 1)); - - // Flow of red, green, blue and white box inside blue - // At 100,10, spanning 10x10 pixels each, wrapping after two boxes - verify(image.pixel(60, 10) == Qt.rgba(1, 0, 0, 1)); - verify(image.pixel(70, 10) == Qt.rgba(0, 1, 0, 1)); - verify(image.pixel(60, 20) == Qt.rgba(0, 0, 1, 1)); - } - } - - Component { - id: greenPassThrough - ShaderEffect { - fragmentShader: - " - uniform lowp sampler2D source; - varying highp vec2 qt_TexCoord0; - void main() { - gl_FragColor = texture2D(source, qt_TexCoord0) * vec4(0, 1, 0, 1); - } - " - } - } - - Row { - id: theRow - x: 10 - y: 10 - Rectangle { - width: 10 - height: 10 - color: "#ff0000" - layer.enabled: true - } - - Rectangle { - width: 10 - height: 10 - color: "#ffffff" - layer.enabled: true - layer.effect: greenPassThrough - } - - Rectangle { - id: blueInRow - width: 10 - height: 10 - color: "#0000ff" - } - } - - Column { - id: theColumn - x: 10 - y: 30 - Rectangle { - width: 10 - height: 10 - color: "#ff0000" - layer.enabled: true - } - - Rectangle { - width: 10 - height: 10 - color: "#ffffff" - layer.enabled: true - layer.effect: greenPassThrough - } - - Rectangle { - id: blueInColumn - width: 10 - height: 10 - color: "#0000ff" - } - } - - Flow { - id: theFlow - x: 30 - y: 30 - width: 20 - Rectangle { - width: 10 - height: 10 - color: "#ff0000" - layer.enabled: true - } - - Rectangle { - width: 10 - height: 10 - color: "#ffffff" - layer.enabled: true - layer.effect: greenPassThrough - } - - Rectangle { - id: blueInFlow - width: 10 - height: 10 - color: "#0000ff" - } - } - - Grid { - id: theGrid - x: 60 - y: 10 - columns: 2 - Rectangle { - width: 10 - height: 10 - color: "#ff0000" - layer.enabled: true - } - - Rectangle { - width: 10 - height: 10 - color: "#ffffff" - layer.enabled: true - layer.effect: greenPassThrough - } - - Rectangle { - id: blueInGrid - width: 10 - height: 10 - color: "#0000ff" - } - } - -} diff --git a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml deleted file mode 100644 index 5d65a1666c..0000000000 --- a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Jolla Ltd, author: -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.4 -import QtTest 1.1 - -Item { - id: root; - width: 400 - height: 400 - - TestCase { - id: testCase - name: "item-grabber" - when: imageOnDisk.ready && imageOnDiskSmall.ready && imageInCache.ready && imageInCacheSmall.ready - function test_endresult() { - var image = grabImage(root); - - // imageOnDisk at (0, 0) - (100x100) - compare(imageOnDisk.width, 100); - compare(imageOnDisk.height, 100); - verify(image.pixel(0, 0) === Qt.rgba(1, 0, 0, 1)); // Use verify because compare doesn't support colors (QTBUG-34878) - verify(image.pixel(99, 99) === Qt.rgba(0, 0, 1, 1)); - - // imageOnDiskSmall at (100, 0) - 50x50 - compare(imageOnDiskSmall.width, 50); - compare(imageOnDiskSmall.height, 50); - verify(image.pixel(100, 0) === Qt.rgba(1, 0, 0, 1)); - verify(image.pixel(149, 49) === Qt.rgba(0, 0, 1, 1)); - - // imageInCache at (0, 100) - 100x100 - compare(imageInCache.width, 100); - compare(imageInCache.height, 100); - verify(image.pixel(0, 100) === Qt.rgba(1, 0, 0, 1)); - verify(image.pixel(99, 199) === Qt.rgba(0, 0, 1, 1)); - - // imageInCacheSmall at (100, 100) - 50x50 - compare(imageInCacheSmall.width, 50); - compare(imageInCacheSmall.height, 50); - verify(image.pixel(100, 100) === Qt.rgba(1, 0, 0, 1)); - verify(image.pixel(149, 149) === Qt.rgba(0, 0, 1, 1)); - - // After all that has been going on, it should only have been called that one time.. - compare(imageOnDisk.callCount, 1); - } - - onWindowShownChanged: { - box.grabToImage(imageOnDisk.handleGrab); - box.grabToImage(imageOnDiskSmall.handleGrab, Qt.size(50, 50)); - box.grabToImage(imageInCache.handleGrab); - box.grabToImage(imageInCacheSmall.handleGrab, Qt.size(50, 50)); - } - - } - - Rectangle { - id: box - width: 100 - height: 100 - color: "red"; - - visible: false - - Rectangle { - anchors.bottom: parent.bottom; - anchors.right: parent.right; - width: 10 - height: 10 - color: "blue"; - } - } - - Image { - id: imageOnDisk - x: 0 - y: 0 - property int callCount: 0; - property bool ready: false; - function handleGrab(result) { - if (!result.saveToFile("image.png")) - print("Error: Failed to save image to disk..."); - source = "image.png"; - ready = true; - ++callCount; - } - } - - Image { - id: imageOnDiskSmall - x: 100 - y: 0 - property bool ready: false; - function handleGrab(result) { - if (!result.saveToFile("image_small.png")) - print("Error: Failed to save image to disk..."); - source = "image_small.png"; - ready = true; - } - } - - Image { - id: imageInCache - x: 0 - y: 100 - property bool ready: false; - function handleGrab(result) { - source = result.url; - ready = true; - } - } - - Image { - id: imageInCacheSmall - x: 100 - y: 100 - property bool ready: false; - function handleGrab(result) { - source = result.url; - ready = true; - } - } -} diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml index 988d30f9a2..a3cae7fce2 100644 --- a/tests/auto/qmltest/listview/tst_listview.qml +++ b/tests/auto/qmltest/listview/tst_listview.qml @@ -272,6 +272,7 @@ Item { } function test_asyncLoaderCurrentIndexChange() { + skip("more details in QTBUG-53780") for (var i = 0; i < 500; i++) { asyncLoaderCurrentIndexListView.currentIndex = 0; asyncLoaderCurrentIndexListView.currentIndex = 1; @@ -284,6 +285,7 @@ Item { } function test_asyncListViewLoader() { + skip("more details in QTBUG-53780") for (var i = 0; i < 50; i++) { wait(10); asyncListViewLoaderView.currentIndex = 0; diff --git a/tests/auto/qmltest/qmltest.pro b/tests/auto/qmltest/qmltest.pro index 7662cb1687..175ed42c0f 100644 --- a/tests/auto/qmltest/qmltest.pro +++ b/tests/auto/qmltest/qmltest.pro @@ -11,5 +11,5 @@ importFiles.path = . DEPLOYMENT += importFiles DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -CONFIG+=insignificant_test # QTBUG-33723 - +# Please do not make this test insignificant again, thanks. +# Just skip those unstable ones. See also QTBUG-33723. diff --git a/tests/auto/qmltest/window/tst_clickwindow.qml b/tests/auto/qmltest/window/tst_clickwindow.qml index bbe091990c..c3577be4dc 100644 --- a/tests/auto/qmltest/window/tst_clickwindow.qml +++ b/tests/auto/qmltest/window/tst_clickwindow.qml @@ -75,6 +75,8 @@ Item { when: windowShown function test_clickBothWindows() { + if (Qt.platform.os === "linux" || Qt.platform.os === "windows") + skip("more details in QTBUG-53785") mouseClick(ma, 20, 20); verify(ma.everClicked); mouseClick(ma2, 20, 20); -- cgit v1.2.3 From 7039db4885a143f8f1d363c9b71665e9160d3d55 Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Thu, 2 Jun 2016 21:49:37 +0200 Subject: Revert removal of "Fixed MouseArea threshold with preventStealing" This reverts commit 9c8dab537819f0d999e680490c2d125b8836cbbb where commit e1400b5b4d8311769ad3b9f631479ee2b0271197 was removed due to the breakage of QtLocation tests. After some hours of debugging it seems that the problem in QtLocation was due to filtering of mouse move events in QDeclarativeGeoMapItemBase. See QTBUG-52075 Task-number: QTBUG-52534 Change-Id: I00f002c1d6f60f74a148b5a6ac2b9f63e93718a9 Reviewed-by: Paolo Angelelli Reviewed-by: Michal Klocek --- src/quick/items/qquickmousearea.cpp | 21 +++++++++++++-------- src/quick/items/qquickmousearea_p_p.h | 1 + .../quick/qquickmousearea/tst_qquickmousearea.cpp | 11 +++++++++++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index ef053abbd1..d66e55aa12 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -52,7 +52,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlVisualTouchDebugging, QML_VISUAL_TOUCH_DEBUGGING) QQuickMouseAreaPrivate::QQuickMouseAreaPrivate() : enabled(true), scrollGestureEnabled(true), hovered(false), longPress(false), moved(false), stealMouse(false), doubleClick(false), preventStealing(false), - propagateComposedEvents(false), pressed(0) + propagateComposedEvents(false), overThreshold(false), pressed(0) #ifndef QT_NO_DRAGANDDROP , drag(0) #endif @@ -715,7 +715,7 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event) curLocalPos = event->windowPos(); } - if (keepMouseGrab() && d->stealMouse && !d->drag->active()) + if (keepMouseGrab() && d->stealMouse && d->overThreshold && !d->drag->active()) d->drag->setActive(true); QPointF startPos = d->drag->target()->parentItem() @@ -741,16 +741,19 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event) if (d->drag->active()) d->drag->target()->setPosition(dragPos); - if (!keepMouseGrab() - && (QQuickWindowPrivate::dragOverThreshold(dragPos.x() - startPos.x(), Qt::XAxis, event, d->drag->threshold()) - || QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), Qt::YAxis, event, d->drag->threshold()))) { - setKeepMouseGrab(true); - d->stealMouse = true; - + if (!d->overThreshold && (QQuickWindowPrivate::dragOverThreshold(dragPos.x() - startPos.x(), Qt::XAxis, event, d->drag->threshold()) + || QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), Qt::YAxis, event, d->drag->threshold()))) + { + d->overThreshold = true; if (d->drag->smoothed()) d->startScene = event->windowPos(); } + if (!keepMouseGrab() && d->overThreshold) { + setKeepMouseGrab(true); + d->stealMouse = true; + } + d->moved = true; } #endif @@ -767,6 +770,7 @@ void QQuickMouseArea::mouseReleaseEvent(QMouseEvent *event) { Q_D(QQuickMouseArea); d->stealMouse = false; + d->overThreshold = false; if (!d->enabled && !d->pressed) { QQuickItem::mouseReleaseEvent(event); } else { @@ -875,6 +879,7 @@ void QQuickMouseArea::ungrabMouse() d->pressed = 0; d->stealMouse = false; d->doubleClick = false; + d->overThreshold = false; setKeepMouseGrab(false); #ifndef QT_NO_DRAGANDDROP diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h index 014729b651..f63c5f6092 100644 --- a/src/quick/items/qquickmousearea_p_p.h +++ b/src/quick/items/qquickmousearea_p_p.h @@ -86,6 +86,7 @@ public: bool doubleClick : 1; bool preventStealing : 1; bool propagateComposedEvents : 1; + bool overThreshold : 1; Qt::MouseButtons pressed; #ifndef QT_NO_DRAGANDDROP QQuickDrag *drag; diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp index 82c053d76a..9cdfd21f9c 100644 --- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp +++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp @@ -79,6 +79,7 @@ private slots: void dragging_data() { acceptedButton_data(); } void dragging(); void dragSmoothed(); + void dragThreshold_data(); void dragThreshold(); void invalidDrag_data() { rejectedButton_data(); } void invalidDrag(); @@ -375,8 +376,17 @@ void tst_QQuickMouseArea::dragSmoothed() QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(100, 122)); } +void tst_QQuickMouseArea::dragThreshold_data() +{ + QTest::addColumn("preventStealing"); + QTest::newRow("without preventStealing") << false; + QTest::newRow("with preventStealing") << true; +} + void tst_QQuickMouseArea::dragThreshold() { + QFETCH(bool, preventStealing); + QQuickView window; QByteArray errorMessage; QVERIFY2(initView(window, testFileUrl("dragging.qml"), true, &errorMessage), errorMessage.constData()); @@ -386,6 +396,7 @@ void tst_QQuickMouseArea::dragThreshold() QVERIFY(window.rootObject() != 0); QQuickMouseArea *mouseRegion = window.rootObject()->findChild("mouseregion"); + mouseRegion->setPreventStealing(preventStealing); QQuickDrag *drag = mouseRegion->drag(); drag->setThreshold(5); -- cgit v1.2.3 From b6c64c2ef3b1fd314ea85be003fd88d43e36ee54 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 3 Jun 2016 13:44:30 +0200 Subject: Item: mention the actual type of the grab result Change-Id: I2c73a4bdfa43200c52df33cec573a8799e4fe5e0 Reviewed-by: Simon Hausmann --- src/quick/items/qquickitemgrabresult.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquickitemgrabresult.cpp b/src/quick/items/qquickitemgrabresult.cpp index 939d19ea02..4e3e5570ee 100644 --- a/src/quick/items/qquickitemgrabresult.cpp +++ b/src/quick/items/qquickitemgrabresult.cpp @@ -321,7 +321,8 @@ QSharedPointer QQuickItem::grabToImage(const QSize &target * Grabs the item into an in-memory image. * * The grab happens asynchronously and the JavaScript function \a callback is - * invoked when the grab is completed. + * invoked when the grab is completed. The callback takes one argument, which + * is the result of the grab operation; an \l ItemGrabResult object. * * Use \a targetSize to specify the size of the target image. By default, the result * will have the same size as the item. -- cgit v1.2.3 From 6d63e3ba09954ce7b56b4b24432bd036e636b164 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 Jun 2016 16:14:21 +0200 Subject: Fix bug in SQL database integration with null values Since commit 91d6a63ab317817990c3b2306860adbd8916cca4 a null JS value is mapped to a QVariant(VoidStar) to properly create null JS values when converting back again. However that broke the binding of values in the SQL database, where it ended up mapping null to an empty string. [ChangeLog][QtQml] Fix mapping of null JS values to null SQL values instead of empty strings. Task-number: QTBUG-53412 Change-Id: Icf1fea4674e9dd8bb5313e3770ed2d3f99849987 Reviewed-by: Robin Burchell --- src/imports/localstorage/plugin.cpp | 18 ++++++++++++---- tests/auto/qml/qqmlsqldatabase/data/nullvalues.js | 24 ++++++++++++++++++++++ .../qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp | 3 ++- 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 tests/auto/qml/qqmlsqldatabase/data/nullvalues.js diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index b8d7030763..d32bb0069d 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -257,6 +257,15 @@ static ReturnedValue qmlsqldatabase_rows_item(CallContext *ctx) return qmlsqldatabase_rows_index(r, scope.engine, ctx->argc() ? ctx->args()[0].toUInt32() : 0); } +static QVariant toSqlVariant(QV4::ExecutionEngine *engine, const QV4::ScopedValue &value) +{ + // toVariant() maps a null JS value to QVariant(VoidStar), but the SQL module + // expects a null variant. (this is because of QTBUG-40880) + if (value->isNull()) + return QVariant(); + return engine->toVariant(value, /*typehint*/-1); +} + static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx) { QV4::Scope scope(ctx); @@ -287,8 +296,9 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx) ScopedArrayObject array(scope, values); quint32 size = array->getLength(); QV4::ScopedValue v(scope); - for (quint32 ii = 0; ii < size; ++ii) - query.bindValue(ii, scope.engine->toVariant((v = array->getIndexed(ii)), -1)); + for (quint32 ii = 0; ii < size; ++ii) { + query.bindValue(ii, toSqlVariant(scope.engine, (v = array->getIndexed(ii)))); + } } else if (values->as()) { ScopedObject object(scope, values); ObjectIterator it(scope, object, ObjectIterator::WithProtoChain|ObjectIterator::EnumerableOnly); @@ -298,7 +308,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx) key = it.nextPropertyName(val); if (key->isNull()) break; - QVariant v = scope.engine->toVariant(val, -1); + QVariant v = toSqlVariant(scope.engine, val); if (key->isString()) { query.bindValue(key->stringValue()->toQString(), v); } else { @@ -307,7 +317,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx) } } } else { - query.bindValue(0, scope.engine->toVariant(values, -1)); + query.bindValue(0, toSqlVariant(scope.engine, values)); } } if (query.exec()) { diff --git a/tests/auto/qml/qqmlsqldatabase/data/nullvalues.js b/tests/auto/qml/qqmlsqldatabase/data/nullvalues.js new file mode 100644 index 0000000000..322a7aea03 --- /dev/null +++ b/tests/auto/qml/qqmlsqldatabase/data/nullvalues.js @@ -0,0 +1,24 @@ +.import QtQuick.LocalStorage 2.0 as Sql + +function test() { + var db = Sql.LocalStorage.openDatabaseSync("QmlTestDB-nullvalues", "", "Test database from Qt autotests", 1000000); + var r="transaction_not_finished"; + + db.transaction( + function(tx) { + tx.executeSql('CREATE TABLE IF NOT EXISTS NullValues(salutation TEXT, salutee TEXT)'); + tx.executeSql('INSERT INTO NullValues VALUES(?, ?)', [ 'hello', null ]); + var firstRow = tx.executeSql("SELECT * FROM NullValues").rows.item(0); + if (firstRow.salutation !== "hello") + return + if (firstRow.salutee === "") { + r = "wrong_data_type" + return + } + if (firstRow.salutee === null) + r = "passed"; + } + ); + + return r; +} diff --git a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp index b5b77ad10b..debafa3fe4 100644 --- a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp +++ b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp @@ -127,7 +127,7 @@ void tst_qqmlsqldatabase::checkDatabasePath() QVERIFY(engine->offlineStoragePath().contains("OfflineStorage")); } -static const int total_databases_created_by_tests = 12; +static const int total_databases_created_by_tests = 13; void tst_qqmlsqldatabase::testQml_data() { QTest::addColumn("jsfile"); // The input file @@ -149,6 +149,7 @@ void tst_qqmlsqldatabase::testQml_data() QTest::newRow("error-outsidetransaction") << "error-outsidetransaction.js"; // reuse above QTest::newRow("reopen1") << "reopen1.js"; QTest::newRow("reopen2") << "reopen2.js"; // re-uses above DB + QTest::newRow("null-values") << "nullvalues.js"; // If you add a test, you should usually use a new database in the // test - in which case increment total_databases_created_by_tests above. -- cgit v1.2.3 From 6d54a59bd725ba83e758236c5ff0fc7855109dac Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 2 Jun 2016 15:57:41 +0200 Subject: Fix crash when using with statement with an expression that throws We need to evaluate the expression for the "with" statement that is supposed to define the new scope _before_ opening up the scope, otherwise - when the evaluation of the expression throws an exception - we'll try to pop the "with" scope we couldn't open in the first place. [ChangeLog][QtQml] Fix crash when using the "with" statement with an expression that throws an exception. Task-number: QTBUG-53794 Change-Id: I7733f5a4c5d844916302b9a91c789a0f6b421e8a Reviewed-by: Lars Knoll --- src/qml/compiler/qv4codegen.cpp | 5 +++-- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index ea82d07e69..c14163a2f7 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2718,6 +2718,9 @@ bool Codegen::visit(WithStatement *ast) _function->hasWith = true; + const int withObject = _block->newTemp(); + _block->MOVE(_block->TEMP(withObject), *expression(ast->expression)); + // need an exception handler for with to cleanup the with scope IR::BasicBlock *withExceptionHandler = _function->newBasicBlock(exceptionHandler()); withExceptionHandler->EXP(withExceptionHandler->CALL(withExceptionHandler->NAME(IR::Name::builtin_pop_scope, 0, 0), 0)); @@ -2732,8 +2735,6 @@ bool Codegen::visit(WithStatement *ast) _block->JUMP(withBlock); _block = withBlock; - int withObject = _block->newTemp(); - _block->MOVE(_block->TEMP(withObject), *expression(ast->expression)); IR::ExprList *args = _function->New(); args->init(_block->TEMP(withObject)); _block->EXP(_block->CALL(_block->NAME(IR::Name::builtin_push_with_scope, 0, 0), args)); diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 9a0865c0ac..8594aec8cd 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -193,6 +193,8 @@ private slots: void v4FunctionWithoutQML(); + void withNoContext(); + signals: void testSignal(); }; @@ -3840,6 +3842,13 @@ void tst_QJSEngine::v4FunctionWithoutQML() QVERIFY(obj.called); } +void tst_QJSEngine::withNoContext() +{ + // Don't crash (QTBUG-53794) + QJSEngine engine; + engine.evaluate("with (noContext) true"); +} + QTEST_MAIN(tst_QJSEngine) #include "tst_qjsengine.moc" -- cgit v1.2.3 From cb8ce2bfaffc42aedeeaf5e68f7e5b481ba4c95b Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 7 Jun 2016 16:27:30 +0100 Subject: KeyNavigation: fix the documentation for its properties It does not make any sense to document these properties with the same text, as qdoc will duplicate the text under the documentation of each and every property in the same documentation comment, resulting in weird documentation (such as the element you assign to "left" is the one you move to when you press the *right* key). Change-Id: Ic27502a5965cc2b8c61cfdaf887434d3c79256af Reviewed-by: Mitch Curtis --- src/quick/items/qquickitem.cpp | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index e963f91961..d0f5f162fc 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -414,21 +414,44 @@ void QQuickItemKeyFilter::componentComplete() /*! \qmlproperty Item QtQuick::KeyNavigation::left + + This property holds the item to assign focus to + when the left cursor key is pressed. +*/ + +/*! \qmlproperty Item QtQuick::KeyNavigation::right + + This property holds the item to assign focus to + when the right cursor key is pressed. +*/ + +/*! \qmlproperty Item QtQuick::KeyNavigation::up + + This property holds the item to assign focus to + when the up cursor key is pressed. +*/ + +/*! \qmlproperty Item QtQuick::KeyNavigation::down - These properties hold the item to assign focus to - when the left, right, up or down cursor keys - are pressed. + This property holds the item to assign focus to + when the down cursor key is pressed. */ /*! \qmlproperty Item QtQuick::KeyNavigation::tab + + This property holds the item to assign focus to + when the Tab key is pressed. +*/ + +/*! \qmlproperty Item QtQuick::KeyNavigation::backtab - These properties hold the item to assign focus to - when the Tab key or Shift+Tab key combination (Backtab) are pressed. + This property holds the item to assign focus to + when the Shift+Tab key combination (Backtab) is pressed. */ QQuickKeyNavigationAttached::QQuickKeyNavigationAttached(QObject *parent) -- cgit v1.2.3 From 6887fa0baf0f0e09a3dda74390236b27619f76d4 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 7 Jun 2016 15:10:17 +0200 Subject: Fix 'Threaded Render Loop' docs Change-Id: I682a4765d1e0173664460fe4e163949d968d97d7 Reviewed-by: Gunnar Sletta --- src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc index 9ccb05cdf1..516630d034 100644 --- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc +++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc @@ -214,7 +214,7 @@ user input. An event is posted to the render thread to initiate a new frame. \li The render thread prepares to draw a new frame and makes the -OpenGL context current and initiates a blocks on the GUI thread. +OpenGL context current and initiates a block on the GUI thread. \li While the render thread is preparing the new frame, the GUI thread calls QQuickItem::updatePolish() to do final touch-up of items before -- cgit v1.2.3 From cd0efef04bd45eca6cc72b5a000e4e5586153290 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 7 Jun 2016 15:22:12 +0200 Subject: Fix spelling error in QSGNode docs Change-Id: I9ece132b87a8de06924e71b6f5fc552a14dea336 Reviewed-by: Gunnar Sletta --- src/quick/scenegraph/coreapi/qsgnode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index c09af7c0a3..48f5854a54 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -331,12 +331,12 @@ QSGNode::~QSGNode() to the scene graph and will cause the preprocess() function to be called for every frame the node is rendered. - The preprocess function is called before the update pass that propegates + The preprocess function is called before the update pass that propagates opacity and transformations through the scene graph. That means that functions like QSGOpacityNode::combinedOpacity() and QSGTransformNode::combinedMatrix() will not contain up-to-date values. If such values are changed during the preprocess, these changes will be - propegated through the scene graph before it is rendered. + propagated through the scene graph before it is rendered. \warning Beware of deleting nodes while they are being preprocessed. It is possible, with a small performance hit, to delete a single node during its @@ -1331,7 +1331,7 @@ const qreal OPACITY_THRESHOLD = 0.001; Sets the opacity of this node to \a opacity. Before rendering the graph, the renderer will do an update pass - over the subtree to propegate the opacity to its children. + over the subtree to propagate the opacity to its children. The value will be bounded to the range 0 to 1. */ -- cgit v1.2.3