summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2015-02-02 18:49:18 +0100
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-02-03 11:49:14 +0000
commitc5db8fc74a9d437a4e7c0af077aed7c1f1bd4e26 (patch)
treef7d42e0be35dd0ed85e74eaecdbbad4f319bc1d1 /src/widgets/styles
parent611bcc3cd337fe77ea5d3b898d897582da6f7ee2 (diff)
Make it more obvious that Q_WS_ is dead code, and should perhaps be ported
We still have a bunch of Q_WS_ ifdefs in our code, which are easy to mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming the ifdefs we make it clear that the code in question is dead. In incremental follow-ups, we can then selectively either remove, or port, the pieces that are dead code. Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qmacstyle_mac_p.h2
-rw-r--r--src/widgets/styles/qstylefactory.cpp4
-rw-r--r--src/widgets/styles/qstyleoption.cpp2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp2
-rw-r--r--src/widgets/styles/qwindowscestyle.cpp6
-rw-r--r--src/widgets/styles/qwindowsmobilestyle.cpp6
6 files changed, 11 insertions, 11 deletions
diff --git a/src/widgets/styles/qmacstyle_mac_p.h b/src/widgets/styles/qmacstyle_mac_p.h
index a59de07752..259900539b 100644
--- a/src/widgets/styles/qmacstyle_mac_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p.h
@@ -127,7 +127,7 @@ private:
friend bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option);
};
-#endif // Q_WS_MAC
+#endif // Q_DEAD_CODE_FROM_QT4_MAC
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp
index c4f1cb1d4a..041d0d7a11 100644
--- a/src/widgets/styles/qstylefactory.cpp
+++ b/src/widgets/styles/qstylefactory.cpp
@@ -151,7 +151,7 @@ QStyle *QStyleFactory::create(const QString& key)
#ifndef QT_NO_STYLE_MAC
if (style.startsWith(QLatin1String("macintosh"))) {
ret = new QMacStyle;
-# ifdef Q_WS_MAC
+# ifdef Q_DEAD_CODE_FROM_QT4_MAC
if (style == QLatin1String("macintosh"))
style += QLatin1String(" (aqua)");
# endif
@@ -220,7 +220,7 @@ QStringList QStyleFactory::keys()
#endif
#ifndef QT_NO_STYLE_MAC
QString mstyle = QLatin1String("Macintosh");
-# ifdef Q_WS_MAC
+# ifdef Q_DEAD_CODE_FROM_QT4_MAC
mstyle += QLatin1String(" (aqua)");
# endif
if (!list.contains(mstyle))
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index 027e36387a..ea8ba3ea9b 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -193,7 +193,7 @@ void QStyleOption::init(const QWidget *widget)
state |= QStyle::State_Active;
if (widget->isWindow())
state |= QStyle::State_Window;
-#ifdef Q_WS_MAC
+#ifdef Q_DEAD_CODE_FROM_QT4_MAC
extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp
if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
state &= ~QStyle::State_Enabled;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index ea51d4989e..8f0ac04da3 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4956,7 +4956,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
sz = csz + QSize(vertical ? 0 : spaceForIcon, vertical ? spaceForIcon : 0);
return subRule.boxSize(subRule.adjustSize(sz));
}
-#ifdef Q_WS_MAC
+#ifdef Q_DEAD_CODE_FROM_QT4_MAC
if (baseStyle()->inherits("QMacStyle")) {
//adjust the size after the call to the style because the mac style ignore the size arguments anyway.
//this might cause the (max-){width,height} property to include the native style border while they should not.
diff --git a/src/widgets/styles/qwindowscestyle.cpp b/src/widgets/styles/qwindowscestyle.cpp
index d3a8877d00..0c46e69fb7 100644
--- a/src/widgets/styles/qwindowscestyle.cpp
+++ b/src/widgets/styles/qwindowscestyle.cpp
@@ -2222,7 +2222,7 @@ int QWindowsCEStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const
case PM_DockWidgetTitleMargin:
ret = 2;
break;
-#if defined(Q_WS_WIN)
+#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
// case PM_DockWidgetFrameWidth:
// ret = GetSystemMetrics(SM_CXFRAME);
// break;
@@ -2230,7 +2230,7 @@ int QWindowsCEStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const
case PM_DockWidgetFrameWidth:
ret = 4;
break;
-#endif // Q_WS_WIN
+#endif // Q_DEAD_CODE_FROM_QT4_WIN
break;
#endif // QT_NO_MENU
@@ -2245,7 +2245,7 @@ int QWindowsCEStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const
ret = qMax(4, QApplication::globalStrut().width());
break;
-#if defined(Q_WS_WIN)
+#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
case PM_MDIFrameWidth:
ret = 3;
break;
diff --git a/src/widgets/styles/qwindowsmobilestyle.cpp b/src/widgets/styles/qwindowsmobilestyle.cpp
index a94c62f37d..4c230923a5 100644
--- a/src/widgets/styles/qwindowsmobilestyle.cpp
+++ b/src/widgets/styles/qwindowsmobilestyle.cpp
@@ -7044,12 +7044,12 @@ int QWindowsMobileStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, co
case PM_DockWidgetTitleMargin:
ret = 2;
break;
-#if defined(Q_WS_WIN)
+#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
#else
case PM_DockWidgetFrameWidth:
ret = 4;
break;
-#endif // Q_WS_WIN
+#endif // Q_DEAD_CODE_FROM_QT4_WIN
break;
#endif // QT_NO_MENU
@@ -7101,7 +7101,7 @@ int QWindowsMobileStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, co
ret = qMax(4, QApplication::globalStrut().width());
break;
-#if defined(Q_WS_WIN)
+#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
case PM_MDIFrameWidth:
ret = 1;
break;