From 06fbba775078def95f28139483f8645a00941fe5 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 24 May 2010 15:14:41 +1000 Subject: Fix visual tests after rename of the qml executable. --- tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp index f105692..71dc451 100644 --- a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp +++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp @@ -81,11 +81,11 @@ QString tst_qmlvisual::viewer() QString qmlruntime; #if defined(Q_WS_MAC) - qmlruntime = QDir(binaries).absoluteFilePath("qml.app/Contents/MacOS/qml"); + qmlruntime = QDir(binaries).absoluteFilePath("QMLViewer.app/Contents/MacOS/QMLViewer"); #elif defined(Q_WS_WIN) || defined(Q_WS_S60) - qmlruntime = QDir(binaries).absoluteFilePath("qml.exe"); + qmlruntime = QDir(binaries).absoluteFilePath("qmlviewer.exe"); #else - qmlruntime = QDir(binaries).absoluteFilePath("qml"); + qmlruntime = QDir(binaries).absoluteFilePath("qmlviewer"); #endif return qmlruntime; -- cgit v0.12 From 8cc8faa6d989b8eb7cd4e78b4a51bbdc3af6ba99 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 24 May 2010 15:16:22 +1000 Subject: Get rid of 'noise' when using GL and the top-level item is an Item. Task-number: QTBUG-10911 --- tools/qml/qmlruntime.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp index 8df250f..5136872 100644 --- a/tools/qml/qmlruntime.cpp +++ b/tools/qml/qmlruntime.cpp @@ -1240,7 +1240,8 @@ void QDeclarativeViewer::setUseGL(bool useGL) #endif QGLWidget *glWidget = new QGLWidget(format); - glWidget->setAutoFillBackground(false); + //### potentially faster, but causes junk to appear if top-level is Item, not Rectangle + //glWidget->setAutoFillBackground(false); canvas->setViewport(glWidget); } -- cgit v0.12 From 180e2ce2cca53f2c395e8dc9213d714c396c4555 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 24 May 2010 15:40:29 +1000 Subject: Don't crash when assigning a Behavior to a grouped property. Task-number: QTBUG-10799 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativecompiler.cpp | 17 +++++++++++++++++ src/declarative/qml/qdeclarativevmemetaobject.cpp | 2 +- .../qdeclarativebehaviors/data/groupedPropertyCrash.qml | 10 ++++++++++ .../qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp | 10 ++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b5bf972..d27aced 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1089,6 +1089,23 @@ void QDeclarativeCompiler::genObjectBody(QDeclarativeParser::Object *obj) fetch.line = prop->location.start.line; output->bytecode << fetch; + if (!prop->value->metadata.isEmpty()) { + QDeclarativeInstruction meta; + meta.type = QDeclarativeInstruction::StoreMetaObject; + meta.line = 0; + meta.storeMeta.data = output->indexForByteArray(prop->value->metadata); + meta.storeMeta.aliasData = output->indexForByteArray(prop->value->synthdata); + meta.storeMeta.propertyCache = output->propertyCaches.count(); + // ### Surely the creation of this property cache could be more efficient + QDeclarativePropertyCache *propertyCache = + enginePrivate->cache(prop->value->metaObject()->superClass())->copy(); + propertyCache->append(engine, prop->value->metaObject(), QDeclarativePropertyCache::Data::NoFlags, + QDeclarativePropertyCache::Data::IsVMEFunction); + + output->propertyCaches << propertyCache; + output->bytecode << meta; + } + genObjectBody(prop->value); QDeclarativeInstruction pop; diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp index 13e9c26..7aea7cb 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject.cpp +++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp @@ -381,7 +381,7 @@ QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj, const QMetaObject *other, const QDeclarativeVMEMetaData *meta, QDeclarativeCompiledData *cdata) -: object(obj), compiledData(cdata), ctxt(QDeclarativeData::get(obj)->outerContext), +: object(obj), compiledData(cdata), ctxt(QDeclarativeData::get(obj, true)->outerContext), metaData(meta), data(0), methods(0), parent(0) { compiledData->addref(); diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml new file mode 100644 index 0000000..c052366 --- /dev/null +++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupedPropertyCrash.qml @@ -0,0 +1,10 @@ +import Qt 4.7 + +Rectangle { + width: 200 + height: 200 + Text { + Behavior on anchors.verticalCenterOffset { NumberAnimation { duration: 300; } } + text: "Hello World" + } +} diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp index 1dc4b53..45e5304 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp +++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp @@ -72,6 +72,7 @@ private slots: void disabled(); void dontStart(); void startup(); + void groupedPropertyCrash(); }; void tst_qdeclarativebehaviors::simpleBehavior() @@ -351,6 +352,15 @@ void tst_qdeclarativebehaviors::startup() } } +//QTBUG-10799 +void tst_qdeclarativebehaviors::groupedPropertyCrash() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/groupedPropertyCrash.qml")); + QDeclarativeRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); //don't crash +} + QTEST_MAIN(tst_qdeclarativebehaviors) #include "tst_qdeclarativebehaviors.moc" -- cgit v0.12 From 56f0ab34eff5282fc0444b95fa359535a96e5c1e Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 24 May 2010 16:19:37 +1000 Subject: Doc fixes --- doc/src/declarative/examples.qdoc | 6 +++--- examples/declarative/README | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc index a355f9f..6e0426c 100644 --- a/doc/src/declarative/examples.qdoc +++ b/doc/src/declarative/examples.qdoc @@ -56,17 +56,17 @@ sub-directory that show how to use various aspects of QML. In addition, the applications. These demos are intended to show integrated functionality rather than being instructive on specific elements. -To run the examples and demos, you can use Qt Creator or the included \l {Qt Declarative UI Runtime}{qml} +To run the examples and demos, you can use Qt Creator or the included \l {Qt Declarative UI Runtime}{qmlviewer} command-line application. It has some useful options, revealed by: \code - bin/qml -help + bin/qmlviewer -help \endcode For example, from your build directory, run: \code - bin/qml $QTDIR/demos/declarative/samegame/samegame.qml + bin/qmlviewer $QTDIR/demos/declarative/samegame/samegame.qml \endcode \section1 Examples diff --git a/examples/declarative/README b/examples/declarative/README index 9e0f4c4..578c245 100644 --- a/examples/declarative/README +++ b/examples/declarative/README @@ -1,5 +1,5 @@ The Qt Declarative module provides the ability to specify and implement -your UI declaratively, using the Qt Meta-Object Language(QML). This +your user interface declaratively, using the Qt Meta-Object Language (QML). This language is very expressive and human readable, and can be used by designers to actually implement their UI vision. QML UIs can integrate with C++ code in many ways, including being loaded as a part of a C++ UI @@ -9,7 +9,7 @@ The example launcher provided with Qt can be used to explore each of the examples in this directory. But most can also be viewed directly with the QML viewer utility, without requiring compilation. -Documentation for these examples can be found via the Tutorial and Examples +Documentation for these examples can be found via the Tutorials and Examples link in the main Qt documentation. -- cgit v0.12