diff options
Diffstat (limited to 'src/declarative/util/qdeclarativefontloader.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativefontloader.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index d2f65eff88..03a0561fbf 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -220,15 +220,15 @@ void QDeclarativeFontLoader::setSource(const QUrl &url) fo->download(d->url, qmlEngine(this)->networkAccessManager()); d->status = Loading; emit statusChanged(); - QObject::connect(fo, SIGNAL(fontDownloaded(QString, QDeclarativeFontLoader::Status)), - this, SLOT(updateFontInfo(QString, QDeclarativeFontLoader::Status))); + QObject::connect(fo, SIGNAL(fontDownloaded(QString,QDeclarativeFontLoader::Status)), + this, SLOT(updateFontInfo(QString,QDeclarativeFontLoader::Status))); } else { QDeclarativeFontObject *fo = d->fonts[d->url]; if (fo->id == -1) { d->status = Loading; emit statusChanged(); - QObject::connect(fo, SIGNAL(fontDownloaded(QString, QDeclarativeFontLoader::Status)), - this, SLOT(updateFontInfo(QString, QDeclarativeFontLoader::Status))); + QObject::connect(fo, SIGNAL(fontDownloaded(QString,QDeclarativeFontLoader::Status)), + this, SLOT(updateFontInfo(QString,QDeclarativeFontLoader::Status))); } else updateFontInfo(QFontDatabase::applicationFontFamilies(fo->id).at(0), Ready); @@ -297,23 +297,25 @@ void QDeclarativeFontLoader::setName(const QString &name) 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 } + \list + \o Trigger a state change: + \qml + State { name: 'loaded'; when: loader.status == FontLoader.Ready } \endqml - \e {Implement an \c onStatusChanged signal handler:} - \qml + \o 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:} + \o Bind to the status value: \qml - Text { text: loader.status != FontLoader.Ready ? 'Not Loaded' : 'Loaded' } + Text { text: loader.status == FontLoader.Ready ? 'Loaded' : 'Not loaded' } \endqml + \endlist */ QDeclarativeFontLoader::Status QDeclarativeFontLoader::status() const { |