From 1dc40aa28ee93ee067c18349dc54e7b8b4f4dc4f Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 25 Mar 2010 15:55:30 +1000 Subject: Add Symbian deploy section for qml import plugins Task-number: QTBUG-9364 Reviewed-by: jbarron --- demos/declarative/minehunt/minehunt.pro | 15 +++++++++++++++ mkspecs/features/symbian/data_caging_paths.prf | 1 + src/imports/multimedia/multimedia.pro | 11 +++++++++++ src/imports/particles/particles.pro | 11 +++++++++++ src/imports/webkit/webkit.pro | 11 +++++++++++ src/imports/widgets/widgets.pro | 11 +++++++++++ 6 files changed, 60 insertions(+) diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro index 2df33e6..03059c7 100644 --- a/demos/declarative/minehunt/minehunt.pro +++ b/demos/declarative/minehunt/minehunt.pro @@ -23,3 +23,18 @@ MinehuntCore_sources.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt/MinehuntCo INSTALLS = sources MinehuntCore_sources target +symbian:{ + load(data_caging_paths) + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + + importFiles.sources = minehunt.dll \ + MinehuntCore/Explosion.qml \ + MinehuntCore/pics \ + MinehuntCore/qmldir + importFiles.path = $$QT_IMPORTS_BASE_DIR/MinehuntCore + DEPLOYMENT = importFiles +} + +INSTALLS = sources MinehuntCore_sources target diff --git a/mkspecs/features/symbian/data_caging_paths.prf b/mkspecs/features/symbian/data_caging_paths.prf index 6f40bb5..ae9bc09 100644 --- a/mkspecs/features/symbian/data_caging_paths.prf +++ b/mkspecs/features/symbian/data_caging_paths.prf @@ -75,6 +75,7 @@ exists($${EPOCROOT}epoc32/include/data_caging_paths.prf) { } isEmpty(QT_PLUGINS_BASE_DIR): QT_PLUGINS_BASE_DIR = /$$RESOURCE_FILES_DIR/qt$${QT_LIBINFIX}/plugins +isEmpty(QT_IMPORTS_BASE_DIR): QT_IMPORTS_BASE_DIR = /$$RESOURCE_FILES_DIR/qt/imports isEmpty(HW_ZDIR): HW_ZDIR = epoc32/data/z isEmpty(REG_RESOURCE_DIR): REG_RESOURCE_DIR = /private/10003a3f/apps isEmpty(REG_RESOURCE_IMPORT_DIR): REG_RESOURCE_IMPORT_DIR = /private/10003a3f/import/apps \ No newline at end of file diff --git a/src/imports/multimedia/multimedia.pro b/src/imports/multimedia/multimedia.pro index 16b3ace..8792e2b 100644 --- a/src/imports/multimedia/multimedia.pro +++ b/src/imports/multimedia/multimedia.pro @@ -23,4 +23,15 @@ target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH +symbian:{ + load(data_caging_paths) + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + + importFiles.sources = multimedia.dll \ + qmldir + importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH + + DEPLOYMENT = importFiles +} + INSTALLS += target qmldir diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro index 02d9ea6..53d9c24 100644 --- a/src/imports/particles/particles.pro +++ b/src/imports/particles/particles.pro @@ -17,4 +17,15 @@ target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH +symbian:{ + load(data_caging_paths) + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + + importFiles.sources = particles.dll \ + qmldir + importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH + + DEPLOYMENT = importFiles +} + INSTALLS += target qmldir diff --git a/src/imports/webkit/webkit.pro b/src/imports/webkit/webkit.pro index ef08efe..a11f87f 100644 --- a/src/imports/webkit/webkit.pro +++ b/src/imports/webkit/webkit.pro @@ -14,4 +14,15 @@ target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH +symbian:{ + load(data_caging_paths) + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + + importFiles.sources = webkitqmlplugin.dll \ + qmldir + importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH + + DEPLOYMENT = importFiles +} + INSTALLS += target qmldir diff --git a/src/imports/widgets/widgets.pro b/src/imports/widgets/widgets.pro index aa09b3c..bf2576d 100644 --- a/src/imports/widgets/widgets.pro +++ b/src/imports/widgets/widgets.pro @@ -18,4 +18,15 @@ target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH qmldir.files += $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH +symbian:{ + load(data_caging_paths) + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + + importFiles.sources = widgets.dll \ + qmldir + importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH + + DEPLOYMENT = importFiles +} + INSTALLS += target qmldir -- cgit v0.12 From 2fff42f7fa4a38e8f5b709493562a81b75762da6 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 25 Mar 2010 18:06:19 +1000 Subject: Add declarative subdir to examples.pro Task-number: Reviewed-by: Martin Jones --- examples/examples.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/examples.pro b/examples/examples.pro index ec5cc5f9..b046167 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -57,6 +57,7 @@ embedded:SUBDIRS += qws contains(QT_CONFIG, opengl): SUBDIRS += opengl contains(QT_CONFIG, openvg): SUBDIRS += openvg contains(QT_CONFIG, dbus): SUBDIRS += dbus +contains(QT_CONFIG, declarative): SUBDIRS += declarative win32: SUBDIRS += activeqt contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows -- cgit v0.12 From 4e5b463542385f4f4b3fc640926988dfb949ce54 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 26 Mar 2010 11:08:38 +1000 Subject: Really fix qMin() parameter types. --- src/declarative/graphicsitems/qdeclarativepathview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index c98b006..783387c 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -772,7 +772,7 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *) qreal v2 = velocity*velocity; qreal accel = d->deceleration; // + 0.25 to encourage moving at least one item in the flick direction - qreal dist = qMin(qreal(d->model->count()-1), qreal(d->model->count()) * v2 / (accel * 2.0) + 0.25); + qreal dist = qMin(qreal(d->model->count()-1), qreal(qreal(d->model->count()) * v2 / (accel * 2.0) + 0.25)); // round to nearest item. if (velocity > 0.) dist = qRound(dist + d->offset) - d->offset; -- cgit v0.12 From 47c0d01115aebd4cbad3ceca463c74411eeef9f9 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 26 Mar 2010 11:25:20 +1000 Subject: Remove Q prefix from the validators. --- src/declarative/QmlChanges.txt | 1 + .../graphicsitems/qdeclarativeitemsmodule.cpp | 6 +++--- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 17 +++++++++-------- .../qdeclarativetextinput/data/validators.qml | 7 +++---- .../qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 1 - 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 9a55bde..d35a4c2 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -1,6 +1,7 @@ ============================================================================= The changes below are pre Qt 4.7.0 beta +Removed Q-prefix from validators (IntValidator, DoubleValidator, and RegExpValidator) PathView: offset property now uses range 0-1.0 rather than 0-100 ListView, GridView::positionViewAtIndex() gained a 'mode' parameter Removed Qt.playSound (replaced by SoundEffect element) diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index 07d7f4d..f422365 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -114,10 +114,10 @@ void QDeclarativeItemModule::defineModule() qmlRegisterType("Qt",4,6,"PathPercent"); qmlRegisterType("Qt",4,6,"PathQuad"); qmlRegisterType("Qt",4,6,"PathView"); - qmlRegisterType("Qt",4,6,"QIntValidator"); + qmlRegisterType("Qt",4,6,"IntValidator"); #if (QT_VERSION >= QT_VERSION_CHECK(4,7,0)) - qmlRegisterType("Qt",4,7,"QDoubleValidator"); - qmlRegisterType("Qt",4,7,"QRegExpValidator"); + qmlRegisterType("Qt",4,7,"DoubleValidator"); + qmlRegisterType("Qt",4,7,"RegExpValidator"); #endif qmlRegisterType("Qt",4,6,"Rectangle"); qmlRegisterType("Qt",4,6,"Repeater"); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index b049728..f57ffc1 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -428,20 +428,21 @@ void QDeclarativeTextInput::setFocusOnPress(bool b) } /*! - \qmlproperty QValidator* TextInput::validator + \qmlproperty Validator TextInput::validator - Allows you to set a QValidator on the TextInput. When a validator is set + Allows you to set a validator on the TextInput. When a validator is set the TextInput will only accept input which leaves the text property in an acceptable or intermediate state. The accepted signal will only be sent if the text is in an acceptable state when enter is pressed. - Currently supported validators are QIntValidator, QDoubleValidator and - QRegExpValidator. For details, refer to their C++ documentation and remember + Currently supported validators are IntValidator, DoubleValidator and + RegExpValidator. For details, refer to their C++ documentation (QIntValidator, + QDoubleValidator, and QRegExpValidator) and remember that all Q_PROPERTIES are accessible from Qml. A brief usage guide follows: - QIntValidator and QDoubleValidator both are controllable through two properties, - top and bottom. The difference is that for QIntValidator the top and bottom properties - should be integers, and for QDoubleValidator they should be doubles. QRegExpValidator + IntValidator and DoubleValidator both are controllable through two properties, + top and bottom. The difference is that for IntValidator the top and bottom properties + should be integers, and for DoubleValidator they should be doubles. RegExpValidator has a single string property, regExp, which should be set to the regular expression to be used for validation. An example of using validators is shown below, which allows input of integers between 11 and 31 into the text input: @@ -449,7 +450,7 @@ void QDeclarativeTextInput::setFocusOnPress(bool b) \code import Qt 4.6 TextInput{ - validator: QIntValidator{bottom: 11; top: 31;} + validator: IntValidator{bottom: 11; top: 31;} focus: true } \endcode 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); -- cgit v0.12 From f096fb75c20b82e89e74bb48b7e82fcdfe3f06de Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 26 Mar 2010 12:22:01 +1000 Subject: Add autotest for QTBUG-9367. --- tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml | 7 +++++++ tests/auto/declarative/qdeclarativeecmascript/testtypes.h | 5 +++++ .../qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 11 +++++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml 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 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 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(component.create()); + QVERIFY(object != 0); + QEXPECT_FAIL("", "QTBUG-9367", Continue); + QCOMPARE(object->regExp().pattern(), QLatin1String("[a-zA-z]")); +} + void tst_qdeclarativeecmascript::callQtInvokables() { MyInvokableObject o; -- cgit v0.12 From 6da3b5b7e49c17cb7159eb9fd752abe45c1e2fac Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 26 Mar 2010 12:38:49 +1000 Subject: Update test. --- tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 } -*/ + } } }, -- cgit v0.12 From 33f7ae1c2edf7c414a5f8b3af79c9529718c29b1 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 26 Mar 2010 14:28:44 +1000 Subject: Do not call parent implementation if we accept the keyPressEvent in GridView and ListView delegates. --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 6 +++--- src/declarative/graphicsitems/qdeclarativelistview.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index de0cb04..17f74db 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1552,9 +1552,6 @@ qreal QDeclarativeGridView::maxXExtent() const void QDeclarativeGridView::keyPressEvent(QKeyEvent *event) { Q_D(QDeclarativeGridView); - QDeclarativeFlickable::keyPressEvent(event); - if (event->isAccepted()) - return; if (d->model && d->model->count() && d->interactive) { d->moveReason = QDeclarativeGridViewPrivate::SetIndex; int oldCurrent = currentIndex(); @@ -1580,6 +1577,9 @@ void QDeclarativeGridView::keyPressEvent(QKeyEvent *event) } } d->moveReason = QDeclarativeGridViewPrivate::Other; + QDeclarativeFlickable::keyPressEvent(event); + if (event->isAccepted()) + return; event->ignore(); } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 8a70c07..85fcc27 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -2124,9 +2124,6 @@ qreal QDeclarativeListView::maxXExtent() const void QDeclarativeListView::keyPressEvent(QKeyEvent *event) { Q_D(QDeclarativeListView); - QDeclarativeFlickable::keyPressEvent(event); - if (event->isAccepted()) - return; if (d->model && d->model->count() && d->interactive) { if ((d->orient == QDeclarativeListView::Horizontal && event->key() == Qt::Key_Left) @@ -2151,6 +2148,9 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event) } } } + QDeclarativeFlickable::keyPressEvent(event); + if (event->isAccepted()) + return; event->ignore(); } -- cgit v0.12