Remove more QApp dependencies
authorLars Knoll <lars.knoll@nokia.com>
Wed, 4 May 2011 07:11:33 +0000 (09:11 +0200)
committerLars Knoll <lars.knoll@nokia.com>
Wed, 4 May 2011 07:11:33 +0000 (09:11 +0200)
platformIntegration() lives in QGuiApplication
QFont and QFontDatabase can live with QGuiApp only
as well.

18 files changed:
src/gui/egl/qegl_qpa.cpp
src/gui/kernel/qapplication.cpp
src/gui/kernel/qapplication.h
src/gui/kernel/qapplication_qpa.cpp
src/gui/kernel/qclipboard_qpa.cpp
src/gui/kernel/qdesktopwidget_qpa.cpp
src/gui/kernel/qeventdispatcher_glib_qpa.cpp
src/gui/kernel/qeventdispatcher_qpa.cpp
src/gui/kernel/qguiapplication.cpp
src/gui/kernel/qguiapplication.h
src/gui/kernel/qplatformscreen_qpa.cpp
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget_qpa.cpp
src/gui/kernel/qwindow.cpp
src/gui/text/qfont.cpp
src/gui/text/qfont_qpa.cpp
src/gui/text/qfontdatabase.cpp
src/gui/text/qfontdatabase_qpa.cpp

