summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-06-01 07:09:50 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-06-01 07:09:50 (GMT)
commit8709ff7920a378c91ce754a39cae4016709e9e00 (patch)
treeb11db41e1df88ccccae9d74d561da9ae0caf79af
parentf5aeb6a627ecde5da8c3674b0ba83582f5e4ec84 (diff)
parent0400d1474e65a5fd849c1610bdf0717af295f704 (diff)
downloadQt-8709ff7920a378c91ce754a39cae4016709e9e00.zip
Qt-8709ff7920a378c91ce754a39cae4016709e9e00.tar.gz
Qt-8709ff7920a378c91ce754a39cae4016709e9e00.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
-rw-r--r--src/declarative/graphicsitems/qdeclarativescalegrid.cpp5
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp17
2 files changed, 19 insertions, 3 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;
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: