summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-07-09 11:04:38 +0200
committerStephan Binner <stephan.binner@basyskom.com>2017-07-11 02:52:25 +0000
commit3835194d340f8756d2ac7a5f9ae2a3519cb891b9 (patch)
tree63fa52aabac01d835340b94a9ac8c146ac6fc110 /src/widgets/styles
parent3906043f05d2ffccede47f845561cca95548ac5a (diff)
Convert features.rubberband to QT_[REQUIRE_]CONFIG
Change-Id: I6d634bafa6d26c1e78069fddd412e6de24f5775c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp10
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h2
-rw-r--r--src/widgets/styles/qstyleoption.cpp4
-rw-r--r--src/widgets/styles/qstyleoption.h6
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp10
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp12
7 files changed, 28 insertions, 18 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index ad3ba88756..56f9bfb3e7 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -68,7 +68,9 @@
#include <qtabwidget.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
+#if QT_CONFIG(rubberband)
#include <qrubberband.h>
+#endif
#include "qtreeview.h"
#include <private/qcommonstylepixmaps_p.h>
#include <private/qmath_p.h>
@@ -2002,7 +2004,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
p->restore();
break; }
#endif // QT_NO_SIZEGRIP
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
case CE_RubberBand: {
if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
QPixmap tiledPixmap(16, 16);
@@ -2030,7 +2032,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
p->restore();
}
break; }
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
#ifndef QT_NO_DOCKWIDGET
case CE_DockWidgetTitle:
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) {
@@ -5093,7 +5095,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
}
}
break;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
case SH_RubberBand_Mask:
if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
ret = 0;
@@ -5107,7 +5109,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
}
}
break;
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
case SH_SpinControls_DisableOnBounds:
ret = 1;
break;
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index fafe9c9e2c..423ab6be5e 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -80,7 +80,9 @@
#include <qpushbutton.h>
#endif
#include <qradiobutton.h>
+#if QT_CONFIG(rubberband)
#include <qrubberband.h>
+#endif
#include <qscrollbar.h>
#include <qsizegrip.h>
#include <qstyleoption.h>
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index 2b388091a6..f6bb2fdddd 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -82,7 +82,9 @@
#include <qpushbutton.h>
#endif
#include <qradiobutton.h>
+#if QT_CONFIG(rubberband)
#include <qrubberband.h>
+#endif
#include <qsizegrip.h>
#include <qspinbox.h>
#include <qsplitter.h>
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index c12b3285f1..452f112117 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -2797,7 +2797,7 @@ QStyleOptionToolBox::QStyleOptionToolBox(int version)
a selected tab nor is it the selected tab.
*/
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
/*!
\class QStyleOptionRubberBand
\brief The QStyleOptionRubberBand class is used to describe the
@@ -2887,7 +2887,7 @@ QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
The default value is true.
*/
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
/*!
\class QStyleOptionTitleBar
diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h
index 0e76d53eea..a3ed35c762 100644
--- a/src/widgets/styles/qstyleoption.h
+++ b/src/widgets/styles/qstyleoption.h
@@ -49,7 +49,9 @@
#include <QtWidgets/qstyle.h>
#include <QtWidgets/qtabbar.h>
#include <QtWidgets/qtabwidget.h>
+#if QT_CONFIG(rubberband)
#include <QtWidgets/qrubberband.h>
+#endif
#include <QtWidgets/qframe.h>
#ifndef QT_NO_ITEMVIEWS
# include <QtCore/qabstractitemmodel.h>
@@ -467,7 +469,7 @@ protected:
typedef Q_DECL_DEPRECATED QStyleOptionToolBox QStyleOptionToolBoxV2;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
class Q_WIDGETS_EXPORT QStyleOptionRubberBand : public QStyleOption
{
public:
@@ -483,7 +485,7 @@ public:
protected:
QStyleOptionRubberBand(int version);
};
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
// -------------------------- Complex style options -------------------------------
class Q_WIDGETS_EXPORT QStyleOptionComplex : public QStyleOption
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index efbb972a06..f805e29db1 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -51,7 +51,9 @@
#include <private/qmenubar_p.h>
#include "qpaintengine.h"
#include "qpainter.h"
+#if QT_CONFIG(rubberband)
#include "qrubberband.h"
+#endif
#include "qstyleoption.h"
#include "qtabbar.h"
#include "qwidget.h"
@@ -606,7 +608,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
ret = 400;
break;
}
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
case SH_RubberBand_Mask:
if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
ret = 0;
@@ -622,7 +624,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
}
}
break;
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
#if QT_CONFIG(wizard)
case SH_WizardStyle:
ret = QWizard::ModernStyle;
@@ -1080,7 +1082,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
const QWidget *widget) const
{
switch (ce) {
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
case CE_RubberBand:
if (qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
// ### workaround for slow general painter path
@@ -1103,7 +1105,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
return;
}
break;
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
#if !defined(QT_NO_MENU) && !defined(QT_NO_MAINWINDOW)
case CE_MenuBarEmptyArea:
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 25321559b3..87ac2ee4ae 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -1159,7 +1159,7 @@ void QWindowsXPStyle::polish(QWidget *widget)
widget->setAttribute(Qt::WA_Hover);
}
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (qobject_cast<QRubberBand*>(widget)) {
widget->setWindowOpacity(0.6);
}
@@ -1194,7 +1194,7 @@ void QWindowsXPStyle::polish(QPalette &pal)
/*! \reimp */
void QWindowsXPStyle::unpolish(QWidget *widget)
{
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (qobject_cast<QRubberBand*>(widget)) {
widget->setWindowOpacity(1.0);
}
@@ -2412,7 +2412,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
}
break;
#endif // QT_NO_DOCKWIDGET
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
case CE_RubberBand:
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
QColor highlight = option->palette.color(QPalette::Active, QPalette::Highlight);
@@ -2428,7 +2428,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
return;
}
break;
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
case CE_HeaderEmptyArea:
if (option->state & State_Horizontal)
{
@@ -3752,12 +3752,12 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const
}
}
break;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
case SH_RubberBand_Mask:
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option))
res = 0;
break;
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
case SH_ItemView_DrawDelegateFrame:
res = 1;