From 23068fb2b0f9aa18f3c79f4f30fe4abe43c6fbcb Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 2 Jun 2014 17:26:43 +0200 Subject: [PATCH] Avoid references to QApplication They cause problems when running in QGuiApplication REVIEW: 118470 --- src/declarativeimports/core/units.cpp | 4 ++-- src/plasma/private/theme_p.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/declarativeimports/core/units.cpp b/src/declarativeimports/core/units.cpp index 0f20b8eb2..ad7ed6c11 100644 --- a/src/declarativeimports/core/units.cpp +++ b/src/declarativeimports/core/units.cpp @@ -20,7 +20,7 @@ #include "units.h" -#include +#include #include #include #include @@ -55,7 +55,7 @@ Units::Units(QObject *parent) themeChanged(); connect(&m_theme, SIGNAL(themeChanged()), this, SLOT(themeChanged())); - qApp->installEventFilter(this); + QCoreApplication::instance()->installEventFilter(this); const QString configFile = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + plasmarc; KDirWatch::self()->addFile(configFile); diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index 56c7132c8..dd0104e08 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -22,7 +22,7 @@ #include "framesvg.h" #include "framesvg_p.h" -#include +#include #include #include #include @@ -97,7 +97,7 @@ ThemePrivate::ThemePrivate(QObject *parent) QObject::connect(s_blurEffectWatcher, SIGNAL(effectChanged(bool)), this, SLOT(blurBehindChanged(bool))); #endif } - qApp->installEventFilter(this); + QCoreApplication::instance()->installEventFilter(this); const QString configFile = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + themeRcFile; KDirWatch::self()->addFile(configFile); @@ -414,7 +414,7 @@ const QString ThemePrivate::processStyleSheet(const QString &css) elements[QStringLiteral("%viewhovercolor")] = color(Theme::ViewHoverColor).name(); elements[QStringLiteral("%viewfocuscolor")] = color(Theme::ViewFocusColor).name(); - QFont font = QApplication::font(); + QFont font = QGuiApplication::font(); elements[QStringLiteral("%fontsize")] = QStringLiteral("%1pt").arg(font.pointSize()); elements[QStringLiteral("%fontfamily")] = font.family().split('[').first(); elements[QStringLiteral("%smallfontsize")] = QString("%1pt").arg(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont).pointSize());