summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativefontloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/util/qdeclarativefontloader.cpp')
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index 3e4a81a0c8..03a0561fbf 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -49,7 +49,6 @@
#include <QDebug>
#include <QNetworkRequest>
#include <QNetworkReply>
-#include <QFile>
#include <QFontDatabase>
#include <private/qobject_p.h>
@@ -221,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);
@@ -298,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
{