Convert features.slider to QT_[REQUIRE_]CONFIG
Change-Id: I03adb5e34071aa106bbfe7caa2d41a93e8d1e263 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
710a9180c1
commit
79bf70b5b6
@ -99,7 +99,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
|
||||
} else if (classname == QLatin1String("QScrollBar")) {
|
||||
iface = new QAccessibleScrollBar(widget);
|
||||
#endif
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
} else if (classname == QLatin1String("QAbstractSlider")) {
|
||||
iface = new QAccessibleAbstractSlider(widget);
|
||||
} else if (classname == QLatin1String("QSlider")) {
|
||||
|
@ -39,7 +39,9 @@
|
||||
|
||||
#include "rangecontrols_p.h"
|
||||
|
||||
#if QT_CONFIG(slider)
|
||||
#include <qslider.h>
|
||||
#endif
|
||||
#if QT_CONFIG(dial)
|
||||
#include <qdial.h>
|
||||
#endif
|
||||
@ -325,7 +327,7 @@ QString QAccessibleScrollBar::text(QAccessible::Text t) const
|
||||
|
||||
#endif // QT_CONFIG(scrollbar)
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
/*!
|
||||
\class QAccessibleSlider
|
||||
\brief The QAccessibleSlider class implements the QAccessibleInterface for sliders.
|
||||
@ -402,7 +404,7 @@ QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const
|
||||
return static_cast<QAbstractSlider *>(object());
|
||||
}
|
||||
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
#if QT_CONFIG(dial)
|
||||
// ======================================= QAccessibleDial ======================================
|
||||
|
@ -174,7 +174,7 @@ protected:
|
||||
};
|
||||
#endif // QT_CONFIG(scrollbar)
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
class QAccessibleSlider : public QAccessibleAbstractSlider
|
||||
{
|
||||
public:
|
||||
@ -184,7 +184,7 @@ public:
|
||||
protected:
|
||||
QSlider *slider() const;
|
||||
};
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
#if QT_CONFIG(dial)
|
||||
class QAccessibleDial : public QAccessibleAbstractSlider
|
||||
|
@ -69,7 +69,9 @@
|
||||
#include <qpainter.h>
|
||||
#include <qpaintengine.h>
|
||||
#include <qpainterpath.h>
|
||||
#if QT_CONFIG(slider)
|
||||
#include <qslider.h>
|
||||
#endif
|
||||
#include <qstyleoption.h>
|
||||
#if QT_CONFIG(tabbar)
|
||||
#include <qtabbar.h>
|
||||
@ -2472,7 +2474,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
|
||||
r = visualRect(btn->direction, btn->rect, r);
|
||||
}
|
||||
break;
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case SE_SliderFocusRect:
|
||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget);
|
||||
@ -2485,7 +2487,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
|
||||
r = visualRect(opt->direction, opt->rect, r);
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
#if QT_CONFIG(progressbar)
|
||||
case SE_ProgressBarGroove:
|
||||
case SE_ProgressBarContents:
|
||||
@ -3140,7 +3142,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
|
||||
QPainter *p, const QWidget *widget) const
|
||||
{
|
||||
switch (cc) {
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case CC_Slider:
|
||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
if (slider->subControls == SC_SliderTickmarks) {
|
||||
@ -3196,7 +3198,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
#if QT_CONFIG(scrollbar)
|
||||
case CC_ScrollBar:
|
||||
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
@ -3822,7 +3824,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
|
||||
{
|
||||
SubControl sc = SC_None;
|
||||
switch (cc) {
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case CC_Slider:
|
||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
QRect r = proxy()->subControlRect(cc, slider, SC_SliderHandle, widget);
|
||||
@ -3835,7 +3837,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
#if QT_CONFIG(scrollbar)
|
||||
case CC_ScrollBar:
|
||||
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
@ -3959,7 +3961,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
||||
{
|
||||
QRect ret;
|
||||
switch (cc) {
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case CC_Slider:
|
||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget);
|
||||
@ -3994,7 +3996,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
||||
ret = visualRect(slider->direction, slider->rect, ret);
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
#if QT_CONFIG(scrollbar)
|
||||
case CC_ScrollBar:
|
||||
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
@ -4497,7 +4499,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
|
||||
ret = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::MaximumScrollBarDragDistance).toInt();
|
||||
break;
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case PM_SliderThickness:
|
||||
ret = int(QStyleHelper::dpiScaled(16.));
|
||||
break;
|
||||
@ -4530,7 +4532,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
|
||||
ret = 0;
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
#if QT_CONFIG(dockwidget)
|
||||
case PM_DockWidgetSeparatorExtent:
|
||||
ret = int(QStyleHelper::dpiScaled(6.));
|
||||
|
@ -72,7 +72,9 @@
|
||||
#if QT_CONFIG(abstractslider)
|
||||
#include <qabstractslider.h>
|
||||
#endif
|
||||
#if QT_CONFIG(slider)
|
||||
#include <qslider.h>
|
||||
#endif
|
||||
#if QT_CONFIG(splitter)
|
||||
#include <qsplitter.h>
|
||||
#endif
|
||||
|
@ -52,7 +52,9 @@
|
||||
#if QT_CONFIG(progressbar)
|
||||
#include <QProgressBar>
|
||||
#endif
|
||||
#if QT_CONFIG(slider)
|
||||
#include <QSlider>
|
||||
#endif
|
||||
#include <QEvent>
|
||||
#if QT_CONFIG(combobox)
|
||||
#include <QComboBox>
|
||||
|
@ -1953,7 +1953,7 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type)
|
||||
\sa QStyle::SubControl
|
||||
*/
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
/*!
|
||||
\class QStyleOptionSlider
|
||||
\brief The QStyleOptionSlider class is used to describe the
|
||||
@ -2150,7 +2150,7 @@ QStyleOptionSlider::QStyleOptionSlider(int version)
|
||||
|
||||
\sa QAbstractSlider::pageStep
|
||||
*/
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
#if QT_CONFIG(spinbox)
|
||||
/*!
|
||||
|
@ -48,7 +48,9 @@
|
||||
#endif
|
||||
#include <QtGui/qicon.h>
|
||||
#include <QtGui/qmatrix.h>
|
||||
#if QT_CONFIG(slider)
|
||||
#include <QtWidgets/qslider.h>
|
||||
#endif
|
||||
#include <QtWidgets/qstyle.h>
|
||||
#if QT_CONFIG(tabbar)
|
||||
#include <QtWidgets/qtabbar.h>
|
||||
@ -508,7 +510,7 @@ public:
|
||||
QStyleOptionComplex(const QStyleOptionComplex &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
};
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
class Q_WIDGETS_EXPORT QStyleOptionSlider : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
@ -534,7 +536,7 @@ public:
|
||||
protected:
|
||||
QStyleOptionSlider(int version);
|
||||
};
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
#if QT_CONFIG(spinbox)
|
||||
class Q_WIDGETS_EXPORT QStyleOptionSpinBox : public QStyleOptionComplex
|
||||
|
@ -3229,7 +3229,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
|
||||
break;
|
||||
#endif // QT_CONFIG(scrollbar)
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case CC_Slider:
|
||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
rule.drawRule(p, opt->rect);
|
||||
@ -3283,7 +3283,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
case CC_MdiControls:
|
||||
if (hasStyleRule(w, PseudoElement_MdiCloseButton)
|
||||
@ -5623,7 +5623,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
|
||||
break;
|
||||
#endif // QT_CONFIG(scrollbar)
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case CC_Slider:
|
||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderGroove);
|
||||
@ -5656,7 +5656,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
case CC_MdiControls:
|
||||
if (hasStyleRule(w, PseudoElement_MdiCloseButton)
|
||||
|
@ -347,10 +347,10 @@ int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm)
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case QStyle::PM_SliderLength:
|
||||
return 11;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
#ifndef QT_NO_MENU
|
||||
case QStyle::PM_MenuBarHMargin:
|
||||
@ -439,7 +439,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
|
||||
ret = 60;
|
||||
break;
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
// Returns the number of pixels to use for the business part of the
|
||||
// slider (i.e., the non-tickmark portion). The remaining space is shared
|
||||
// equally between the tickmark regions.
|
||||
@ -467,7 +467,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
|
||||
ret = thick;
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
case PM_IconViewIconSize:
|
||||
ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget);
|
||||
@ -1926,7 +1926,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
|
||||
QPainter *p, const QWidget *widget) const
|
||||
{
|
||||
switch (cc) {
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case CC_Slider:
|
||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget);
|
||||
@ -2146,7 +2146,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SLIDER
|
||||
#endif // QT_CONFIG(slider)
|
||||
#if QT_CONFIG(scrollbar)
|
||||
case CC_ScrollBar:
|
||||
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
|
||||
|
@ -2724,7 +2724,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
|
||||
}
|
||||
break;
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
#if QT_CONFIG(slider)
|
||||
case CC_Slider:
|
||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option))
|
||||
{
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qslider.h"
|
||||
#ifndef QT_NO_SLIDER
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include "qaccessible.h"
|
||||
#endif
|
||||
@ -547,8 +546,6 @@ Q_WIDGETS_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider)
|
||||
return sliderOption;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qslider.cpp"
|
||||
|
@ -42,12 +42,11 @@
|
||||
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
|
||||
#if QT_CONFIG(slider)
|
||||
|
||||
#include <QtWidgets/qabstractslider.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
QT_REQUIRE_CONFIG(slider);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QSliderPrivate;
|
||||
class QStyleOptionSlider;
|
||||
@ -102,6 +101,4 @@ private:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_CONFIG(slider)
|
||||
|
||||
#endif // QSLIDER_H
|
||||
|
@ -5,7 +5,6 @@ HEADERS += \
|
||||
widgets/qframe_p.h \
|
||||
widgets/qmenu.h \
|
||||
widgets/qmenu_p.h \
|
||||
widgets/qslider.h \
|
||||
widgets/qtextedit.h \
|
||||
widgets/qtextedit_p.h \
|
||||
widgets/qtoolbar.h \
|
||||
@ -23,7 +22,6 @@ HEADERS += \
|
||||
SOURCES += \
|
||||
widgets/qframe.cpp \
|
||||
widgets/qmenu.cpp \
|
||||
widgets/qslider.cpp \
|
||||
widgets/qtextedit.cpp \
|
||||
widgets/qtoolbar.cpp \
|
||||
widgets/qtoolbarlayout.cpp \
|
||||
@ -257,6 +255,11 @@ qtConfig(sizegrip) {
|
||||
SOURCES += widgets/qsizegrip.cpp
|
||||
}
|
||||
|
||||
qtConfig(slider) {
|
||||
HEADERS += widgets/qslider.h
|
||||
SOURCES += widgets/qslider.cpp
|
||||
}
|
||||
|
||||
qtConfig(spinbox) {
|
||||
HEADERS += \
|
||||
widgets/qabstractspinbox.h \
|
||||
|
Loading…
x
Reference in New Issue
Block a user