From 89a99fb94e12c6d582537048f3c977fb4d4058a7 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 24 Aug 2009 10:20:16 +1000 Subject: Remove the overhead of string conversion from the vector() built-in Reviewed-by: Aaron Kennedy --- src/declarative/qml/qmlengine.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 7f2a3e1..351bd8a 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -71,6 +71,7 @@ #include #include #include +#include #include #include "private/qmlcomponentjs_p.h" #include "private/qmlmetaproperty_p.h" @@ -727,10 +728,7 @@ QScriptValue QmlEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engin qsreal x = ctxt->argument(0).toNumber(); qsreal y = ctxt->argument(1).toNumber(); qsreal z = ctxt->argument(2).toNumber(); - QString s = QString::number(x) + QLatin1Char(',') + - QString::number(y) + QLatin1Char(',') + - QString::number(z); - return QScriptValue(s); + return engine->newVariant(qVariantFromValue(QVector3D(x, y, z))); } QmlScriptClass::QmlScriptClass(QmlEngine *bindengine) -- cgit v0.12 From d2d9bf98c81cc6004b30bd5468728516511dcec1 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 24 Aug 2009 11:06:11 +1000 Subject: Get qmlcomponent benchmark running after name changes. --- .../benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml b/tests/benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml index 8a505da..7860cf4 100644 --- a/tests/benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml +++ b/tests/benchmarks/declarative/qmlcomponent/samegame/BoomBlock.qml @@ -42,13 +42,13 @@ Item { id:block states: [ State{ name: "AliveState"; when: spawned == true && dying == false - SetProperties { target: img; opacity: 1 } + PropertyChanges { target: img; opacity: 1 } }, State{ name: "DeathState"; when: dying == true - SetProperties { target: particles; count: 50 } - SetProperties { target: particles; opacity: 1 } - SetProperties { target: particles; emitting: false } // i.e. emit only once - SetProperties { target: img; opacity: 0 } + PropertyChanges { target: particles; count: 50 } + PropertyChanges { target: particles; opacity: 1 } + PropertyChanges { target: particles; emitting: false } // i.e. emit only once + PropertyChanges { target: img; opacity: 0 } } ] } -- cgit v0.12 From 25aa10e773db72a66aa18dbd297bd24ad810e241 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 24 Aug 2009 11:07:32 +1000 Subject: Doc tweak. --- src/declarative/util/qmllistmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index e2575ab..51b0dae 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -72,7 +72,7 @@ struct ListModelData \qmlclass ListModel \brief The ListModel element defines a free-form list data source. - The ListModel is a simple hierarchy of items containing data roles. + The ListModel is a simple hierarchy of elements containing data roles. For example: \code @@ -93,8 +93,8 @@ struct ListModelData } \endcode - Item roles (properties) must begin with a lower-case letter. The above example defines a - ListModel containing three items, with the roles "name" and "cost". + Roles (properties) must begin with a lower-case letter. The above example defines a + ListModel containing three elements, with the roles "name" and "cost". The defined model can be used in views such as ListView: \code -- cgit v0.12