diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-03-08 04:52:31 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-03-08 04:52:31 (GMT) |
commit | bea42565ae3b909b7e78731b58809cf400cb9694 (patch) | |
tree | acc8905fd8cefe80951a5c1fe3397f369834e833 | |
parent | ad7e15422be2ae2d3bbae75d0fa1dd99b302283d (diff) | |
parent | ef16993782b834cb34ed0281925ddfc49535e78b (diff) | |
download | Qt-bea42565ae3b909b7e78731b58809cf400cb9694.zip Qt-bea42565ae3b909b7e78731b58809cf400cb9694.tar.gz Qt-bea42565ae3b909b7e78731b58809cf400cb9694.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
36 files changed, 171 insertions, 109 deletions
diff --git a/demos/declarative/calculator/calculator.pro b/demos/declarative/calculator/calculator.pro deleted file mode 100644 index efe6413..0000000 --- a/demos/declarative/calculator/calculator.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE=app -CONFIG -= qt separate_debug_info -LIBS = -QT = -QMAKE_LINK = @: dummy - -sources.files = \ - CalcButton.qml \ - calculator.js \ - calculator.qml -sources.path = $$[QT_INSTALL_DEMOS]/declarative/calculator -INSTALLS = sources - diff --git a/demos/declarative/declarative.pro b/demos/declarative/declarative.pro index 037ad85..4d169e3 100644 --- a/demos/declarative/declarative.pro +++ b/demos/declarative/declarative.pro @@ -1,9 +1,17 @@ TEMPLATE = subdirs -SUBDIRS = calculator \ - flickr \ - minehunt \ - samegame \ - snake \ - twitter \ - webbrowser + +# These demos contain C++ and need to be compiled +SUBDIRS = \ + minehunt + +# These examples contain no C++ and can simply be copied +sources.files = \ + calculator \ + flickr \ + samegame \ + snake \ + twitter \ + webbrowser +sources.path = $$[QT_INSTALL_DEMOS]/declarative +INSTALLS += sources diff --git a/demos/declarative/flickr/flickr.pro b/demos/declarative/flickr/flickr.pro deleted file mode 100644 index c4c1d44..0000000 --- a/demos/declarative/flickr/flickr.pro +++ /dev/null @@ -1,16 +0,0 @@ -TEMPLATE=app -CONFIG -= qt separate_debug_info -LIBS = -QT = -QMAKE_LINK = @: dummy - -sources.files = \ - flickr-desktop.qml \ - flickr-mobile-90.qml \ - flickr-mobile.qml \ - common \ - mobile - -sources.path = $$[QT_INSTALL_DEMOS]/declarative/flickr -INSTALLS = sources - diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro index 2f9a8ad..2df33e6 100644 --- a/demos/declarative/minehunt/minehunt.pro +++ b/demos/declarative/minehunt/minehunt.pro @@ -10,7 +10,7 @@ DESTDIR = MinehuntCore SOURCES += minehunt.cpp -sources.files = minehunt.qml +sources.files = minehunt.qml minehunt.pro sources.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt target.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt/MinehuntCore diff --git a/demos/declarative/snake/snake.pro b/demos/declarative/snake/snake.pro deleted file mode 100644 index a206fd4..0000000 --- a/demos/declarative/snake/snake.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE=app -CONFIG -= qt separate_debug_info -LIBS = -QT = -QMAKE_LINK = @: dummy - -sources.files = \ - content \ - snake.qml - -sources.path = $$[QT_INSTALL_DEMOS]/declarative/snake -INSTALLS = sources - diff --git a/demos/declarative/twitter/twitter.pro b/demos/declarative/twitter/twitter.pro deleted file mode 100644 index e1dd821..0000000 --- a/demos/declarative/twitter/twitter.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE=app -CONFIG -= qt separate_debug_info -LIBS = -QT = -QMAKE_LINK = @: dummy - -sources.files = \ - TwitterCore \ - twitter.qml - -sources.path = $$[QT_INSTALL_DEMOS]/declarative/twitter -INSTALLS = sources - diff --git a/demos/declarative/webbrowser/webbrowser.pro b/demos/declarative/webbrowser/webbrowser.pro deleted file mode 100644 index c033ef9..0000000 --- a/demos/declarative/webbrowser/webbrowser.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE=app -CONFIG -= qt separate_debug_info -LIBS = -QT = -QMAKE_LINK = @: dummy - -sources.files = \ - content \ - webbrowser.qml - -sources.path = $$[QT_INSTALL_DEMOS]/declarative/webbrowser -INSTALLS = sources - diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro new file mode 100644 index 0000000..b8c0200 --- /dev/null +++ b/examples/declarative/declarative.pro @@ -0,0 +1,48 @@ +TEMPLATE = subdirs + +# These examples contain some C++ and need to be built +SUBDIRS = \ + extending \ + imageprovider \ + objectlistmodel \ + plugins + +# These examples contain no C++ and can simply be copied +sources.files = \ + animations \ + aspectratio \ + behaviours \ + border-image \ + clocks \ + colorbrowser \ + connections \ + dial \ + dynamic \ + effects \ + fillmode \ + focusscope \ + fonts \ + gridview \ + layouts \ + listview \ + mousearea \ + package \ + parallax \ + progressbar \ + scrollbar \ + searchbox \ + slideswitch \ + sql \ + states \ + tabwidget \ + tic-tac-toe \ + tutorials \ + tvtennis \ + velocity \ + webview \ + workerlistmodel \ + workerscript \ + xmldata \ + xmlhttprequest +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative +INSTALLS += sources diff --git a/examples/declarative/extending/adding/adding.pro b/examples/declarative/extending/adding/adding.pro index c02a35f..6072de4 100644 --- a/examples/declarative/extending/adding/adding.pro +++ b/examples/declarative/extending/adding/adding.pro @@ -9,3 +9,7 @@ SOURCES += main.cpp \ person.cpp HEADERS += person.h RESOURCES += adding.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/adding +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS adding.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/adding +INSTALLS += target sources diff --git a/examples/declarative/extending/attached/attached.pro b/examples/declarative/extending/attached/attached.pro index b0f3fea..f6d76ed 100644 --- a/examples/declarative/extending/attached/attached.pro +++ b/examples/declarative/extending/attached/attached.pro @@ -11,3 +11,7 @@ SOURCES += main.cpp \ HEADERS += person.h \ birthdayparty.h RESOURCES += attached.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/attached +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS attached.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/attached +INSTALLS += target sources diff --git a/examples/declarative/extending/binding/binding.pro b/examples/declarative/extending/binding/binding.pro index 8298565..903712e 100644 --- a/examples/declarative/extending/binding/binding.pro +++ b/examples/declarative/extending/binding/binding.pro @@ -13,3 +13,7 @@ HEADERS += person.h \ birthdayparty.h \ happybirthday.h RESOURCES += binding.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/binding +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS binding.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/binding +INSTALLS += target sources diff --git a/examples/declarative/extending/coercion/coercion.pro b/examples/declarative/extending/coercion/coercion.pro index 136b210..c8daed8 100644 --- a/examples/declarative/extending/coercion/coercion.pro +++ b/examples/declarative/extending/coercion/coercion.pro @@ -11,3 +11,7 @@ SOURCES += main.cpp \ HEADERS += person.h \ birthdayparty.h RESOURCES += coercion.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/coercion +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS coercion.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/coercion +INSTALLS += target sources diff --git a/examples/declarative/extending/default/default.pro b/examples/declarative/extending/default/default.pro index 0d5d45c..32aff0b 100644 --- a/examples/declarative/extending/default/default.pro +++ b/examples/declarative/extending/default/default.pro @@ -11,3 +11,7 @@ SOURCES += main.cpp \ HEADERS += person.h \ birthdayparty.h RESOURCES += default.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/default +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS default.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/default +INSTALLS += target sources diff --git a/examples/declarative/extending/extended/extended.pro b/examples/declarative/extending/extended/extended.pro index 1182226..97af286 100644 --- a/examples/declarative/extending/extended/extended.pro +++ b/examples/declarative/extending/extended/extended.pro @@ -9,3 +9,7 @@ SOURCES += main.cpp \ lineedit.cpp HEADERS += lineedit.h RESOURCES += extended.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/extended +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS extended.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/extended +INSTALLS += target sources diff --git a/examples/declarative/extending/grouped/grouped.pro b/examples/declarative/extending/grouped/grouped.pro index 8fde8e8..576e1d2 100644 --- a/examples/declarative/extending/grouped/grouped.pro +++ b/examples/declarative/extending/grouped/grouped.pro @@ -11,3 +11,7 @@ SOURCES += main.cpp \ HEADERS += person.h \ birthdayparty.h RESOURCES += grouped.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/grouped +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS grouped.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/grouped +INSTALLS += target sources diff --git a/examples/declarative/extending/properties/properties.pro b/examples/declarative/extending/properties/properties.pro index 6355644..a8f4301 100644 --- a/examples/declarative/extending/properties/properties.pro +++ b/examples/declarative/extending/properties/properties.pro @@ -11,3 +11,8 @@ SOURCES += main.cpp \ HEADERS += person.h \ birthdayparty.h RESOURCES += properties.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/properties +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS properties.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/properties +INSTALLS += target sources diff --git a/examples/declarative/extending/signal/signal.pro b/examples/declarative/extending/signal/signal.pro index 30e413f..6367a38 100644 --- a/examples/declarative/extending/signal/signal.pro +++ b/examples/declarative/extending/signal/signal.pro @@ -11,3 +11,7 @@ SOURCES += main.cpp \ HEADERS += person.h \ birthdayparty.h RESOURCES += signal.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/signal +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS signal.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/signal +INSTALLS += target sources diff --git a/examples/declarative/extending/valuesource/valuesource.pro b/examples/declarative/extending/valuesource/valuesource.pro index 9e54448..d3409b6 100644 --- a/examples/declarative/extending/valuesource/valuesource.pro +++ b/examples/declarative/extending/valuesource/valuesource.pro @@ -13,3 +13,7 @@ HEADERS += person.h \ birthdayparty.h \ happybirthday.h RESOURCES += valuesource.qrc +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/valuesource +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS valuesource.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/extending/valuesource +INSTALLS += target sources diff --git a/examples/declarative/imageprovider/imageprovider.pro b/examples/declarative/imageprovider/imageprovider.pro index e403bf8..86dbcca 100644 --- a/examples/declarative/imageprovider/imageprovider.pro +++ b/examples/declarative/imageprovider/imageprovider.pro @@ -9,3 +9,13 @@ DESTDIR = ImageProviderCore # Input SOURCES += imageprovider.cpp +sources.files = $$SOURCES imageprovider.qml imageprovider.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/imageprovider + +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/imageprovider/ImageProviderCore + +ImageProviderCore_sources.files = \ + ImageProviderCore/qmldir +ImageProviderCore_sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/imageprovider/ImageProviderCore + +INSTALLS = sources ImageProviderCore_sources target diff --git a/examples/declarative/objectlistmodel/objectlistmodel.pro b/examples/declarative/objectlistmodel/objectlistmodel.pro index ca61e4c..869cde3 100644 --- a/examples/declarative/objectlistmodel/objectlistmodel.pro +++ b/examples/declarative/objectlistmodel/objectlistmodel.pro @@ -9,3 +9,10 @@ SOURCES += main.cpp \ dataobject.cpp HEADERS += dataobject.h RESOURCES += objectlistmodel.qrc + +sources.files = $$SOURCES $$HEADERS $$RESOURCES objectlistmodel.pro view.qml +sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/objectlistmodel +target.path = $$[QT_INSTALL_EXAMPLES]/declarative/objectlistmodel + +INSTALLS += sources target + diff --git a/examples/declarative/plugins/plugins.pro b/examples/declarative/plugins/plugins.pro index c925cea..877a5ce 100644 --- a/examples/declarative/plugins/plugins.pro +++ b/examples/declarative/plugins/plugins.pro @@ -17,7 +17,7 @@ qdeclarativesources.files += \ qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins/com/nokia/TimeExample -sources.files += plugins.pro plugin.cpp plugins.qml +sources.files += plugins.pro plugin.cpp plugins.qml README sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins target.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins/com/nokia/TimeExample diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 3c6c949..ef1032b 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -2204,6 +2204,8 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj) if (propNames.contains(prop.name)) COMPILE_EXCEPTION(&prop, QCoreApplication::translate("QDeclarativeCompiler","Duplicate property name")); + if (QString::fromUtf8(prop.name).at(0).isUpper()) + COMPILE_EXCEPTION(&prop, QCoreApplication::translate("QDeclarativeCompiler","Property names cannot begin with an upper case letter")); propNames.insert(prop.name); } @@ -2211,12 +2213,16 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj) QByteArray name = obj->dynamicSignals.at(ii).name; if (methodNames.contains(name)) COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Duplicate signal name")); + if (QString::fromUtf8(name).at(0).isUpper()) + COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Signal names cannot begin with an upper case letter")); methodNames.insert(name); } for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) { QByteArray name = obj->dynamicSlots.at(ii).name; if (methodNames.contains(name)) COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Duplicate method name")); + if (QString::fromUtf8(name).at(0).isUpper()) + COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Method names cannot begin with an upper case letter")); methodNames.insert(name); } diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 1e60df4..41d55d7 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1234,17 +1234,13 @@ QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine else if (a == 0x00) finalColor = color; else { - uint src = tintColor.rgba(); - uint dest = color.rgba(); + qreal a = tintColor.alphaF(); + qreal inv_a = 1.0 - a; - uint res = (((a * (src & 0xFF00FF)) + - ((0xFF - a) * (dest & 0xFF00FF))) >> 8) & 0xFF00FF; - res |= (((a * ((src >> 8) & 0xFF00FF)) + - ((0xFF - a) * ((dest >> 8) & 0xFF00FF)))) & 0xFF00FF00; - if ((src & 0xFF000000) == 0xFF000000) - res |= 0xFF000000; - - finalColor = QColor::fromRgba(res); + finalColor.setRgbF(tintColor.redF() * a + color.redF() * inv_a, + tintColor.greenF() * a + color.greenF() * inv_a, + tintColor.blueF() * a + color.blueF() * inv_a, + a + inv_a * color.alphaF()); } return qScriptValueFromValue(engine, qVariantFromValue(finalColor)); diff --git a/tests/auto/declarative/qdeclarativelanguage/data/method.1.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/method.1.errors.txt new file mode 100644 index 0000000..b10984f --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/method.1.errors.txt @@ -0,0 +1 @@ +3:1:Method names cannot begin with an upper case letter diff --git a/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml new file mode 100644 index 0000000..d9794b4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/method.1.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +QtObject { + function MyMethod() {} +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.6.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.6.errors.txt new file mode 100644 index 0000000..9e8d454 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.6.errors.txt @@ -0,0 +1 @@ +4:5:Property names cannot begin with an upper case letter diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml new file mode 100644 index 0000000..f39bed3 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.6.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +QtObject { + property int Hello +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.7.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/property.7.errors.txt new file mode 100644 index 0000000..9e8d454 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.7.errors.txt @@ -0,0 +1 @@ +4:5:Property names cannot begin with an upper case letter diff --git a/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml b/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml new file mode 100644 index 0000000..502eb22 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/property.7.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +QtObject { + property int Hello: 10 +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.errors.txt new file mode 100644 index 0000000..d96f9e3 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.errors.txt @@ -0,0 +1 @@ +3:1:Signal names cannot begin with an upper case letter diff --git a/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml new file mode 100644 index 0000000..7279a46 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +QtObject { + signal MySignal +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index da0bf1a..083c551 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -269,12 +269,17 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("signal.1") << "signal.1.qml" << "signal.1.errors.txt" << false; QTest::newRow("signal.2") << "signal.2.qml" << "signal.2.errors.txt" << false; QTest::newRow("signal.3") << "signal.3.qml" << "signal.3.errors.txt" << false; + QTest::newRow("signal.4") << "signal.4.qml" << "signal.4.errors.txt" << false; + + QTest::newRow("method.1") << "method.1.qml" << "method.1.errors.txt" << false; QTest::newRow("property.1") << "property.1.qml" << "property.1.errors.txt" << false; QTest::newRow("property.2") << "property.2.qml" << "property.2.errors.txt" << false; QTest::newRow("property.3") << "property.3.qml" << "property.3.errors.txt" << false; QTest::newRow("property.4") << "property.4.qml" << "property.4.errors.txt" << false; QTest::newRow("property.5") << "property.5.qml" << "property.5.errors.txt" << false; + QTest::newRow("property.6") << "property.6.qml" << "property.6.errors.txt" << false; + QTest::newRow("property.7") << "property.7.qml" << "property.7.errors.txt" << false; QTest::newRow("Script.1") << "script.1.qml" << "script.1.errors.txt" << false; QTest::newRow("Script.2") << "script.2.qml" << "script.2.errors.txt" << false; diff --git a/tests/auto/declarative/qdeclarativeqt/data/tint.qml b/tests/auto/declarative/qdeclarativeqt/data/tint.qml index da8afe2..478245f 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/tint.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/tint.qml @@ -3,7 +3,7 @@ import Qt 4.6 QtObject { property color test1: Qt.tint("red", "blue"); property color test2: Qt.tint(Qt.rgba(1, 0, 0), Qt.rgba(0, 0, 0, 0)); - property color test3: Qt.tint("red", Qt.rgba(0, 0, 1, 0.5)); // XXX - what should this be? + property color test3: Qt.tint("red", Qt.rgba(0, 0, 1, 0.5)); property color test4: Qt.tint("red", Qt.rgba(0, 0, 1, 0.5), 10); property color test5: Qt.tint("red") } diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 90afd4e..b70011b 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -254,8 +254,8 @@ void tst_qdeclarativeqt::tint() QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(0, 0, 1)); QCOMPARE(qvariant_cast<QColor>(object->property("test2")), QColor::fromRgbF(1, 0, 0)); - QEXPECT_FAIL("", "QT-2424",Continue); - QCOMPARE(qvariant_cast<QColor>(object->property("test3")), QColor::fromRgbF(1, 0, 0)); + QColor test3 = qvariant_cast<QColor>(object->property("test3")); + QCOMPARE(test3.rgba(), 0xFF7F0080); QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor()); diff --git a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro index 0543ff6..e2b31c7 100644 --- a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro +++ b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro @@ -1,6 +1,5 @@ load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -QT += script +contains(QT_CONFIG,declarative): QT += declarative script macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeworkerscript.cpp diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp index 9adbc28..fe2dac2 100644 --- a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp +++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp @@ -60,7 +60,6 @@ public: tst_QDeclarativeWorkerScript() {} private slots: void source(); - void source_data(); void messaging(); void messaging_data(); void messaging_sendQObjectList(); @@ -83,13 +82,7 @@ private: void tst_QDeclarativeWorkerScript::source() { - QFETCH(QUrl, source); - QFETCH(bool, valid); - - if (!valid) { - QByteArray w = "WorkerScript: Cannot find source file \"" + source.toString().toUtf8() + "\""; - QTest::ignoreMessage(QtWarningMsg, w.constData()); - } + QUrl source = QUrl::fromLocalFile(SRCDIR "/data/worker.qml"); QDeclarativeComponent component(&m_engine); component.setData("import Qt 4.6\nWorkerScript { source: '" + source.toString().toUtf8() + "'; }", QUrl()); @@ -103,15 +96,6 @@ void tst_QDeclarativeWorkerScript::source() delete item; } -void tst_QDeclarativeWorkerScript::source_data() -{ - QTest::addColumn<QUrl>("source"); - QTest::addColumn<bool>("valid"); - - QTest::newRow("valid") << QUrl::fromLocalFile(SRCDIR "/data/worker.qml") << true; - QTest::newRow("invalid") << QUrl::fromLocalFile("asdjfk.js") << false; -} - void tst_QDeclarativeWorkerScript::messaging() { QFETCH(QVariant, value); |