diff options
Diffstat (limited to 'src/quick/util')
29 files changed, 348 insertions, 9 deletions
diff --git a/src/quick/util/qquickanimation_p.h b/src/quick/util/qquickanimation_p.h index c4d5cd20cd..4d3532ce84 100644 --- a/src/quick/util/qquickanimation_p.h +++ b/src/quick/util/qquickanimation_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKANIMATION_H #define QQUICKANIMATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickstate_p.h" #include <QtGui/qvector3d.h> diff --git a/src/quick/util/qquickanimationcontroller_p.h b/src/quick/util/qquickanimationcontroller_p.h index 171090b6a7..efd1dbafc4 100644 --- a/src/quick/util/qquickanimationcontroller_p.h +++ b/src/quick/util/qquickanimationcontroller_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKANIMATIONCONTROLLER_H #define QQUICKANIMATIONCONTROLLER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include "qquickanimation_p.h" diff --git a/src/quick/util/qquickanimator_p.h b/src/quick/util/qquickanimator_p.h index 7647e582b8..1ba0367839 100644 --- a/src/quick/util/qquickanimator_p.h +++ b/src/quick/util/qquickanimator_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKANIMATOR_P_H #define QQUICKANIMATOR_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickanimation_p.h" QT_BEGIN_NAMESPACE diff --git a/src/quick/util/qquickanimator_p_p.h b/src/quick/util/qquickanimator_p_p.h index ad16b1c361..f5f0295f74 100644 --- a/src/quick/util/qquickanimator_p_p.h +++ b/src/quick/util/qquickanimator_p_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKANIMATOR_P_P_H #define QQUICKANIMATOR_P_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickanimator_p.h" #include "qquickanimation_p_p.h" #include <QtQuick/qquickitem.h> diff --git a/src/quick/util/qquickanimatorcontroller_p.h b/src/quick/util/qquickanimatorcontroller_p.h index 4de485c37c..5dd9b09e0b 100644 --- a/src/quick/util/qquickanimatorcontroller_p.h +++ b/src/quick/util/qquickanimatorcontroller_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKANIMATORCONTROLLER_P_H #define QQUICKANIMATORCONTROLLER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickanimatorjob_p.h" #include <QtQuick/qsgnode.h> #include <QtQuick/qquickitem.h> diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h index ca70aecb8e..fd2543ea8a 100644 --- a/src/quick/util/qquickanimatorjob_p.h +++ b/src/quick/util/qquickanimatorjob_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKANIMATORJOB_P_H #define QQUICKANIMATORJOB_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <private/qabstractanimationjob_p.h> #include <private/qquickanimator_p.h> #include <private/qtquickglobal_p.h> diff --git a/src/quick/util/qquickapplication_p.h b/src/quick/util/qquickapplication_p.h index c22d8cfe6b..082f68101a 100644 --- a/src/quick/util/qquickapplication_p.h +++ b/src/quick/util/qquickapplication_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKAPPLICATION_P_H #define QQUICKAPPLICATION_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QObject> #include <qqml.h> #include <QtQml/private/qqmlglobal_p.h> diff --git a/src/quick/util/qquickbehavior_p.h b/src/quick/util/qquickbehavior_p.h index d566ca8ba1..a8bff1511b 100644 --- a/src/quick/util/qquickbehavior_p.h +++ b/src/quick/util/qquickbehavior_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKBEHAVIOR_H #define QQUICKBEHAVIOR_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <private/qtquickglobal_p.h> #include <private/qqmlpropertyvalueinterceptor_p.h> diff --git a/src/quick/util/qquickfontloader.cpp b/src/quick/util/qquickfontloader.cpp index 67df47fb37..496acaa8e3 100644 --- a/src/quick/util/qquickfontloader.cpp +++ b/src/quick/util/qquickfontloader.cpp @@ -47,6 +47,8 @@ #include <qqmlinfo.h> #include <qqmlfile.h> +#include <QtCore/QCoreApplication> + QT_BEGIN_NAMESPACE #define FONTLOADER_MAXIMUM_REDIRECT_RECURSION 16 @@ -132,10 +134,50 @@ public: QUrl url; QString name; QQuickFontLoader::Status status; - static QHash<QUrl, QQuickFontObject*> fonts; }; -QHash<QUrl, QQuickFontObject*> QQuickFontLoaderPrivate::fonts; +static void q_QFontLoaderFontsStaticReset(); +static void q_QFontLoaderFontsAddReset() +{ + qAddPostRoutine(q_QFontLoaderFontsStaticReset); +} +class QFontLoaderFonts +{ +public: + QFontLoaderFonts() + { + qAddPostRoutine(q_QFontLoaderFontsStaticReset); + qAddPreRoutine(q_QFontLoaderFontsAddReset); + } + + ~QFontLoaderFonts() + { + qRemovePostRoutine(q_QFontLoaderFontsStaticReset); + reset(); + } + + + void reset() + { + QVector<QQuickFontObject *> deleted; + QHash<QUrl, QQuickFontObject*>::iterator it; + for (it = map.begin(); it != map.end(); ++it) { + if (!deleted.contains(it.value())) { + deleted.append(it.value()); + delete it.value(); + } + } + map.clear(); + } + + QHash<QUrl, QQuickFontObject *> map; +}; +Q_GLOBAL_STATIC(QFontLoaderFonts, fontLoaderFonts); + +static void q_QFontLoaderFontsStaticReset() +{ + fontLoaderFonts()->reset(); +} /*! \qmltype FontLoader @@ -193,29 +235,29 @@ void QQuickFontLoader::setSource(const QUrl &url) QString localFile = QQmlFile::urlToLocalFileOrQrc(d->url); if (!localFile.isEmpty()) { - if (!d->fonts.contains(d->url)) { + if (!fontLoaderFonts()->map.contains(d->url)) { int id = QFontDatabase::addApplicationFont(localFile); if (id != -1) { updateFontInfo(QFontDatabase::applicationFontFamilies(id).at(0), Ready); QQuickFontObject *fo = new QQuickFontObject(id); - d->fonts[d->url] = fo; + fontLoaderFonts()->map[d->url] = fo; } else { updateFontInfo(QString(), Error); } } else { - updateFontInfo(QFontDatabase::applicationFontFamilies(d->fonts[d->url]->id).at(0), Ready); + updateFontInfo(QFontDatabase::applicationFontFamilies(fontLoaderFonts()->map[d->url]->id).at(0), Ready); } } else { - if (!d->fonts.contains(d->url)) { + if (!fontLoaderFonts()->map.contains(d->url)) { QQuickFontObject *fo = new QQuickFontObject; - d->fonts[d->url] = fo; + fontLoaderFonts()->map[d->url] = fo; fo->download(d->url, qmlEngine(this)->networkAccessManager()); d->status = Loading; emit statusChanged(); QObject::connect(fo, SIGNAL(fontDownloaded(QString,QQuickFontLoader::Status)), this, SLOT(updateFontInfo(QString,QQuickFontLoader::Status))); } else { - QQuickFontObject *fo = d->fonts[d->url]; + QQuickFontObject *fo = fontLoaderFonts()->map[d->url]; if (fo->id == -1) { d->status = Loading; emit statusChanged(); diff --git a/src/quick/util/qquickfontloader_p.h b/src/quick/util/qquickfontloader_p.h index 507d0210ee..1e2a70be7d 100644 --- a/src/quick/util/qquickfontloader_p.h +++ b/src/quick/util/qquickfontloader_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKFONTLOADER_H #define QQUICKFONTLOADER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include <QtCore/qobject.h> diff --git a/src/quick/util/qquickfontmetrics_p.h b/src/quick/util/qquickfontmetrics_p.h index 88880a2be8..37aaef7345 100644 --- a/src/quick/util/qquickfontmetrics_p.h +++ b/src/quick/util/qquickfontmetrics_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKFONTMETRICS_H #define QQUICKFONTMETRICS_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include <QtGui/QFontMetricsF> diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h index 5230a3cdea..b39b6e5c01 100644 --- a/src/quick/util/qquickpath_p.h +++ b/src/quick/util/qquickpath_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKPATH_H #define QQUICKPATH_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include <private/qqmlnullablevalue_p.h> diff --git a/src/quick/util/qquickpathinterpolator_p.h b/src/quick/util/qquickpathinterpolator_p.h index 895aa56078..38c5debbed 100644 --- a/src/quick/util/qquickpathinterpolator_p.h +++ b/src/quick/util/qquickpathinterpolator_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKPATHINTERPOLATOR_P_H #define QQUICKPATHINTERPOLATOR_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include <QObject> diff --git a/src/quick/util/qquickpixmapcache_p.h b/src/quick/util/qquickpixmapcache_p.h index 482a2e5653..6ab318ba7b 100644 --- a/src/quick/util/qquickpixmapcache_p.h +++ b/src/quick/util/qquickpixmapcache_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKPIXMAPCACHE_H #define QQUICKPIXMAPCACHE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qcoreapplication.h> #include <QtCore/qstring.h> #include <QtGui/qpixmap.h> diff --git a/src/quick/util/qquickpropertychanges_p.h b/src/quick/util/qquickpropertychanges_p.h index 15e5ec2936..d5938fd102 100644 --- a/src/quick/util/qquickpropertychanges_p.h +++ b/src/quick/util/qquickpropertychanges_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKPROPERTYCHANGES_H #define QQUICKPROPERTYCHANGES_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickstatechangescript_p.h" #include <private/qqmlcustomparser_p.h> diff --git a/src/quick/util/qquicksmoothedanimation_p.h b/src/quick/util/qquicksmoothedanimation_p.h index efac9217f5..9f18170283 100644 --- a/src/quick/util/qquicksmoothedanimation_p.h +++ b/src/quick/util/qquicksmoothedanimation_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKSMOOTHEDANIMATION_H #define QQUICKSMOOTHEDANIMATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include "qquickanimation_p.h" diff --git a/src/quick/util/qquickspringanimation_p.h b/src/quick/util/qquickspringanimation_p.h index 082fd341f7..b924c4c72e 100644 --- a/src/quick/util/qquickspringanimation_p.h +++ b/src/quick/util/qquickspringanimation_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKSPRINGANIMATION_H #define QQUICKSPRINGANIMATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include "qquickanimation_p.h" diff --git a/src/quick/util/qquickstate_p.h b/src/quick/util/qquickstate_p.h index 1870b70626..6d051ff578 100644 --- a/src/quick/util/qquickstate_p.h +++ b/src/quick/util/qquickstate_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKSTATE_H #define QQUICKSTATE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include <qqmlproperty.h> #include <QtCore/qobject.h> diff --git a/src/quick/util/qquickstatechangescript_p.h b/src/quick/util/qquickstatechangescript_p.h index 6c019a43d2..f9580a53df 100644 --- a/src/quick/util/qquickstatechangescript_p.h +++ b/src/quick/util/qquickstatechangescript_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKSTATEOPERATIONS_H #define QQUICKSTATEOPERATIONS_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickstate_p.h" #include <qqmlscriptstring.h> diff --git a/src/quick/util/qquickstategroup_p.h b/src/quick/util/qquickstategroup_p.h index 8ea2dbc4b3..03676a68fb 100644 --- a/src/quick/util/qquickstategroup_p.h +++ b/src/quick/util/qquickstategroup_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKSTATEGROUP_H #define QQUICKSTATEGROUP_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickstate_p.h" QT_BEGIN_NAMESPACE diff --git a/src/quick/util/qquickstyledtext_p.h b/src/quick/util/qquickstyledtext_p.h index 2f07a740e5..cd6710ff26 100644 --- a/src/quick/util/qquickstyledtext_p.h +++ b/src/quick/util/qquickstyledtext_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKSTYLEDTEXT_H #define QQUICKSTYLEDTEXT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QSize> #include <QPointF> #include <QList> diff --git a/src/quick/util/qquicksvgparser_p.h b/src/quick/util/qquicksvgparser_p.h index ed9a7558d0..60661a7840 100644 --- a/src/quick/util/qquicksvgparser_p.h +++ b/src/quick/util/qquicksvgparser_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKSVGPARSER_P_H #define QQUICKSVGPARSER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qstring.h> #include <QtGui/qpainterpath.h> diff --git a/src/quick/util/qquicksystempalette_p.h b/src/quick/util/qquicksystempalette_p.h index fb898eb1fa..99654d76f7 100644 --- a/src/quick/util/qquicksystempalette_p.h +++ b/src/quick/util/qquicksystempalette_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKSYSTEMPALETTE_H #define QQUICKSYSTEMPALETTE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include <QtCore/qobject.h> diff --git a/src/quick/util/qquicktextmetrics_p.h b/src/quick/util/qquicktextmetrics_p.h index c0265d9507..96e304b907 100644 --- a/src/quick/util/qquicktextmetrics_p.h +++ b/src/quick/util/qquicktextmetrics_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKTEXTMETRICS_H #define QQUICKTEXTMETRICS_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include <QtGui/QFontMetricsF> diff --git a/src/quick/util/qquicktransition_p.h b/src/quick/util/qquicktransition_p.h index 826df6794b..d4cd1a087b 100644 --- a/src/quick/util/qquicktransition_p.h +++ b/src/quick/util/qquicktransition_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKTRANSITION_H #define QQUICKTRANSITION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include "qquickstate_p.h" #include <private/qabstractanimationjob_p.h> #include <qqml.h> diff --git a/src/quick/util/qquicktransitionmanager_p_p.h b/src/quick/util/qquicktransitionmanager_p_p.h index a6d91d7efd..43e63b80d9 100644 --- a/src/quick/util/qquicktransitionmanager_p_p.h +++ b/src/quick/util/qquicktransitionmanager_p_p.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE class QQuickStatePrivate; class QQuickTransitionManagerPrivate; -class Q_AUTOTEST_EXPORT QQuickTransitionManager +class Q_QUICK_PRIVATE_EXPORT QQuickTransitionManager { public: QQuickTransitionManager(); diff --git a/src/quick/util/qquickutilmodule_p.h b/src/quick/util/qquickutilmodule_p.h index 77d0e7dd3b..c2e80d22ce 100644 --- a/src/quick/util/qquickutilmodule_p.h +++ b/src/quick/util/qquickutilmodule_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKUTILMODULE_H #define QQUICKUTILMODULE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> QT_BEGIN_NAMESPACE diff --git a/src/quick/util/qquickvalidator_p.h b/src/quick/util/qquickvalidator_p.h index 59d7884afc..da071ef2f5 100644 --- a/src/quick/util/qquickvalidator_p.h +++ b/src/quick/util/qquickvalidator_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKVALIDATOR_P_H #define QQUICKVALIDATOR_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/qvalidator.h> #include <QtQml/qqml.h> diff --git a/src/quick/util/qquickvaluetypes_p.h b/src/quick/util/qquickvaluetypes_p.h index 7a2e8888b7..3b196da206 100644 --- a/src/quick/util/qquickvaluetypes_p.h +++ b/src/quick/util/qquickvaluetypes_p.h @@ -34,6 +34,17 @@ #ifndef QQUICKVALUETYPES_P_H #define QQUICKVALUETYPES_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qqml.h> #include <qtquickglobal.h> #include <private/qqmlvaluetype_p.h> |