42 #include "private/qdeclarativefontloader_p.h" 47 #include <QStringList> 50 #include <QNetworkRequest> 51 #include <QNetworkReply> 52 #include <QFontDatabase> 54 #include <private/qobject_p.h> 55 #include <private/qdeclarativeengine_p.h> 60 #define FONTLOADER_MAXIMUM_REDIRECT_RECURSION 16 205 #ifndef QT_NO_LOCALFILE_OPTIMIZED_QML 208 if (!
d->fonts.contains(
d->url)) {
213 d->fonts[
d->url] = fo;
223 if (!
d->fonts.contains(
d->url)) {
225 d->fonts[
d->url] = fo;
249 if (name !=
d->name) {
253 if (status !=
d->status) {
255 qmlInfo(
this) <<
"Cannot load font: \"" <<
d->url.toString() <<
"\"";
350 #include <qdeclarativefontloader.moc> The QVariant class acts like a union for the most common Qt data types.
static QString urlToLocalFileOrQrc(const QUrl &url)
NetworkError error() const
Returns the error that was found during the processing of this request.
~QDeclarativeFontLoader()
#define QT_END_NAMESPACE
This macro expands to.
QDeclarativeFontObject(int _id=-1)
static int addApplicationFont(const QString &fileName)
Loads the font from the file specified by fileName and makes it available to the application.
QVariant attribute(QNetworkRequest::Attribute code) const
Returns the attribute associated with the code code.
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
#define at(className, varName)
QUrl resolvedUrl(const QUrl &)
Resolves the URL src relative to the URL of the containing component.
static LibLoadStatus status
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
void setName(const QString &name)
The QObject class is the base class of all Qt objects.
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
void setAttribute(Attribute code, const QVariant &value)
Sets the attribute associated with code code to be value value.
QDeclarativeFontLoader::Status status
void updateFontInfo(const QString &, QDeclarativeFontLoader::Status)
void download(const QUrl &url, QNetworkAccessManager *manager)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QDeclarativeFontLoader(QObject *parent=0)
QDeclarativeFontLoaderPrivate()
const T & at(int i) const
Returns the item at index position i in the list.
QNetworkReply * get(const QNetworkRequest &request)
Posts a request to obtain the contents of the target request and returns a new QNetworkReply object o...
QUrl toUrl() const
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl...
The QNetworkAccessManager class allows the application to send network requests and receive replies...
#define Q_DECLARE_PUBLIC(Class)
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
static int addApplicationFontFromData(const QByteArray &fontData)
Loads the font from binary data specified by fontData and makes it available to the application...
QObject * parent() const
Returns a pointer to the parent object.
static QStringList applicationFontFamilies(int id)
Returns a list of font families for the given application font identified by id.
QByteArray readAll()
Reads all available data from the device, and returns it as a QByteArray.
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
#define FONTLOADER_MAXIMUM_REDIRECT_RECURSION
void fontDownloaded(const QString &, QDeclarativeFontLoader::Status)
QUrl url() const
Returns the URL of the content downloaded or uploaded.
QNetworkAccessManager * manager() const
Returns the QNetworkAccessManager that was used to create this QNetworkReply object.
QDeclarativeInfo qmlInfo(const QObject *me)
void setSource(const QUrl &url)
static QHash< QUrl, QDeclarativeFontObject * > fonts
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
void deleteLater()
Schedules this object for deletion.