diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-09-22 04:30:54 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-09-22 04:30:54 (GMT) |
commit | 69ba43af52a42244805f866e5c2e0bb91dc6dec5 (patch) | |
tree | 1d5faa8efa984dcecb910a0e480a5f4cad42c58b | |
parent | 835a83221232d1963d4ab0b9e553cc32cb9bc8c9 (diff) | |
parent | 0598be4043f0f483f9d32040df57ffede322c038 (diff) | |
download | Qt-69ba43af52a42244805f866e5c2e0bb91dc6dec5.zip Qt-69ba43af52a42244805f866e5c2e0bb91dc6dec5.tar.gz Qt-69ba43af52a42244805f866e5c2e0bb91dc6dec5.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
15 files changed, 68 insertions, 22 deletions
diff --git a/examples/declarative/aspectratio/face_fit.qml b/examples/declarative/aspectratio/face_fit.qml index 4573160..8d38cca 100644 --- a/examples/declarative/aspectratio/face_fit.qml +++ b/examples/declarative/aspectratio/face_fit.qml @@ -8,13 +8,13 @@ import Qt 4.6 // Rectangle { // default size: whole image, unscaled - width: Image.width - height: Image.height + width: Face.width + height: Face.height color: "gray" clip: true Image { - id: Image + id: Face source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/face_fit_animated.qml b/examples/declarative/aspectratio/face_fit_animated.qml index 7db1c80..7d73900 100644 --- a/examples/declarative/aspectratio/face_fit_animated.qml +++ b/examples/declarative/aspectratio/face_fit_animated.qml @@ -6,13 +6,13 @@ import Qt 4.6 // Rectangle { // default size: whole image, unscaled - width: Image.width - height: Image.height + width: Face.width + height: Face.height color: "gray" clip: true Image { - id: Image + id: Face source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/scale_and_crop.qml b/examples/declarative/aspectratio/scale_and_crop.qml index 75080b4..3cace8d 100644 --- a/examples/declarative/aspectratio/scale_and_crop.qml +++ b/examples/declarative/aspectratio/scale_and_crop.qml @@ -4,13 +4,13 @@ import Qt 4.6 // Rectangle { // default size: whole image, unscaled - width: Image.width - height: Image.height + width: Face.width + height: Face.height color: "gray" clip: true Image { - id: Image + id: Face source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/scale_and_crop_simple.qml b/examples/declarative/aspectratio/scale_and_crop_simple.qml new file mode 100644 index 0000000..26758e6 --- /dev/null +++ b/examples/declarative/aspectratio/scale_and_crop_simple.qml @@ -0,0 +1,19 @@ +import Qt 4.6 + +// Here, we implement "Scale to Fit" behaviour, using the +// fillMode property. +// +Rectangle { + // default size: whole image, unscaled + width: Face.width + height: Face.height + color: "gray" + clip: true + + Image { + id: Face + source: "pics/face.png" + fillMode: "PreserveAspectCrop" + anchors.fill: parent + } +} diff --git a/examples/declarative/aspectratio/scale_and_sidecrop.qml b/examples/declarative/aspectratio/scale_and_sidecrop.qml index a6bd2c8..18cc110 100644 --- a/examples/declarative/aspectratio/scale_and_sidecrop.qml +++ b/examples/declarative/aspectratio/scale_and_sidecrop.qml @@ -5,13 +5,13 @@ import Qt 4.6 // Rectangle { // default size: whole image, unscaled - width: Image.width - height: Image.height + width: Face.width + height: Face.height color: "gray" clip: true Image { - id: Image + id: Face source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/scale_to_fit.qml b/examples/declarative/aspectratio/scale_to_fit.qml index 744abce..7450ea4 100644 --- a/examples/declarative/aspectratio/scale_to_fit.qml +++ b/examples/declarative/aspectratio/scale_to_fit.qml @@ -5,13 +5,13 @@ import Qt 4.6 // Rectangle { // default size: whole image, unscaled - width: Image.width - height: Image.height + width: Face.width + height: Face.height color: "gray" clip: true Image { - id: Image + id: Face source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/scale_to_fit_simple.qml b/examples/declarative/aspectratio/scale_to_fit_simple.qml index 4ee06ba..dcccd69 100644 --- a/examples/declarative/aspectratio/scale_to_fit_simple.qml +++ b/examples/declarative/aspectratio/scale_to_fit_simple.qml @@ -1,19 +1,19 @@ import Qt 4.6 // Here, we implement "Scale to Fit" behaviour, using the -// preserveAspect property. +// fillMode property. // Rectangle { // default size: whole image, unscaled - width: Image.width - height: Image.height + width: Face.width + height: Face.height color: "gray" clip: true Image { - id: Image + id: Face source: "pics/face.png" - fillMode: "PreserveAspect" + fillMode: "PreserveAspectFit" anchors.fill: parent } } diff --git a/examples/declarative/modules/local/Foo.qml b/examples/declarative/modules/local/Foo.qml new file mode 100644 index 0000000..6cb07d5 --- /dev/null +++ b/examples/declarative/modules/local/Foo.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Text { + text: "lib/Foo.qml" + color: "#00ff00" +} diff --git a/examples/declarative/modules/local/SubLib/Bar.qml b/examples/declarative/modules/local/SubLib/Bar.qml new file mode 100644 index 0000000..ad09d2e --- /dev/null +++ b/examples/declarative/modules/local/SubLib/Bar.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Text { + text: "lib/SubLib/Bar.qml" + color: "#8898FF" +} diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index c6edbe2..dd6b5a4 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1519,8 +1519,9 @@ public: bool found = false; foreach (QString p, importPath) { QString dir = p+QLatin1Char('/')+url; - if (QFile::exists(dir+QLatin1String("/qmldir"))) { - url = QLatin1String("file://")+dir; + QFileInfo fi(dir+QLatin1String("/qmldir")); + if (fi.isFile()) { + url = QUrl::fromLocalFile(fi.absolutePath()).toString(); found = true; break; } diff --git a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt b/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt new file mode 100644 index 0000000..2235cbc --- /dev/null +++ b/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.errors.txt @@ -0,0 +1 @@ +SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml b/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml new file mode 100644 index 0000000..23ed566 --- /dev/null +++ b/tests/auto/declarative/qmlparser/importVersionMissingBuiltIn.qml @@ -0,0 +1,7 @@ +import Test as S + +S.MyQmlObject { + property real x; + property real y; +} + diff --git a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt new file mode 100644 index 0000000..2235cbc --- /dev/null +++ b/tests/auto/declarative/qmlparser/importVersionMissingInstalled.errors.txt @@ -0,0 +1 @@ +SHOULD GIVE AN ERROR ABOUT MISSING VERSION diff --git a/tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml b/tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml new file mode 100644 index 0000000..97ec222 --- /dev/null +++ b/tests/auto/declarative/qmlparser/importVersionMissingInstalled.qml @@ -0,0 +1,3 @@ +import com.nokia.installedtest as T + +T.InstalledTest {} diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index b8bd0e7..ee1b072 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -160,6 +160,8 @@ void tst_qmlparser::errors_data() QTest::newRow("finalOverride") << "finalOverride.qml" << "finalOverride.errors.txt" << false; QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false; + QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false; + QTest::newRow("importVersionMissing (installed)") << "importVersionMissingInstalled.qml" << "importVersionMissingInstalled.errors.txt" << false; QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false; } |