diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-06-01 06:27:59 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-06-02 00:07:33 (GMT) |
commit | 9cb0802cede5f9fd91ca303bcec5ae869acae951 (patch) | |
tree | f90d5fed5004dfa7e526783d81f94f04444313e4 /src/declarative/util/qdeclarativefontloader.cpp | |
parent | 2e904930ede28a59710ef6f898419aba7ede7c06 (diff) | |
download | Qt-9cb0802cede5f9fd91ca303bcec5ae869acae951.zip Qt-9cb0802cede5f9fd91ca303bcec5ae869acae951.tar.gz Qt-9cb0802cede5f9fd91ca303bcec5ae869acae951.tar.bz2 |
Doc fixes and improvements - fix some example code, link to
examples from class docs and improve assorted docs
Diffstat (limited to 'src/declarative/util/qdeclarativefontloader.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativefontloader.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index c73f827..3c2e239 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -83,6 +83,8 @@ public: Example: \qml + import Qt 4.7 + FontLoader { id: fixedFont; name: "Courier" } FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" } @@ -183,15 +185,26 @@ void QDeclarativeFontLoader::setName(const QString &name) \o FontLoader.Error - an error occurred while loading the font \endlist - Note that a change in the status property does not cause anything to happen - (although it reflects what has happened to the font loader internally). If you wish - to react to the change in status you need to do it yourself, for example in one - of the following ways: - \list - \o Create a state, so that a state change occurs, e.g. State{name: 'loaded'; when: loader.status = FontLoader.Ready;} - \o Do something inside the onStatusChanged signal handler, e.g. FontLoader{id: loader; onStatusChanged: if(loader.status == FontLoader.Ready) console.log('Loaded');} - \o Bind to the status variable somewhere, e.g. Text{text: if(loader.status!=FontLoader.Ready){'Not Loaded';}else{'Loaded';}} - \endlist + Use this status to provide an update or respond to the status change in some way. + For example, you could: + + \e {Trigger a state change:} + \qml + State { name: 'loaded'; when: loader.status = FontLoader.Ready } + \endqml + + \e {Implement an \c onStatusChanged signal handler:} + \qml + FontLoader { + id: loader + onStatusChanged: if (loader.status == FontLoader.Ready) console.log('Loaded') + } + \endqml + + \e {Bind to the status value:} + \qml + Text { text: loader.status != FontLoader.Ready ? 'Not Loaded' : 'Loaded' } + \endqml */ QDeclarativeFontLoader::Status QDeclarativeFontLoader::status() const { |