index ec3ca93..7785c03 100644 (file)
@@ -74,7 +74,7 @@ EGLNativePixmapType QEgl::nativePixmap(QPixmap* pixmap)
 
 static QPlatformScreen *screenForDevice(QPaintDevice *device)
 {
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
 
     QList<QPlatformScreen *> screens = pi->screens();
 
index b1d9b89..6168199 100644 (file)
@@ -2318,17 +2318,6 @@ void QApplication::aboutQt()
     \sa QWidget::setFocus(), QWidget::clearFocus(), Qt::FocusReason
 */
 
-/*!
-    \since 4.5
-    \fn void QApplication::fontDatabaseChanged()
-
-    This signal is emitted when application fonts are loaded or removed.
-
-    \sa QFontDatabase::addApplicationFont(),
-    QFontDatabase::addApplicationFontFromData(),
-    QFontDatabase::removeAllApplicationFonts(),
-    QFontDatabase::removeApplicationFont()
-*/
 
 #ifndef QT_NO_TRANSLATION
 #if defined(Q_WS_MAC)
index 8529329..02d59c8 100644 (file)
@@ -402,7 +402,6 @@ private:
     friend class QTextControl;
 #endif
     friend class QAction;
-    friend class QFontDatabasePrivate;
 
 #if defined(Q_WS_QWS)
     friend class QInputContext;
index a1c1201..1996bda 100644 (file)
@@ -352,7 +352,7 @@ void QApplication::restoreOverrideCursor()
 
 QWidget *QApplication::topLevelAt(const QPoint &pos)
 {
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
 
     QList<QPlatformScreen *> screens = pi->screens();
     QList<QPlatformScreen *>::const_iterator screen = screens.constBegin();
@@ -382,7 +382,7 @@ void QApplication::alert(QWidget *, int)
 
 QPlatformNativeInterface *QApplication::platformNativeInterface()
 {
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
     return pi->nativeInterface();
 }
 
index b8ce60e..89c0afa 100644 (file)
@@ -64,14 +64,14 @@ bool QClipboard::event(QEvent *e)
 
 const QMimeData* QClipboard::mimeData(Mode mode) const
 {
-    QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard();
+    QPlatformClipboard *clipboard = QGuiApplicationPrivate::platformIntegration()->clipboard();
     if (!clipboard->supportsMode(mode)) return 0;
     return clipboard->mimeData(mode);
 }
 
 void QClipboard::setMimeData(QMimeData* src, Mode mode)
 {
-    QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard();
+    QPlatformClipboard *clipboard = QGuiApplicationPrivate::platformIntegration()->clipboard();
     if (!clipboard->supportsMode(mode)) return;
 
     clipboard->setMimeData(src,mode);
@@ -81,7 +81,7 @@ void QClipboard::setMimeData(QMimeData* src, Mode mode)
 
 bool QClipboard::supportsMode(Mode mode) const
 {
-    QPlatformClipboard *clipboard = QApplicationPrivate::platformIntegration()->clipboard();
+    QPlatformClipboard *clipboard = QGuiApplicationPrivate::platformIntegration()->clipboard();
     return clipboard->supportsMode(mode);
 }
 
index 41cacf2..b79e4e1 100644 (file)
@@ -50,7 +50,7 @@ QT_USE_NAMESPACE
 
 void QDesktopWidgetPrivate::updateScreenList()
 {
-    QList<QPlatformScreen *> screenList = QApplicationPrivate::platformIntegration()->screens();
+    QList<QPlatformScreen *> screenList = QGuiApplicationPrivate::platformIntegration()->screens();
     int targetLength = screenList.length();
     int currentLength = screens.length();
 
@@ -71,7 +71,7 @@ void QDesktopWidgetPrivate::updateScreenList()
     }
 
     QRegion virtualGeometry;
-    bool doVirtualGeometry = QApplicationPrivate::platformIntegration()->isVirtualDesktop();
+    bool doVirtualGeometry = QGuiApplicationPrivate::platformIntegration()->isVirtualDesktop();
 
     // update the geometry of each screen widget
     for (int i = 0; i < screens.length(); i++) {
@@ -100,7 +100,7 @@ QDesktopWidget::~QDesktopWidget()
 
 bool QDesktopWidget::isVirtualDesktop() const
 {
-    return QApplicationPrivate::platformIntegration()->isVirtualDesktop();
+    return QGuiApplicationPrivate::platformIntegration()->isVirtualDesktop();
 }
 
 int QDesktopWidget::primaryScreen() const
@@ -110,14 +110,14 @@ int QDesktopWidget::primaryScreen() const
 
 int QDesktopWidget::numScreens() const
 {
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
     return qMax(pi->screens().size(), 1);
 }
 
 QWidget *QDesktopWidget::screen(int screen)
 {
     Q_D(QDesktopWidget);
-    if (QApplicationPrivate::platformIntegration()->isVirtualDesktop())
+    if (QGuiApplicationPrivate::platformIntegration()->isVirtualDesktop())
         return &d->virtualScreen;
     if (screen < 0 || screen >= d->screens.length())
         return d->screens.at(0);
@@ -126,7 +126,7 @@ QWidget *QDesktopWidget::screen(int screen)
 
 const QRect QDesktopWidget::availableGeometry(int screenNo) const
 {
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
     QList<QPlatformScreen *> screens = pi->screens();
     if (screenNo == -1)
         screenNo = 0;
@@ -138,7 +138,7 @@ const QRect QDesktopWidget::availableGeometry(int screenNo) const
 
 const QRect QDesktopWidget::screenGeometry(int screenNo) const
 {
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
     QList<QPlatformScreen *> screens = pi->screens();
     if (screenNo == -1)
         screenNo = 0;
@@ -162,7 +162,7 @@ int QDesktopWidget::screenNumber(const QWidget *w) const
 
 int QDesktopWidget::screenNumber(const QPoint &p) const
 {
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
     QList<QPlatformScreen *> screens = pi->screens();
 
     for (int i = 0; i < screens.size(); ++i)
index 25d6cda..c63e94e 100644 (file)
@@ -135,7 +135,7 @@ bool QPAEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
 {
     static bool init = false;
     if (!init) {
-        if (QApplicationPrivate::platformIntegration()->createEventLoopIntegration()) {
+        if (QGuiApplicationPrivate::platformIntegration()->createEventLoopIntegration()) {
             qWarning("Eventloop integration is not supported by the glib event dispatcher");
             qWarning("Use the UNIX event dispatcher by defining environment variable QT_NO_GLIB=1");
         }
index 2ad7129..26c8745 100644 (file)
@@ -144,8 +144,8 @@ public:
         if (!m_integrationInitialised) {
             QEventDispatcherQPAPrivate *that = const_cast<QEventDispatcherQPAPrivate *>(this);
             if (qApp && (qApp->thread() == QThread::currentThread())) { // guiThread
-                if (QApplicationPrivate::platformIntegration()) {
-                    that->eventLoopIntegration = QApplicationPrivate::platformIntegration()->createEventLoopIntegration();
+                if (QGuiApplicationPrivate::platformIntegration()) {
+                    that->eventLoopIntegration = QGuiApplicationPrivate::platformIntegration()->createEventLoopIntegration();
                     if (that->eventLoopIntegration) {
                         that->selectWorker = new SelectWorker(that);
                         that->barrierBeforeBlocking = new Rendezvous;
index 6d680ec..a34d6b6 100644 (file)
@@ -884,6 +884,17 @@ Qt::LayoutDirection QGuiApplication::layoutDirection()
     return layout_direction;
 }
 
+/*!
+    \since 4.5
+    \fn void QGuiApplication::fontDatabaseChanged()
+
+    This signal is emitted when application fonts are loaded or removed.
+
+    \sa QFontDatabase::addApplicationFont(),
+    QFontDatabase::addApplicationFontFromData(),
+    QFontDatabase::removeAllApplicationFonts(),
+    QFontDatabase::removeApplicationFont()
+*/
 
 
 QT_END_NAMESPACE
index 4230a65..44f9ad9 100644 (file)
@@ -103,6 +103,9 @@ public:
     static int exec();
     bool notify(QObject *, QEvent *);
 
+Q_SIGNALS:
+    void fontDatabaseChanged();
+
 protected:
     bool event(QEvent *);
     bool compressEvent(QEvent *, QObject *receiver, QPostEventList *);
@@ -116,6 +119,7 @@ private:
 #ifndef QT_NO_GESTURES
     friend class QGestureManager;
 #endif
+    friend class QFontDatabasePrivate;
 };
 
 QT_END_NAMESPACE
index 2e1a137..8b68678 100644 (file)
@@ -91,7 +91,7 @@ QPlatformScreen * QPlatformScreen::platformScreenForWidget(const QWidget *widget
     if (topData)
         screenIndex = topData->screenIndex;
     QPlatformIntegration *integration =
-            QApplicationPrivate::platformIntegration();
+            QGuiApplicationPrivate::platformIntegration();
     return integration->screens()[screenIndex];
 }
 
index 7022c38..58b52a7 100644 (file)
@@ -1301,7 +1301,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
 #elif defined(Q_WS_QPA)
     if (desktopWidget) {
         int screen = desktopWidget->d_func()->topData()->screenIndex;
-        QPlatformIntegration *platform = QApplicationPrivate::platformIntegration();
+        QPlatformIntegration *platform = QGuiApplicationPrivate::platformIntegration();
         platform->moveToScreen(q, screen);
     }
 #else
index 0421c6b..8c55708 100644 (file)
@@ -101,7 +101,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
 
     if (!surface ) {
         if (win) {
-            surface = QApplicationPrivate::platformIntegration()->createWindowSurface(win, win->winId());
+            surface = QGuiApplicationPrivate::platformIntegration()->createWindowSurface(win, win->winId());
             q->setWindowSurface(surface);
         } else {
             q->setAttribute(Qt::WA_PaintOnScreen,true);
@@ -122,7 +122,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
         }
     }
 
-    QApplicationPrivate::platformIntegration()->moveToScreen(q, topData()->screenIndex);
+    QGuiApplicationPrivate::platformIntegration()->moveToScreen(q, topData()->screenIndex);
 //    qDebug() << "create_sys" << q << q->internalWinId();
 }
 
@@ -218,7 +218,7 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f)
             maybeTopData()->screenIndex = targetScreen;
         // only if it is already created
         if (q->testAttribute(Qt::WA_WState_Created)) {
-            QPlatformIntegration *platform = QApplicationPrivate::platformIntegration();
+            QPlatformIntegration *platform = QGuiApplicationPrivate::platformIntegration();
             platform->moveToScreen(q, targetScreen);
         }
     }
index 17afd53..92b62e9 100644 (file)
@@ -86,7 +86,7 @@ void QWindow::create()
 {
     Q_D(QWindow);
     if (!d->platformWindow) {
-        d->platformWindow = QApplicationPrivate::platformIntegration()->createPlatformWindow(this);
+        d->platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(this);
         d->windowFlags = d->platformWindow->setWindowFlags(d->windowFlags);
         if (!d->windowTitle.isNull())
             d->platformWindow->setWindowTitle(d->windowTitle);
index f2e7653..dd5dfda 100644 (file)
@@ -48,7 +48,7 @@
 #include "qpainter.h"
 #include "qhash.h"
 #include "qdatastream.h"
-#include "qapplication.h"
+#include "qguiapplication.h"
 #include "qstringlist.h"
 
 #include "qthread.h"
@@ -77,7 +77,7 @@
 #endif
 #ifdef Q_WS_QPA
 #include <QtGui/qplatformscreen_qpa.h>
-#include <QtGui/private/qapplication_p.h>
+#include <QtGui/private/qguiapplication_p.h>
 #endif
 
 #include <QMutexLocker>
@@ -180,9 +180,9 @@ Q_GUI_EXPORT int qt_defaultDpiX()
         screen = subScreens.at(0);
     dpi = qRound(screen->width() / (screen->physicalWidth() / qreal(25.4)));
 #elif defined(Q_WS_QPA)
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
     if (pi) {
-        QPlatformScreen *screen = QApplicationPrivate::platformIntegration()->screens().at(0);
+        QPlatformScreen *screen = pi->screens().at(0);
         const QSize screenSize = screen->geometry().size();
         const QSize physicalSize = screen->physicalSize();
         dpi = qRound(screenSize.width() / (physicalSize.width() / qreal(25.4)));
@@ -219,9 +219,9 @@ Q_GUI_EXPORT int qt_defaultDpiY()
         screen = subScreens.at(0);
     dpi = qRound(screen->height() / (screen->physicalHeight() / qreal(25.4)));
 #elif defined(Q_WS_QPA)
-    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
+    QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
     if (pi) {
-        QPlatformScreen *screen = QApplicationPrivate::platformIntegration()->screens().at(0);
+        QPlatformScreen *screen = pi->screens().at(0);
         const QSize screenSize = screen->geometry().size();
         const QSize physicalSize = screen->physicalSize();
         dpi = qRound(screenSize.height() / (physicalSize.height() / qreal(25.4)));
@@ -448,9 +448,9 @@ QFontEngineData::~QFontEngineData()
     Use QFontMetrics to get measurements, e.g. the pixel length of a
     string using QFontMetrics::width().
 
-    Note that a QApplication instance must exist before a QFont can be
+    Note that a QGuiApplication instance must exist before a QFont can be
     used. You can set the application's default font with
-    QApplication::setFont().
+    QGuiApplication::setFont().
 
     If a chosen font does not include all the characters that
     need to be displayed, QFont will try to find the characters in the
@@ -781,10 +781,10 @@ void QFont::detach()
 /*!
     Constructs a font object that uses the application's default font.
 
-    \sa QApplication::setFont(), QApplication::font()
+    \sa QGuiApplication::setFont(), QGuiApplication::font()
 */
 QFont::QFont()
-    : d(QApplication::font().d.data()), resolve_mask(0)
+    : d(QGuiApplication::font().d.data()), resolve_mask(0)
 {
 }
 
@@ -804,7 +804,7 @@ QFont::QFont()
     algorithm.
 
     \sa Weight, setFamily(), setPointSize(), setWeight(), setItalic(),
-    setStyleHint() QApplication::font()
+    setStyleHint() QGuiApplication::font()
 */
 QFont::QFont(const QString &family, int pointSize, int weight, bool italic)
     : d(new QFontPrivate()), resolve_mask(QFont::FamilyResolved)
index ff12da8..981c313 100644 (file)
 **
 ****************************************************************************/
 
-#include <QtGui/private/qapplication_p.h>
+#include <QtGui/private/qguiapplication_p.h>
 #include <QtGui/QPlatformFontDatabase>
 
 QT_BEGIN_NAMESPACE
 
 void QFont::initialize()
 {
-    QApplicationPrivate::platformIntegration()->fontDatabase()->populateFontDatabase();
+    QGuiApplicationPrivate::platformIntegration()->fontDatabase()->populateFontDatabase();
 }
 
 void QFont::cleanup()
@@ -90,7 +90,7 @@ QString QFont::defaultFamily() const
             familyName = QString::fromLatin1("helvetica");
     }
 
-    QStringList list = QApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(familyName,QFont::StyleNormal,QFont::StyleHint(d->request.styleHint),QUnicodeTables::Common);
+    QStringList list = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(familyName,QFont::StyleNormal,QFont::StyleHint(d->request.styleHint),QUnicodeTables::Common);
     if (list.size()) {
         familyName = list.at(0);
     }
index 36b0ea9..0381286 100644 (file)
@@ -43,7 +43,7 @@
 #include "qfontdatabase.h"
 #include "qdebug.h"
 #include "qalgorithms.h"
-#include "qapplication.h"
+#include "qguiapplication.h"
 #include "qvarlengtharray.h" // here or earlier - workaround for VC++6
 #include "qthread.h"
 #include "qmutex.h"
@@ -51,7 +51,7 @@
 #include "qfontengine_p.h"
 
 #ifdef Q_WS_QPA
-#include <QtGui/private/qapplication_p.h>
+#include <QtGui/private/qguiapplication_p.h>
 #include <QtGui/qplatformfontdatabase_qpa.h>
 #include "qabstractfileengine.h"
 #endif
@@ -103,34 +103,34 @@ static int getFontWeight(const QString &weightString)
     // Test in decreasing order of commonness
     if (s == QLatin1String("medium") ||
         s == QLatin1String("normal")
-        || s.compare(QApplication::translate("QFontDatabase", "Normal"), Qt::CaseInsensitive) == 0)
+        || s.compare(QCoreApplication::translate("QFontDatabase", "Normal"), Qt::CaseInsensitive) == 0)
         return QFont::Normal;
     if (s == QLatin1String("bold")
-        || s.compare(QApplication::translate("QFontDatabase", "Bold"), Qt::CaseInsensitive) == 0)
+        || s.compare(QCoreApplication::translate("QFontDatabase", "Bold"), Qt::CaseInsensitive) == 0)
         return QFont::Bold;
     if (s == QLatin1String("demibold") || s == QLatin1String("demi bold")
-        || s.compare(QApplication::translate("QFontDatabase", "Demi Bold"), Qt::CaseInsensitive) == 0)
+        || s.compare(QCoreApplication::translate("QFontDatabase", "Demi Bold"), Qt::CaseInsensitive) == 0)
         return QFont::DemiBold;
     if (s == QLatin1String("black")
-        || s.compare(QApplication::translate("QFontDatabase", "Black"), Qt::CaseInsensitive) == 0)
+        || s.compare(QCoreApplication::translate("QFontDatabase", "Black"), Qt::CaseInsensitive) == 0)
         return QFont::Black;
     if (s == QLatin1String("light"))
         return QFont::Light;
 
     if (s.contains(QLatin1String("bold"))
-        || s.contains(QApplication::translate("QFontDatabase", "Bold"), Qt::CaseInsensitive)) {
+        || s.contains(QCoreApplication::translate("QFontDatabase", "Bold"), Qt::CaseInsensitive)) {
         if (s.contains(QLatin1String("demi"))
-            || s.compare(QApplication::translate("QFontDatabase", "Demi"), Qt::CaseInsensitive) == 0)
+            || s.compare(QCoreApplication::translate("QFontDatabase", "Demi"), Qt::CaseInsensitive) == 0)
             return (int) QFont::DemiBold;
         return (int) QFont::Bold;
     }
 
     if (s.contains(QLatin1String("light"))
-        || s.compare(QApplication::translate("QFontDatabase", "Light"), Qt::CaseInsensitive) == 0)
+        || s.compare(QCoreApplication::translate("QFontDatabase", "Light"), Qt::CaseInsensitive) == 0)
         return (int) QFont::Light;
 
     if (s.contains(QLatin1String("black"))
-        || s.compare(QApplication::translate("QFontDatabase", "Black"), Qt::CaseInsensitive) == 0)
+        || s.compare(QCoreApplication::translate("QFontDatabase", "Black"), Qt::CaseInsensitive) == 0)
         return (int) QFont::Black;
 
     return (int) QFont::Normal;
@@ -264,7 +264,7 @@ struct QtFontStyle
             pixelSizes[count].fileName.~QByteArray();
 #endif
 #if defined (Q_WS_QPA)
-            QPlatformIntegration *integration = QApplicationPrivate::platformIntegration();
+            QPlatformIntegration *integration = QGuiApplicationPrivate::platformIntegration();
             if (integration) { //on shut down there will be some that we don't release.
                 integration->fontDatabase()->releaseHandle(pixelSizes[count].handle);
             }
@@ -297,10 +297,10 @@ QtFontStyle::Key::Key(const QString &styleString)
     weight = getFontWeight(styleString);
 
     if (styleString.contains(QLatin1String("Italic"))
-        || styleString.contains(QApplication::translate("QFontDatabase", "Italic")))
+        || styleString.contains(QCoreApplication::translate("QFontDatabase", "Italic")))
         style = QFont::StyleItalic;
     else if (styleString.contains(QLatin1String("Oblique"))
-             || styleString.contains(QApplication::translate("QFontDatabase", "Oblique")))
+             || styleString.contains(QCoreApplication::translate("QFontDatabase", "Oblique")))
         style = QFont::StyleOblique;
 }
 
@@ -748,7 +748,7 @@ void QFontDatabasePrivate::invalidate()
 {
     QFontCache::instance()->clear();
     free();
-    emit static_cast<QApplication *>(QApplication::instance())->fontDatabaseChanged();
+    emit static_cast<QGuiApplication *>(QCoreApplication::instance())->fontDatabaseChanged();
 }
 
 QtFontFamily *QFontDatabasePrivate::family(const QString &f, bool create)
@@ -1506,21 +1506,21 @@ static QString styleStringHelper(int weight, QFont::Style style)
 {
     QString result;
     if (weight >= QFont::Black)
-        result = QApplication::translate("QFontDatabase", "Black");
+        result = QCoreApplication::translate("QFontDatabase", "Black");
     else if (weight >= QFont::Bold)
-        result = QApplication::translate("QFontDatabase", "Bold");
+        result = QCoreApplication::translate("QFontDatabase", "Bold");
     else if (weight >= QFont::DemiBold)
-        result = QApplication::translate("QFontDatabase", "Demi Bold");
+        result = QCoreApplication::translate("QFontDatabase", "Demi Bold");
     else if (weight < QFont::Normal)
-        result = QApplication::translate("QFontDatabase", "Light");
+        result = QCoreApplication::translate("QFontDatabase", "Light");
 
     if (style == QFont::StyleItalic)
-        result += QLatin1Char(' ') + QApplication::translate("QFontDatabase", "Italic");
+        result += QLatin1Char(' ') + QCoreApplication::translate("QFontDatabase", "Italic");
     else if (style == QFont::StyleOblique)
-        result += QLatin1Char(' ') + QApplication::translate("QFontDatabase", "Oblique");
+        result += QLatin1Char(' ') + QCoreApplication::translate("QFontDatabase", "Oblique");
 
     if (result.isEmpty())
-        result = QApplication::translate("QFontDatabase", "Normal");
+        result = QCoreApplication::translate("QFontDatabase", "Normal");
 
     return result.simplified();
 }
@@ -2002,7 +2002,7 @@ QFont QFontDatabase::font(const QString &family, const QString &style,
 
     QtFontFoundry allStyles(foundryName);
     QtFontFamily *f = d->family(familyName);
-    if (!f) return QApplication::font();
+    if (!f) return QGuiApplication::font();
 
     for (int j = 0; j < f->count; j++) {
         QtFontFoundry *foundry = f->foundries[j];
@@ -2016,7 +2016,7 @@ QFont QFontDatabase::font(const QString &family, const QString &style,
     QtFontStyle *s = bestStyle(&allStyles, styleKey);
 
     if (!s) // no styles found?
-        return QApplication::font();
+        return QGuiApplication::font();
     QFont fnt(family, pointSize, s->key.weight);
     fnt.setStyle((QFont::Style)s->key.style);
     return fnt;
@@ -2326,7 +2326,7 @@ QString QFontDatabase::writingSystemName(WritingSystem writingSystem)
         Q_ASSERT_X(false, "QFontDatabase::writingSystemName", "invalid 'writingSystem' parameter");
         break;
     }
-    return QApplication::translate("QFontDatabase", name);
+    return QCoreApplication::translate("QFontDatabase", name);
 }
 
 
index 7bcce56..fcf87f6 100644 (file)
@@ -45,7 +45,7 @@
 #include "qfontengine_qpa_p.h"
 #include "qplatformdefs.h"
 
-#include <QtGui/private/qapplication_p.h>
+#include <QtGui/private/qguiapplication_p.h>
 #include <QtGui/qplatformfontdatabase_qpa.h>
 
 #include <QtCore/qmath.h>
@@ -82,7 +82,7 @@ Q_GUI_EXPORT  void qt_registerFont(const QString &familyName, const QString &fou
 
 static QStringList fallbackFamilies(const QString &family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script)
 {
-    QStringList retList = QApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(family,style,styleHint,script);
+    QStringList retList = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fallbacksForFamily(family,style,styleHint,script);
     QFontDatabasePrivate *db = privateDb();
 
     QStringList::iterator i;
@@ -109,28 +109,11 @@ static void initializeDb()
 
     if (!initialized) {
         //init by asking for the platformfontdb for the first time :)
-        QApplicationPrivate::platformIntegration()->fontDatabase()->populateFontDatabase();
+        QGuiApplicationPrivate::platformIntegration()->fontDatabase()->populateFontDatabase();
         initialized = true;
     }
 }
 
-#ifndef QT_NO_SETTINGS
-// called from qapplication_qws.cpp
-void qt_applyFontDatabaseSettings(const QSettings &settings)
-{
-    initializeDb();
-    QFontDatabasePrivate *db = privateDb();
-    for (int i = 0; i < db->count; ++i) {
-        QtFontFamily *family = db->families[i];
-        if (settings.contains(family->name))
-            family->fallbackFamilies = settings.value(family->name).toStringList();
-    }
-
-    if (settings.contains(QLatin1String("Global Fallbacks")))
-        db->fallbackFamilies = settings.value(QLatin1String("Global Fallbacks")).toStringList();
-}
-#endif // QT_NO_SETTINGS
-
 static inline void load(const QString & = QString(), int = -1)
 {
     initializeDb();
@@ -155,7 +138,7 @@ QFontEngine *loadSingleEngine(int script,
     QFontCache::Key key(def,script);
     QFontEngine *engine = QFontCache::instance()->findEngine(key);
     if (!engine) {
-        QPlatformFontDatabase *pfdb = QApplicationPrivate::platformIntegration()->fontDatabase();
+        QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase();
         engine = pfdb->fontEngine(def,QUnicodeTables::Script(script),size->handle);
         if (engine) {
             QFontCache::Key key(def,script);
@@ -200,7 +183,7 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
 {
     QFontDatabasePrivate *db = privateDb();
 
-    fnt->families = QApplicationPrivate::platformIntegration()->fontDatabase()->addApplicationFont(fnt->data,fnt->fileName);
+    fnt->families = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->addApplicationFont(fnt->data,fnt->fileName);
 
     db->reregisterAppFonts = true;
 }
@@ -360,7 +343,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
         family_list = familyList(req);
 
         // add the default family
-        QString defaultFamily = QApplication::font().family();
+        QString defaultFamily = QGuiApplication::font().family();
         if (! family_list.contains(defaultFamily))
             family_list << defaultFamily;