From fb7ab18fa799032f37fd6f78ab34b76aff91ed6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20E=2E=20Narv=C3=A1ez?= Date: Sat, 16 Feb 2013 10:42:23 -0500 Subject: Add Test for Animating Qml Dynamic Properties using QPropertyAnimation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test case for calling QQmlVMEMetaObject::metaCall from QPropertyAnimationPrivate::updateProperty Task-number: QTBUG-29082 Change-Id: Iecab74132eb3a843e53356effe3b6bbe4d5a8fb2 Reviewed-by: Alan Alpert Reviewed-by: Jędrzej Nowacki --- .../qquickdynamicpropertyanimation/data/MyItem.qml | 13 ++ .../qquickdynamicpropertyanimation.pro | 14 +++ .../tst_qquickdynamicpropertyanimation.cpp | 138 +++++++++++++++++++++ tests/auto/quick/quick.pro | 1 + 4 files changed, 166 insertions(+) create mode 100644 tests/auto/quick/qquickdynamicpropertyanimation/data/MyItem.qml create mode 100644 tests/auto/quick/qquickdynamicpropertyanimation/qquickdynamicpropertyanimation.pro create mode 100644 tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp (limited to 'tests/auto') diff --git a/tests/auto/quick/qquickdynamicpropertyanimation/data/MyItem.qml b/tests/auto/quick/qquickdynamicpropertyanimation/data/MyItem.qml new file mode 100644 index 0000000000..2fc8b90ac8 --- /dev/null +++ b/tests/auto/quick/qquickdynamicpropertyanimation/data/MyItem.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +Item +{ + property int testInt: 0 + property double testDouble: 0.0 + property real testReal: 0.0 + property point testPoint: Qt.point(0, 0) + property size testSize: Qt.size(0, 0) + property rect testRect: Qt.rect(0, 0, 0, 0) + property color testColor: Qt.rgba(0.0, 0.0, 0.0, 0.0) + property var testVar: 0 +} diff --git a/tests/auto/quick/qquickdynamicpropertyanimation/qquickdynamicpropertyanimation.pro b/tests/auto/quick/qquickdynamicpropertyanimation/qquickdynamicpropertyanimation.pro new file mode 100644 index 0000000000..a67daa91ba --- /dev/null +++ b/tests/auto/quick/qquickdynamicpropertyanimation/qquickdynamicpropertyanimation.pro @@ -0,0 +1,14 @@ +CONFIG += testcase +TARGET = tst_qquickdynamicpropertyanimation +SOURCES += tst_qquickdynamicpropertyanimation.cpp + +include (../../shared/util.pri) + +macx:CONFIG -= app_bundle + +TESTDATA = data/* + +CONFIG += parallel_test + +QT += core gui qml quick testlib +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp b/tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp new file mode 100644 index 0000000000..78f2d17e9b --- /dev/null +++ b/tests/auto/quick/qquickdynamicpropertyanimation/tst_qquickdynamicpropertyanimation.cpp @@ -0,0 +1,138 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../shared/util.h" + +class tst_qquickdynamicpropertyanimation : public QQmlDataTest +{ + Q_OBJECT +public: + tst_qquickdynamicpropertyanimation() {} + +private: + template + void dynamicPropertyAnimation(const QByteArray & propertyName, T toValue) + { + QQuickView view(testFileUrl("MyItem.qml")); + QQuickItem * item = qobject_cast(view.rootObject()); + QVERIFY(item); + QQmlProperty testProp(item, propertyName); + QPropertyAnimation animation(item, propertyName, this); + animation.setEndValue(toValue); + QVERIFY(animation.targetObject() == item); + QVERIFY(animation.propertyName() == propertyName); + QVERIFY(animation.endValue().value() == toValue); + animation.start(); + QVERIFY(animation.state() == QAbstractAnimation::Running); + QTest::qWait(animation.duration()); + QTRY_COMPARE(testProp.read().value(), toValue); + } + +private slots: + void initTestCase() + { + QQmlEngine engine; // ensure types are registered + QQmlDataTest::initTestCase(); + } + + void dynamicIntPropertyAnimation(); + void dynamicDoublePropertyAnimation(); + void dynamicRealPropertyAnimation(); + void dynamicPointPropertyAnimation(); + void dynamicSizePropertyAnimation(); + void dynamicRectPropertyAnimation(); + void dynamicColorPropertyAnimation(); + void dynamicVarPropertyAnimation(); +}; + +void tst_qquickdynamicpropertyanimation::dynamicIntPropertyAnimation() +{ + dynamicPropertyAnimation("testInt", 1); +} + +void tst_qquickdynamicpropertyanimation::dynamicDoublePropertyAnimation() +{ + dynamicPropertyAnimation("testDouble", 1.0); +} + +void tst_qquickdynamicpropertyanimation::dynamicRealPropertyAnimation() +{ + dynamicPropertyAnimation("testReal", qreal(1.0)); +} + +void tst_qquickdynamicpropertyanimation::dynamicPointPropertyAnimation() +{ + dynamicPropertyAnimation("testPoint", QPoint(1, 1)); +} + +void tst_qquickdynamicpropertyanimation::dynamicSizePropertyAnimation() +{ + dynamicPropertyAnimation("testSize", QSize(1,1)); +} + +void tst_qquickdynamicpropertyanimation::dynamicRectPropertyAnimation() +{ + dynamicPropertyAnimation("testRect", QRect(1, 1, 1, 1)); +} + +void tst_qquickdynamicpropertyanimation::dynamicColorPropertyAnimation() +{ + dynamicPropertyAnimation("testColor", QColor::fromRgbF(1.0, 1.0, 1.0, 1.0)); +} + +void tst_qquickdynamicpropertyanimation::dynamicVarPropertyAnimation() +{ + dynamicPropertyAnimation("testVar", QVariant::fromValue(1)); +} + +QTEST_MAIN(tst_qquickdynamicpropertyanimation) + +#include "tst_qquickdynamicpropertyanimation.moc" diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index 3ed6ca8c99..c4a4173e0f 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -35,6 +35,7 @@ QUICKTESTS = \ qquickanchors \ qquickanimatedimage \ qquickanimatedsprite \ + qquickdynamicpropertyanimation \ qquickborderimage \ qquickwindow \ qquickdrag \ -- cgit v1.2.3 From b9e05ba421c97ec60f4b308efaaed32c1a35b0b8 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 21 Feb 2013 13:17:45 +0100 Subject: Stabilize clicking in QQuickTextEdit test This test would try to emulate mouse clicks and not wait inbetween. That can lead to clicks spilling over to the next mouse event. Change-Id: I320f86453215190a1c694ba49c0fc3831dcb60b9 Reviewed-by: Pierre Rossi --- tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index 78ae94e53e..bf7539e449 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -1872,6 +1872,8 @@ void tst_qquicktextedit::mouseSelection() QTest::mouseRelease(&window, Qt::LeftButton, Qt::NoModifier, p2); QTRY_COMPARE(textEditObject->selectedText(), selectedText); + QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); + // Clicking and shift to clicking between the same points should select the same text. textEditObject->setCursorPosition(0); if (clicks > 1) -- cgit v1.2.3 From 7a1282a9edd8afa4645d7d449ca2ed3746fb8d71 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Fri, 15 Feb 2013 21:29:32 +1000 Subject: MouseArea shouldn't grab the mouse until there is an effective drag. A MouseArea shouldn't prevent a parent MouseArea or Flickable from handling a drag event unless it is going to do something useful with it. Task-number: 29717 Change-Id: I24016994f6cf9116382ef7faeb50b10e5716e10e Reviewed-by: Alan Alpert --- .../qquickmousearea/data/nestedStopAtBounds.qml | 44 ++++++++++++++ .../quick/qquickmousearea/tst_qquickmousearea.cpp | 68 ++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 tests/auto/quick/qquickmousearea/data/nestedStopAtBounds.qml (limited to 'tests/auto') diff --git a/tests/auto/quick/qquickmousearea/data/nestedStopAtBounds.qml b/tests/auto/quick/qquickmousearea/data/nestedStopAtBounds.qml new file mode 100644 index 0000000000..1fd39bb321 --- /dev/null +++ b/tests/auto/quick/qquickmousearea/data/nestedStopAtBounds.qml @@ -0,0 +1,44 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 400 + + MouseArea { + id: outer + objectName: "outer" + x: 50 + y: 50 + width: 300 + height: 300 + + drag.target: outer + drag.filterChildren: true + + Rectangle { + anchors.fill: parent + color: "yellow" + } + + MouseArea { + id: inner + objectName: "inner" + + x: 0 + y: 0 + width: 200 + height: 200 + + drag.target: inner + drag.minimumX: 0 + drag.maximumX: 100 + drag.minimumY: 0 + drag.maximumY: 100 + + Rectangle { + anchors.fill: parent + color: "blue" + } + } + } +} diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp index 37ce0fd394..ef7dc72345 100644 --- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp +++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp @@ -89,6 +89,8 @@ private slots: void cursorShape(); #endif void moveAndReleaseWithoutPress(); + void nestedStopAtBounds(); + void nestedStopAtBounds_data(); private: void acceptedButton_data(); @@ -1426,6 +1428,72 @@ void tst_QQuickMouseArea::moveAndReleaseWithoutPress() delete window; } +void tst_QQuickMouseArea::nestedStopAtBounds_data() +{ + QTest::addColumn("transpose"); + QTest::addColumn("invert"); + + QTest::newRow("left") << false << false; + QTest::newRow("right") << false << true; + QTest::newRow("top") << true << false; + QTest::newRow("bottom") << true << true; +} + +void tst_QQuickMouseArea::nestedStopAtBounds() +{ + QFETCH(bool, transpose); + QFETCH(bool, invert); + + QQuickView view; + view.setSource(testFileUrl("nestedStopAtBounds.qml")); + view.show(); + view.requestActivate(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); + QVERIFY(view.rootObject()); + + QQuickMouseArea *outer = view.rootObject()->findChild("outer"); + QVERIFY(outer); + + QQuickMouseArea *inner = outer->findChild("inner"); + QVERIFY(inner); + inner->drag()->setAxis(transpose ? QQuickDrag::YAxis : QQuickDrag::XAxis); + inner->setX(invert ? 100 : 0); + inner->setY(invert ? 100 : 0); + + const int threshold = qApp->styleHints()->startDragDistance(); + + QPoint position(200, 200); + int &axis = transpose ? position.ry() : position.rx(); + + // drag toward the aligned boundary. Outer mouse area dragged. + QTest::mousePress(&view, Qt::LeftButton, 0, position); + QTest::qWait(10); + axis += invert ? threshold * 2 : -threshold * 2; + QTest::mouseMove(&view, position); + axis += invert ? threshold : -threshold; + QTest::mouseMove(&view, position); + QCOMPARE(outer->drag()->active(), true); + QCOMPARE(inner->drag()->active(), false); + QTest::mouseRelease(&view, Qt::LeftButton, 0, position); + + QVERIFY(!outer->drag()->active()); + + axis = 200; + outer->setX(50); + outer->setY(50); + + // drag away from the aligned boundary. Inner mouse area dragged. + QTest::mousePress(&view, Qt::LeftButton, 0, position); + QTest::qWait(10); + axis += invert ? -threshold * 2 : threshold * 2; + QTest::mouseMove(&view, position); + axis += invert ? -threshold : threshold; + QTest::mouseMove(&view, position); + QCOMPARE(outer->drag()->active(), false); + QCOMPARE(inner->drag()->active(), true); + QTest::mouseRelease(&view, Qt::LeftButton, 0, position); +} + QTEST_MAIN(tst_QQuickMouseArea) #include "tst_qquickmousearea.moc" -- cgit v1.2.3 From 6ad4a61d482d895d135a7a281115bf104e0b9a90 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Sat, 16 Feb 2013 17:21:28 +1000 Subject: Flickable shouldn't grab the mouse until it starts an effective move. If the boundBehavior prevents the flickable from moving its content item in response to a drag it shouldn't grab the mouse as that will prevent a parent MouseArea or Flickable from handling the drag. Task-number: QTBUG-29718 Change-Id: I3a1be4ed0132b91dca2fb0387ecefd39275a52da Reviewed-by: Alan Alpert --- .../qquickflickable/data/nestedStopAtBounds.qml | 37 +++++++++++ .../quick/qquickflickable/tst_qquickflickable.cpp | 71 ++++++++++++++++++++++ .../quick/qquickgridview/tst_qquickgridview.cpp | 12 ++-- .../quick/qquickmousearea/tst_qquickmousearea.cpp | 4 +- 4 files changed, 116 insertions(+), 8 deletions(-) create mode 100644 tests/auto/quick/qquickflickable/data/nestedStopAtBounds.qml (limited to 'tests/auto') diff --git a/tests/auto/quick/qquickflickable/data/nestedStopAtBounds.qml b/tests/auto/quick/qquickflickable/data/nestedStopAtBounds.qml new file mode 100644 index 0000000000..59318e5b95 --- /dev/null +++ b/tests/auto/quick/qquickflickable/data/nestedStopAtBounds.qml @@ -0,0 +1,37 @@ +import QtQuick 2.0 + +Flickable { + id: outer + objectName: "outerFlickable" + width: 400 + height: 400 + contentX: 50 + contentY: 50 + contentWidth: 500 + contentHeight: 500 + flickableDirection: inner.flickableDirection + + Rectangle { + x: 100 + y: 100 + width: 300 + height: 300 + + color: "yellow" + Flickable { + id: inner + objectName: "innerFlickable" + anchors.fill: parent + contentX: 100 + contentY: 100 + contentWidth: 400 + contentHeight: 400 + boundsBehavior: Flickable.StopAtBounds + Rectangle { + anchors.fill: parent + anchors.margins: 100 + color: "blue" + } + } + } +} diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index 784988b913..57c4c12264 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -91,6 +91,8 @@ private slots: void cancelOnMouseGrab(); void clickAndDragWhenTransformed(); void flickTwiceUsingTouches(); + void nestedStopAtBounds(); + void nestedStopAtBounds_data(); private: void flickWithTouch(QWindow *window, QTouchDevice *touchDevice); @@ -1311,6 +1313,75 @@ void tst_qquickflickable::flickWithTouch(QWindow *window, QTouchDevice *touchDev QTest::qWait(1); } +void tst_qquickflickable::nestedStopAtBounds_data() +{ + QTest::addColumn("transpose"); + QTest::addColumn("invert"); + + QTest::newRow("left") << false << false; + QTest::newRow("right") << false << true; + QTest::newRow("top") << true << false; + QTest::newRow("bottom") << true << true; +} + +void tst_qquickflickable::nestedStopAtBounds() +{ + QFETCH(bool, transpose); + QFETCH(bool, invert); + + QQuickView view; + view.setSource(testFileUrl("nestedStopAtBounds.qml")); + view.show(); + view.requestActivate(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); + QVERIFY(view.rootObject()); + + QQuickFlickable *outer = qobject_cast(view.rootObject()); + QVERIFY(outer); + + QQuickFlickable *inner = outer->findChild("innerFlickable"); + QVERIFY(inner); + inner->setFlickableDirection(transpose ? QQuickFlickable::VerticalFlick : QQuickFlickable::HorizontalFlick); + inner->setContentX(invert ? 0 : 100); + inner->setContentY(invert ? 0 : 100); + + const int threshold = qApp->styleHints()->startDragDistance(); + + QPoint position(200, 200); + int &axis = transpose ? position.ry() : position.rx(); + + // drag toward the aligned boundary. Outer flickable dragged. + QTest::mousePress(&view, Qt::LeftButton, 0, position); + QTest::qWait(10); + axis += invert ? threshold * 2 : -threshold * 2; + QTest::mouseMove(&view, position); + axis += invert ? threshold : -threshold; + QTest::mouseMove(&view, position); + QCOMPARE(outer->isDragging(), true); + QCOMPARE(inner->isDragging(), false); + QTest::mouseRelease(&view, Qt::LeftButton, 0, position); + + QVERIFY(!outer->isDragging()); + QTRY_VERIFY(!outer->isMoving()); + + axis = 200; + outer->setContentX(50); + outer->setContentY(50); + + // drag away from the aligned boundary. Inner flickable dragged. + QTest::mousePress(&view, Qt::LeftButton, 0, position); + QTest::qWait(10); + axis += invert ? -threshold * 2 : threshold * 2; + QTest::mouseMove(&view, position); + axis += invert ? -threshold : threshold; + QTest::mouseMove(&view, position); + QCOMPARE(outer->isDragging(), false); + QCOMPARE(inner->isDragging(), true); + QTest::mouseRelease(&view, Qt::LeftButton, 0, position); + + QTRY_VERIFY(!outer->isMoving()); +} + QTEST_MAIN(tst_qquickflickable) #include "tst_qquickflickable.moc" diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp index 802cc0a4c9..3c30f9e887 100644 --- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp @@ -4308,22 +4308,22 @@ void tst_QQuickGridView::snapOneRow_data() QTest::addColumn("startExtent"); QTest::newRow("vertical, left to right") << QQuickGridView::FlowLeftToRight << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) - << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 240.0 << 0.0; + << QPoint(20, 160) << QPoint(20, 20) << 100.0 << 240.0 << 0.0; QTest::newRow("horizontal, left to right") << QQuickGridView::FlowTopToBottom << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) - << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 240.0 << 0.0; + << QPoint(160, 20) << QPoint(20, 20) << 100.0 << 240.0 << 0.0; QTest::newRow("horizontal, right to left") << QQuickGridView::FlowTopToBottom << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange) - << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -240.0 - 240.0 << -240.0; + << QPoint(20, 20) << QPoint(160, 20) << -340.0 << -240.0 - 240.0 << -240.0; QTest::newRow("vertical, left to right, enforce range") << QQuickGridView::FlowLeftToRight << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(20, 200) << QPoint(20, 20) << 100.0 << 340.0 << -20.0; + << QPoint(20, 160) << QPoint(20, 20) << 100.0 << 340.0 << -20.0; QTest::newRow("horizontal, left to right, enforce range") << QQuickGridView::FlowTopToBottom << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(200, 20) << QPoint(20, 20) << 100.0 << 340.0 << -20.0; + << QPoint(160, 20) << QPoint(20, 20) << 100.0 << 340.0 << -20.0; QTest::newRow("horizontal, right to left, enforce range") << QQuickGridView::FlowTopToBottom << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange) - << QPoint(20, 20) << QPoint(200, 20) << -340.0 << -240.0 - 240.0 - 100.0 << -220.0; + << QPoint(20, 20) << QPoint(160, 20) << -340.0 << -240.0 - 240.0 - 100.0 << -220.0; } void tst_QQuickGridView::snapOneRow() diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp index ef7dc72345..327abbebd5 100644 --- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp +++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp @@ -805,8 +805,8 @@ void tst_QQuickMouseArea::preventStealing() // Flickable content should have moved. - QCOMPARE(flickable->contentX(), 11.); - QCOMPARE(flickable->contentY(), 11.); + QCOMPARE(flickable->contentX(), 22.); + QCOMPARE(flickable->contentY(), 22.); QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 50)); -- cgit v1.2.3 From 523bf6c3d0076e43aee6747211f6e93005f2d1c6 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 21 Feb 2013 08:46:56 -0600 Subject: ListView's highlightMoveDuration should default to -1. Change-Id: Ibb53cc21b4f1f301569cd7724c60cb8df978921a Reviewed-by: Bea Lam --- tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 9fad01ef40..c034fe83c8 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -206,6 +206,7 @@ private slots: void destroyItemOnCreation(); void parentBinding(); + void defaultHighlightMoveDuration(); private: template void items(const QUrl &source, bool forceLayout); @@ -6801,6 +6802,18 @@ void tst_QQuickListView::parentBinding() delete window; } +void tst_QQuickListView::defaultHighlightMoveDuration() +{ + QQmlEngine engine; + QQmlComponent component(&engine); + component.setData("import QtQuick 2.0; ListView {}", QUrl::fromLocalFile("")); + + QObject *obj = component.create(); + QVERIFY(obj); + + QCOMPARE(obj->property("highlightMoveDuration").toInt(), -1); +} + QTEST_MAIN(tst_QQuickListView) #include "tst_qquicklistview.moc" -- cgit v1.2.3 From a496e0874858a4b7d991c179c0e12df46c3d324c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 22 Dec 2012 13:56:44 -0800 Subject: Fix warnings about shadowing members util/qqmlpropertymap.h:87:9: error: declaration of 'parent' shadows a member of 'this' [-Werror=shadow] [and others] Change-Id: I2ff1a3c133efe2132e74dad00596931a84a7f421 Reviewed-by: Alan Alpert --- tests/auto/headersclean/headersclean.pro | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/headersclean/headersclean.pro b/tests/auto/headersclean/headersclean.pro index 6d2f74a6bc..4457fe1c38 100644 --- a/tests/auto/headersclean/headersclean.pro +++ b/tests/auto/headersclean/headersclean.pro @@ -1,4 +1,2 @@ QT = qml quick qmltest qmldevtools load(qt_headersclean) -# shadowing problems in scenegraph, allow it for now -*-g++*: QMAKE_CXXFLAGS -= -Wshadow -- cgit v1.2.3