summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylefactory.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-18 14:10:35 +0100
committerLars Knoll <lars.knoll@qt.io>2016-11-29 19:04:48 +0000
commit7d12ef183ee6b7909c451a3042ecf8b1fc20f87f (patch)
treefdb717743892cbacb91340e1f9c30a02072a9705 /src/widgets/styles/qstylefactory.cpp
parente3555fe9705a44072a05b95cca36579745e14125 (diff)
Clean up style selection code
Turn styles into proper features and test for them using qtConfig/QT_CONFIG. Change-Id: I7e28785a46723364b90d8aa286f4d6e5ab085651 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/styles/qstylefactory.cpp')
-rw-r--r--src/widgets/styles/qstylefactory.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp
index 09cccff4e8..8dc603f8e6 100644
--- a/src/widgets/styles/qstylefactory.cpp
+++ b/src/widgets/styles/qstylefactory.cpp
@@ -44,20 +44,20 @@
#include "qapplication.h"
#include "qwindowsstyle_p.h"
-#ifndef QT_NO_STYLE_FUSION
+#if QT_CONFIG(style_fusion)
#include "qfusionstyle_p.h"
-#ifndef QT_NO_STYLE_ANDROID
+#if QT_CONFIG(style_android)
#include "qandroidstyle_p.h"
#endif
#endif
-#ifndef QT_NO_STYLE_WINDOWSXP
+#if QT_CONFIG(style_windowsxp)
#include "qwindowsxpstyle_p.h"
#endif
-#ifndef QT_NO_STYLE_WINDOWSVISTA
+#if QT_CONFIG(style_windowsvista)
#include "qwindowsvistastyle_p.h"
#endif
-#if !defined(QT_NO_STYLE_MAC) && defined(Q_OS_MAC)
+#if QT_CONFIG(style_mac)
# include "qmacstyle_mac_p.h"
#endif
@@ -103,32 +103,32 @@ QStyle *QStyleFactory::create(const QString& key)
{
QStyle *ret = 0;
QString style = key.toLower();
-#ifndef QT_NO_STYLE_WINDOWS
+#if QT_CONFIG(style_windows)
if (style == QLatin1String("windows"))
ret = new QWindowsStyle;
else
#endif
-#ifndef QT_NO_STYLE_WINDOWSXP
+#if QT_CONFIG(style_windowsxp)
if (style == QLatin1String("windowsxp"))
ret = new QWindowsXPStyle;
else
#endif
-#ifndef QT_NO_STYLE_WINDOWSVISTA
+#if QT_CONFIG(style_windowsvista)
if (style == QLatin1String("windowsvista"))
ret = new QWindowsVistaStyle;
else
#endif
-#ifndef QT_NO_STYLE_FUSION
+#if QT_CONFIG(style_fusion)
if (style == QLatin1String("fusion"))
ret = new QFusionStyle;
else
#endif
-#ifndef QT_NO_STYLE_ANDROID
+#if QT_CONFIG(style_android)
if (style == QLatin1String("android"))
ret = new QAndroidStyle;
else
#endif
-#ifndef QT_NO_STYLE_MAC
+#if QT_CONFIG(style_mac)
if (style.startsWith(QLatin1String("macintosh"))) {
ret = new QMacStyle;
# if 0 // Used to be included in Qt4 for Q_WS_MAC
@@ -160,29 +160,29 @@ QStringList QStyleFactory::keys()
const PluginKeyMap::const_iterator cend = keyMap.constEnd();
for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it)
list.append(it.value());
-#ifndef QT_NO_STYLE_WINDOWS
+#if QT_CONFIG(style_windows)
if (!list.contains(QLatin1String("Windows")))
list << QLatin1String("Windows");
#endif
-#ifndef QT_NO_STYLE_WINDOWSXP
+#if QT_CONFIG(style_windowsxp)
if (!list.contains(QLatin1String("WindowsXP")) &&
(QSysInfo::WindowsVersion >= QSysInfo::WV_XP && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)))
list << QLatin1String("WindowsXP");
#endif
-#ifndef QT_NO_STYLE_WINDOWSVISTA
+#if QT_CONFIG(style_windowsvista)
if (!list.contains(QLatin1String("WindowsVista")) &&
(QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)))
list << QLatin1String("WindowsVista");
#endif
-#ifndef QT_NO_STYLE_ANDROID
+#if QT_CONFIG(style_android)
if (!list.contains(QLatin1String("Android")))
list << QLatin1String("Android");
#endif
-#ifndef QT_NO_STYLE_FUSION
+#if QT_CONFIG(style_fusion)
if (!list.contains(QLatin1String("Fusion")))
list << QLatin1String("Fusion");
#endif
-#ifndef QT_NO_STYLE_MAC
+#if QT_CONFIG(style_mac)
QString mstyle = QLatin1String("Macintosh");
# if 0 // Used to be included in Qt4 for Q_WS_MAC
mstyle += QLatin1String(" (aqua)");