From 3eafb8d13a51d72af053e19fa4bc66b83f81a923 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 1 Jun 2010 15:51:02 +1000 Subject: Optimization for sci file loading. Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativescalegrid.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativescalegrid.cpp b/src/declarative/graphicsitems/qdeclarativescalegrid.cpp index fe89190..a053aa0 100644 --- a/src/declarative/graphicsitems/qdeclarativescalegrid.cpp +++ b/src/declarative/graphicsitems/qdeclarativescalegrid.cpp @@ -130,8 +130,9 @@ QDeclarativeGridScaledImage::QDeclarativeGridScaledImage(QIODevice *data) int b = -1; QString imgFile; - while(!data->atEnd()) { - QString line = QString::fromUtf8(data->readLine().trimmed()); + QByteArray raw; + while(raw = data->readLine(), !raw.isEmpty()) { + QString line = QString::fromUtf8(raw.trimmed()); if (line.isEmpty() || line.startsWith(QLatin1Char('#'))) continue; -- cgit v0.12 From 0400d1474e65a5fd849c1610bdf0717af295f704 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 1 Jun 2010 15:51:40 +1000 Subject: Documentation. --- src/declarative/util/qdeclarativepropertychanges.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index d99de7a..08f4750 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE /*! \qmlclass PropertyChanges QDeclarativePropertyChanges \since 4.7 - \brief The PropertyChanges element describes new property values for a state. + \brief The PropertyChanges element describes new property bindings or values for a state. PropertyChanges provides a state change that modifies the properties of an item. @@ -89,6 +89,21 @@ QT_BEGIN_NAMESPACE MouseArea { anchors.fill: parent; onClicked: myText.state = 'myState' } } \endqml + + By default, PropertyChanges will establish new bindings where appropriate. + For example, the following creates a new binding for myItem's height property. + + \qml + PropertyChanges { + target: myItem + height: parent.height + } + \endqml + + If you don't want a binding to be established (and instead just want to assign + the value of the binding at the time the state is entered), + you should set the PropertyChange's \l{PropertyChanges::explicit}{explicit} + property to \c true. State-specific script for signal handlers can also be specified: -- cgit v0.12