diff options
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qandroidstyle.cpp | 13 | ||||
-rw-r--r-- | src/widgets/styles/qandroidstyle_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 18 | ||||
-rw-r--r-- | src/widgets/styles/qfusionstyle_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/qfusionstyle_p_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac_p.h | 2 | ||||
-rw-r--r-- | src/widgets/styles/qpixmapstyle.cpp | 11 | ||||
-rw-r--r-- | src/widgets/styles/qstylefactory.cpp | 34 | ||||
-rw-r--r-- | src/widgets/styles/qstyleoption.cpp | 5 | ||||
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 8 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle_p_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle.cpp | 5 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle_p_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsxpstyle_p_p.h | 4 | ||||
-rw-r--r-- | src/widgets/styles/styles.pri | 38 |
20 files changed, 82 insertions, 94 deletions
diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp index 743166549b..110153d0f6 100644 --- a/src/widgets/styles/qandroidstyle.cpp +++ b/src/widgets/styles/qandroidstyle.cpp @@ -39,7 +39,7 @@ #include "qandroidstyle_p.h" -#if !defined(QT_NO_STYLE_ANDROID) || defined(QT_PLUGIN) +#if QT_CONFIG(style_android) || defined(QT_PLUGIN) #include <QFile> #include <QFont> @@ -1606,15 +1606,14 @@ void QAndroidStyle::AndroidProgressBarControl::drawControl(const QStyleOption *o if (!m_progressDrawable) return; - if (const QStyleOptionProgressBar *progressBarOption = - qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { + if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) { if (m_progressDrawable->type() == QAndroidStyle::Layer) { - const double fraction = progressBarOption->progress / double(progressBarOption->maximum - progressBarOption->minimum); + const double fraction = double(qint64(pb->progress) - pb->minimum) / (qint64(pb->maximum) - pb->minimum); QAndroidStyle::AndroidDrawable *clipDrawable = static_cast<QAndroidStyle::AndroidLayerDrawable *>(m_progressDrawable)->layer(m_progressId); if (clipDrawable->type() == QAndroidStyle::Clip) - static_cast<AndroidClipDrawable *>(clipDrawable)->setFactor(fraction, progressBarOption->orientation); + static_cast<AndroidClipDrawable *>(clipDrawable)->setFactor(fraction, pb->orientation); else - static_cast<AndroidLayerDrawable *>(m_progressDrawable)->setFactor(m_progressId, fraction, progressBarOption->orientation); + static_cast<AndroidLayerDrawable *>(m_progressDrawable)->setFactor(m_progressId, fraction, pb->orientation); } m_progressDrawable->draw(p, option); } @@ -1807,4 +1806,4 @@ QRect QAndroidStyle::AndroidSpinnerControl::subControlRect(const QStyleOptionCom QT_END_NAMESPACE -#endif // !defined(QT_NO_STYLE_ANDROID) || defined(QT_PLUGIN) +#endif // QT_CONFIG(style_android) || defined(QT_PLUGIN) diff --git a/src/widgets/styles/qandroidstyle_p.h b/src/widgets/styles/qandroidstyle_p.h index 4649d90852..caff0afada 100644 --- a/src/widgets/styles/qandroidstyle_p.h +++ b/src/widgets/styles/qandroidstyle_p.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_STYLE_ANDROID) +#if QT_CONFIG(style_android) class Q_WIDGETS_EXPORT QAndroidStyle : public QFusionStyle { @@ -388,7 +388,7 @@ private: AndroidCompoundButtonControl *checkBoxControl; }; -#endif // QT_NO_STYLE_ANDROID +#endif // style_android QT_END_NAMESPACE diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 3473ec7fb0..c2b4ef382b 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -40,7 +40,7 @@ #include "qfusionstyle_p.h" #include "qfusionstyle_p_p.h" -#if !defined(QT_NO_STYLE_FUSION) || defined(QT_PLUGIN) +#if QT_CONFIG(style_fusion) || defined(QT_PLUGIN) #include "qcommonstyle_p.h" #include <qcombobox.h> #include <qpushbutton.h> @@ -1352,10 +1352,11 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio } int maxWidth = rect.width(); - int minWidth = 0; - qreal progress = qMax(bar->progress, bar->minimum); // workaround for bug in QProgressBar - int progressBarWidth = (progress - bar->minimum) * qreal(maxWidth) / qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); - int width = indeterminate ? maxWidth : qMax(minWidth, progressBarWidth); + const auto progress = qMax(bar->progress, bar->minimum); // workaround for bug in QProgressBar + const auto totalSteps = qMax(Q_INT64_C(1), qint64(bar->maximum) - bar->minimum); + const auto progressSteps = qint64(progress) - bar->minimum; + const auto progressBarWidth = progressSteps * maxWidth / totalSteps; + int width = indeterminate ? maxWidth : progressBarWidth; bool reverse = (!vertical && (bar->direction == Qt::RightToLeft)) || vertical; if (inverted) @@ -1450,8 +1451,9 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio inverted = bar->invertedAppearance; if (vertical) rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height - const int progressIndicatorPos = (bar->progress - qreal(bar->minimum)) * rect.width() / - qMax(qreal(1.0), qreal(bar->maximum) - bar->minimum); + const auto totalSteps = qMax(Q_INT64_C(1), qint64(bar->maximum) - bar->minimum); + const auto progressSteps = qint64(bar->progress) - bar->minimum; + const auto progressIndicatorPos = progressSteps * rect.width() / totalSteps; if (progressIndicatorPos >= 0 && progressIndicatorPos <= rect.width()) leftRect = QRect(rect.left(), rect.top(), progressIndicatorPos, rect.height()); if (vertical) @@ -3746,4 +3748,4 @@ QT_END_NAMESPACE #include "moc_qfusionstyle_p.cpp" -#endif // QT_NO_STYLE_FUSION || QT_PLUGIN +#endif // style_fusion|| QT_PLUGIN diff --git a/src/widgets/styles/qfusionstyle_p.h b/src/widgets/styles/qfusionstyle_p.h index 126fb96e78..aac27e51ab 100644 --- a/src/widgets/styles/qfusionstyle_p.h +++ b/src/widgets/styles/qfusionstyle_p.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_STYLE_FUSION) +#if QT_CONFIG(style_fusion) class QFusionStylePrivate; class QFusionStyle : public QCommonStyle @@ -110,7 +110,7 @@ protected: }; -#endif // QT_NO_STYLE_FUSION +#endif // style_fusion QT_END_NAMESPACE diff --git a/src/widgets/styles/qfusionstyle_p_p.h b/src/widgets/styles/qfusionstyle_p_p.h index 8d1d27d244..169fd9a407 100644 --- a/src/widgets/styles/qfusionstyle_p_p.h +++ b/src/widgets/styles/qfusionstyle_p_p.h @@ -57,7 +57,7 @@ #include <qpa/qplatformtheme.h> #include "private/qguiapplication_p.h" -#ifndef QT_NO_STYLE_FUSION +#if QT_CONFIG(style_fusion) QT_BEGIN_NAMESPACE @@ -147,6 +147,6 @@ public: QT_END_NAMESPACE -#endif // QT_NO_STYLE_FUSION +#endif // style_fusion #endif //QFUSIONSTYLE_P_P_H diff --git a/src/widgets/styles/qmacstyle_mac_p.h b/src/widgets/styles/qmacstyle_mac_p.h index 459784c538..3642424a14 100644 --- a/src/widgets/styles/qmacstyle_mac_p.h +++ b/src/widgets/styles/qmacstyle_mac_p.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) +#if QT_CONFIG(style_mac) class QPalette; diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index e973a96a91..ce37065fb6 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -819,11 +819,14 @@ void QPixmapStyle::drawProgressBarFill(const QStyleOption *option, drawCachedPixmap(vertical ? PB_VComplete : PB_HComplete, option->rect, painter); } else { - if (pbar->progress == 0) + if (pbar->progress == pbar->minimum) return; - const int maximum = pbar->maximum; - const qreal ratio = qreal(vertical?option->rect.height():option->rect.width())/maximum; - const int progress = pbar->progress*ratio; + const auto totalSteps = qint64(pbar->maximum) - pbar->minimum; + const auto progressSteps = qint64(pbar->progress) - pbar->minimum; + const auto availablePixels = vertical ? option->rect.height() : option->rect.width(); + const auto pixelsPerStep = double(availablePixels) / totalSteps; + + const auto progress = static_cast<int>(progressSteps * pixelsPerStep); // width in pixels QRect optRect = option->rect; if (vertical) { 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)"); diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 83739655af..c12b3285f1 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -37,9 +37,10 @@ ** ****************************************************************************/ +#include <QtWidgets/private/qtwidgetsglobal_p.h> #include "qstyleoption.h" #include "qapplication.h" -#ifdef Q_OS_MAC +#if QT_CONFIG(style_mac) # include "qmacstyle_mac_p.h" #endif #include <qdebug.h> @@ -204,7 +205,7 @@ void QStyleOption::init(const QWidget *widget) if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget)) state &= ~QStyle::State_Enabled; #endif -#if defined(Q_OS_OSX) && !defined(QT_NO_STYLE_MAC) +#if QT_CONFIG(style_mac) switch (QMacStyle::widgetSizePolicy(widget)) { case QMacStyle::SizeSmall: state |= QStyle::State_Small; diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 8e77ae0e44..68ee8c22d3 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3903,8 +3903,8 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q if (inverted) reverse = !reverse; const bool indeterminate = pb->minimum == pb->maximum; - qreal fillRatio = indeterminate ? 0.50 : qreal(progress - minimum)/(maximum - minimum); - int fillWidth = int(rect.width() * fillRatio); + const auto fillRatio = indeterminate ? 0.50 : double(progress - minimum) / (maximum - minimum); + const auto fillWidth = static_cast<int>(rect.width() * fillRatio); int chunkWidth = fillWidth; if (subRule.hasContentsSize()) { QSize sz = subRule.size(); @@ -5542,9 +5542,9 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp } else { sliderlen = maxlen; } - + const int sliderPosition = sb->orientation == Qt::Horizontal && sb->direction == Qt::RightToLeft ? sb->maximum - sb->sliderPosition + sb->minimum : sb->sliderPosition; int sliderstart = (styleOptionSlider.orientation == Qt::Horizontal ? contentRect.left() : contentRect.top()) - + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition, + + sliderPositionFromValue(sb->minimum, sb->maximum, sliderPosition, maxlen - sliderlen, sb->upsideDown); QRect sr = (sb->orientation == Qt::Horizontal) diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index e3bf28608c..a8ee881a30 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -40,7 +40,7 @@ #include "qwindowsstyle_p.h" #include "qwindowsstyle_p_p.h" -#if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) +#if QT_CONFIG(style_windows) || defined(QT_PLUGIN) #include "qapplication.h" #include "qbitmap.h" @@ -2407,4 +2407,4 @@ QT_END_NAMESPACE #include "moc_qwindowsstyle_p.cpp" -#endif // QT_NO_STYLE_WINDOWS +#endif // style_windows diff --git a/src/widgets/styles/qwindowsstyle_p.h b/src/widgets/styles/qwindowsstyle_p.h index 5d68bfeba0..a1d65610ff 100644 --- a/src/widgets/styles/qwindowsstyle_p.h +++ b/src/widgets/styles/qwindowsstyle_p.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_STYLE_WINDOWS) +#if QT_CONFIG(style_windows) class QWindowsStylePrivate; @@ -106,7 +106,7 @@ private: Q_DECLARE_PRIVATE(QWindowsStyle) }; -#endif // QT_NO_STYLE_WINDOWS +#endif // style_windows QT_END_NAMESPACE diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h index 0c23f4b4a8..5023fd1042 100644 --- a/src/widgets/styles/qwindowsstyle_p_p.h +++ b/src/widgets/styles/qwindowsstyle_p_p.h @@ -55,7 +55,7 @@ #include "qwindowsstyle_p.h" #include "qcommonstyle_p.h" -#ifndef QT_NO_STYLE_WINDOWS +#if QT_CONFIG(style_windows) #include <qlist.h> QT_BEGIN_NAMESPACE @@ -103,7 +103,7 @@ private: QT_END_NAMESPACE -#endif // QT_NO_STYLE_WINDOWS +#endif // style_windows #endif //QWINDOWSSTYLE_P_P_H ; diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index bf5aad0187..7f52d3d2f3 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -46,7 +46,7 @@ #include <private/qapplication_p.h> #include <qpa/qplatformnativeinterface.h> -#if !defined(QT_NO_STYLE_WINDOWSVISTA) || defined(QT_PLUGIN) +#if QT_CONFIG(style_windowsvista) || defined(QT_PLUGIN) QT_BEGIN_NAMESPACE @@ -1871,8 +1871,7 @@ QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption case CT_MenuBarItem: if (!sz.isEmpty()) sz += QSize(windowsItemHMargin * 5 + 1, 5); - return sz; - break; + return sz; #endif case CT_ItemViewItem: sz = QWindowsXPStyle::sizeFromContents(type, option, size, widget); diff --git a/src/widgets/styles/qwindowsvistastyle_p.h b/src/widgets/styles/qwindowsvistastyle_p.h index 0289f404dd..8fbd1dc380 100644 --- a/src/widgets/styles/qwindowsvistastyle_p.h +++ b/src/widgets/styles/qwindowsvistastyle_p.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_STYLE_WINDOWSVISTA) +#if QT_CONFIG(style_windowsvista) class QWindowsVistaStylePrivate; class QWindowsVistaStyle : public QWindowsXPStyle @@ -103,7 +103,7 @@ private: Q_DECLARE_PRIVATE(QWindowsVistaStyle) friend class QStyleFactory; }; -#endif //QT_NO_STYLE_WINDOWSVISTA +#endif // style_windowsvista QT_END_NAMESPACE diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h index 4ca47fec2c..18b6f9c3f7 100644 --- a/src/widgets/styles/qwindowsvistastyle_p_p.h +++ b/src/widgets/styles/qwindowsvistastyle_p_p.h @@ -54,7 +54,7 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> #include "qwindowsvistastyle_p.h" -#if !defined(QT_NO_STYLE_WINDOWSVISTA) +#if QT_CONFIG(style_windowsvista) #include <private/qwindowsxpstyle_p_p.h> #include <private/qstyleanimation_p.h> #include <private/qpaintengine_raster_p.h> @@ -177,6 +177,6 @@ public: QT_END_NAMESPACE -#endif // QT_NO_STYLE_WINDOWSVISTA +#endif // style_windowsvista #endif // QWINDOWSVISTASTYLE_P_P_H diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 4ce359a7c4..f999d823e0 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -39,7 +39,7 @@ #include "qwindowsxpstyle_p.h" #include "qwindowsxpstyle_p_p.h" -#if !defined(QT_NO_STYLE_WINDOWSXP) || defined(QT_PLUGIN) +#if QT_CONFIG(style_windowsxp) || defined(QT_PLUGIN) #include <private/qobject_p.h> #include <private/qpaintengine_raster_p.h> diff --git a/src/widgets/styles/qwindowsxpstyle_p.h b/src/widgets/styles/qwindowsxpstyle_p.h index 088178cb5a..62e3af927c 100644 --- a/src/widgets/styles/qwindowsxpstyle_p.h +++ b/src/widgets/styles/qwindowsxpstyle_p.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_STYLE_WINDOWSXP) +#if QT_CONFIG(style_windowsxp) class QWindowsXPStylePrivate; class QWindowsXPStyle : public QWindowsStyle @@ -102,7 +102,7 @@ private: friend class QStyleFactory; }; -#endif // QT_NO_STYLE_WINDOWSXP +#endif // style_windowsxp QT_END_NAMESPACE diff --git a/src/widgets/styles/qwindowsxpstyle_p_p.h b/src/widgets/styles/qwindowsxpstyle_p_p.h index d6702c8803..fb5210cb07 100644 --- a/src/widgets/styles/qwindowsxpstyle_p_p.h +++ b/src/widgets/styles/qwindowsxpstyle_p_p.h @@ -94,7 +94,7 @@ QT_BEGIN_NAMESPACE // Uncomment define below to build debug assisting code, and output // #define DEBUG_XP_STYLE -#if !defined(QT_NO_STYLE_WINDOWSXP) +#if QT_CONFIG(style_windowsxp) // Declarations ----------------------------------------------------------------------------------- class XPThemeData @@ -338,7 +338,7 @@ inline QMarginsF XPThemeData::themeMargins(const QWidget *w, QPainter *p, int th return theme.margins(propId); } -#endif // QT_NO_STYLE_WINDOWS +#endif // style_windows QT_END_NAMESPACE diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index 69e13fb6ec..481123f0d4 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -37,51 +37,35 @@ RESOURCES += styles/qstyle.qrc include($$OUT_PWD/qtwidgets-config.pri) -contains( styles, mac ) { +qtConfig(style-mac) { HEADERS += \ styles/qmacstyle_mac_p.h \ styles/qmacstyle_mac_p_p.h OBJECTIVE_SOURCES += styles/qmacstyle_mac.mm LIBS_PRIVATE += -framework Carbon -} else { - DEFINES += QT_NO_STYLE_MAC } -contains( styles, windowsvista ) { - HEADERS += styles/qwindowsvistastyle_p.h - HEADERS += styles/qwindowsvistastyle_p_p.h +qtConfig(style-windowsvista) { + HEADERS += styles/qwindowsvistastyle_p.h styles/qwindowsvistastyle_p_p.h SOURCES += styles/qwindowsvistastyle.cpp -} else { - DEFINES += QT_NO_STYLE_WINDOWSVISTA } -contains( styles, windowsxp ) { - HEADERS += styles/qwindowsxpstyle_p.h - HEADERS += styles/qwindowsxpstyle_p_p.h +qtConfig(style-windowsxp) { + HEADERS += styles/qwindowsxpstyle_p.h styles/qwindowsxpstyle_p_p.h SOURCES += styles/qwindowsxpstyle.cpp -} else { - DEFINES += QT_NO_STYLE_WINDOWSXP } -contains( styles, windows ) { - HEADERS += styles/qwindowsstyle_p.h - HEADERS += styles/qwindowsstyle_p_p.h +qtConfig(style-windows) { + HEADERS += styles/qwindowsstyle_p.h styles/qwindowsstyle_p_p.h SOURCES += styles/qwindowsstyle.cpp -} else { - DEFINES += QT_NO_STYLE_WINDOWS } -contains( styles, fusion ) { - HEADERS += styles/qfusionstyle_p.h - HEADERS += styles/qfusionstyle_p_p.h - SOURCES += styles/qfusionstyle.cpp -} else { - DEFINES += QT_NO_STYLE_FUSION +qtConfig(style-fusion) { + HEADERS += styles/qfusionstyle_p.h styles/qfusionstyle_p_p.h + SOURCES += styles/qfusionstyle.cpp } -contains( styles, android ) { +qtConfig(style-android) { HEADERS += styles/qandroidstyle_p.h SOURCES += styles/qandroidstyle.cpp -} else { - DEFINES += QT_NO_STYLE_ANDROID } |