diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-03-26 04:37:28 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-03-26 04:37:28 (GMT) |
commit | ca90afcf32d9ba083b34f5cef3c7bde6300844f4 (patch) | |
tree | e4833fd2340009f15ba1bb1ed5bd09421e5ea067 /tests/auto | |
parent | 09a40e13174b9f34007ce9fbd98e06b4e48c1954 (diff) | |
parent | 33f7ae1c2edf7c414a5f8b3af79c9529718c29b1 (diff) | |
download | Qt-ca90afcf32d9ba083b34f5cef3c7bde6300844f4.zip Qt-ca90afcf32d9ba083b34f5cef3c7bde6300844f4.tar.gz Qt-ca90afcf32d9ba083b34f5cef3c7bde6300844f4.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto')
6 files changed, 27 insertions, 8 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml b/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml new file mode 100644 index 0000000..0dc404b --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml @@ -0,0 +1,7 @@ +import Qt.test 1.0 + +MyQmlObject{ + id: obj + objectName: "obj" + regExp: /[a-zA-z]/ +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h index 72dc3bb..faad8b7 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h +++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h @@ -90,6 +90,7 @@ class MyQmlObject : public QObject Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged) Q_PROPERTY(QDeclarativeListProperty<QObject> objectListProperty READ objectListProperty CONSTANT) Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty) + Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp) public: MyQmlObject(): m_methodCalled(false), m_methodIntCalled(false), m_object(0), m_value(0), m_resetProperty(13) {} @@ -138,6 +139,9 @@ public: void setResettableProperty(int v) { m_resetProperty = v; } void resetProperty() { m_resetProperty = 13; } + QRegExp regExp() { return m_regExp; } + void setRegExp(const QRegExp ®Exp) { m_regExp = regExp; } + signals: void basicSignal(); void argumentSignal(int a, QString b, qreal c); @@ -162,6 +166,7 @@ private: QList<QObject *> m_objectQList; int m_value; int m_resetProperty; + QRegExp m_regExp; }; QML_DECLARE_TYPEINFO(MyQmlObject, QML_HAS_ATTACHED_PROPERTIES) diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 87d73a0..041fd4d 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -131,6 +131,7 @@ private slots: void bug1(); void dynamicCreationCrash(); + void regExpBug(); void callQtInvokables(); private: @@ -1241,6 +1242,16 @@ void tst_qdeclarativeecmascript::dynamicCreationCrash() QVERIFY(created == 0); } +//QTBUG-9367 +void tst_qdeclarativeecmascript::regExpBug() +{ + QDeclarativeComponent component(&engine, TEST_FILE("regExp.qml")); + MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create()); + QVERIFY(object != 0); + QEXPECT_FAIL("", "QTBUG-9367", Continue); + QCOMPARE(object->regExp().pattern(), QLatin1String("[a-zA-z]")); +} + void tst_qdeclarativeecmascript::callQtInvokables() { MyInvokableObject o; diff --git a/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml b/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml index 1c1b3f8..cc64c3f 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml @@ -85,12 +85,10 @@ Rectangle { } color: ListView.isCurrentItem ? "lightsteelblue" : "white" ListView.onRemove: SequentialAnimation { - ScriptAction { script: console.log("Fix PropertyAction with attached properties") } -/* PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } -*/ + } } }, diff --git a/tests/auto/declarative/qdeclarativetextinput/data/validators.qml b/tests/auto/declarative/qdeclarativetextinput/data/validators.qml index 0c81548..efe7570 100644 --- a/tests/auto/declarative/qdeclarativetextinput/data/validators.qml +++ b/tests/auto/declarative/qdeclarativetextinput/data/validators.qml @@ -9,14 +9,13 @@ Item { Column{ TextInput { id: intInput; - validator: QIntValidator{top: 11; bottom: 2} + validator: IntValidator{top: 11; bottom: 2} } TextInput { id: dblInput; - validator: QDoubleValidator{top: 12.12; bottom: 2.93; decimals: 2; notation: QDoubleValidator.StandardNotation} + validator: DoubleValidator{top: 12.12; bottom: 2.93; decimals: 2; notation: DoubleValidator.StandardNotation} } TextInput { id: strInput; - //Requires QTBUG-8025 to be implemented first - //validator: QRegExpValidator { regExp: /[a-zA-z]{2,4}/;} + validator: RegExpValidator { regExp: RegExp(/[a-zA-z]{2,4}/) } } } diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index febcec3..84e7182 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -463,7 +463,6 @@ void tst_qdeclarativetextinput::validators() QVERIFY(strInput->hasFocus() == true); QTest::keyPress(canvas, Qt::Key_1); QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10); - QEXPECT_FAIL("","Will not work until QTBUG-8025 is resolved", Abort); QCOMPARE(strInput->text(), QLatin1String("")); QCOMPARE(strInput->hasAcceptableInput(), false); QTest::keyPress(canvas, Qt::Key_A); |