summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widgets/configure.json7
-rw-r--r--src/widgets/styles/qfusionstyle.cpp4
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp2
-rw-r--r--src/widgets/widgets/qabstractslider.h2
-rw-r--r--src/widgets/widgets/qabstractslider_p.h2
-rw-r--r--src/widgets/widgets/qdial.h9
-rw-r--r--src/widgets/widgets/qscrollbar.h10
-rw-r--r--src/widgets/widgets/qslider.h9
-rw-r--r--src/widgets/widgets/widgets.pri12
9 files changed, 41 insertions, 16 deletions
diff --git a/src/widgets/configure.json b/src/widgets/configure.json
index 33dc90b124..99e1bd6940 100644
--- a/src/widgets/configure.json
+++ b/src/widgets/configure.json
@@ -330,10 +330,17 @@
"section": "Widgets",
"output": [ "publicFeature", "feature" ]
},
+ "abstractslider": {
+ "label": "QAbstractSlider",
+ "purpose": "Common super class for widgets like QScrollBar, QSlider and QDial.",
+ "section": "Widgets",
+ "output": [ "publicFeature" ]
+ },
"slider": {
"label": "QSlider",
"purpose": "Provides sliders controlling a bounded value.",
"section": "Widgets",
+ "condition": "features.abstractslider",
"output": [ "publicFeature", "feature" ]
},
"scrollbar": {
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 96af534099..33c5a01677 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -3294,7 +3294,9 @@ void QFusionStyle::polish(QWidget *widget)
#if QT_CONFIG(splitter)
|| qobject_cast<QSplitterHandle *>(widget)
#endif
+#if QT_CONFIG(abstractslider)
|| qobject_cast<QAbstractSlider *>(widget)
+#endif
#if QT_CONFIG(spinbox)
|| qobject_cast<QAbstractSpinBox *>(widget)
#endif
@@ -3333,7 +3335,9 @@ void QFusionStyle::unpolish(QWidget *widget)
#if QT_CONFIG(splitter)
|| qobject_cast<QSplitterHandle *>(widget)
#endif
+#if QT_CONFIG(abstractslider)
|| qobject_cast<QAbstractSlider *>(widget)
+#endif
#if QT_CONFIG(spinbox)
|| qobject_cast<QAbstractSpinBox *>(widget)
#endif
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 0c7a3e692c..ab4d0bcb7c 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -2426,9 +2426,11 @@ static bool unstylable(const QWidget *w)
static quint64 extendedPseudoClass(const QWidget *w)
{
quint64 pc = w->isWindow() ? quint64(PseudoClass_Window) : 0;
+#if QT_CONFIG(abstractslider)
if (const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(w)) {
pc |= ((slider->orientation() == Qt::Vertical) ? PseudoClass_Vertical : PseudoClass_Horizontal);
} else
+#endif
#ifndef QT_NO_COMBOBOX
if (const QComboBox *combo = qobject_cast<const QComboBox *>(w)) {
if (combo->isEditable())
diff --git a/src/widgets/widgets/qabstractslider.h b/src/widgets/widgets/qabstractslider.h
index 86d6830f10..8979685724 100644
--- a/src/widgets/widgets/qabstractslider.h
+++ b/src/widgets/widgets/qabstractslider.h
@@ -43,6 +43,8 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
+QT_REQUIRE_CONFIG(abstractslider);
+
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qabstractslider_p.h b/src/widgets/widgets/qabstractslider_p.h
index 600616061a..419ce2ba07 100644
--- a/src/widgets/widgets/qabstractslider_p.h
+++ b/src/widgets/widgets/qabstractslider_p.h
@@ -57,6 +57,8 @@
#include "private/qwidget_p.h"
#include "qstyle.h"
+QT_REQUIRE_CONFIG(abstractslider);
+
QT_BEGIN_NAMESPACE
class QAbstractSliderPrivate : public QWidgetPrivate
diff --git a/src/widgets/widgets/qdial.h b/src/widgets/widgets/qdial.h
index 3629ebf8f6..472b14fcdb 100644
--- a/src/widgets/widgets/qdial.h
+++ b/src/widgets/widgets/qdial.h
@@ -42,13 +42,14 @@
#define QDIAL_H
#include <QtWidgets/qtwidgetsglobal.h>
+
+#if QT_CONFIG(dial)
+
#include <QtWidgets/qabstractslider.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_DIAL
-
class QDialPrivate;
class QStyleOptionSlider;
@@ -98,8 +99,8 @@ private:
Q_DISABLE_COPY(QDial)
};
-#endif // QT_NO_DIAL
-
QT_END_NAMESPACE
+#endif // QT_CONFIG(dial)
+
#endif // QDIAL_H
diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h
index 2b8a110c99..b99ad219eb 100644
--- a/src/widgets/widgets/qscrollbar.h
+++ b/src/widgets/widgets/qscrollbar.h
@@ -42,12 +42,12 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
-#include <QtWidgets/qabstractslider.h>
-QT_BEGIN_NAMESPACE
+#if QT_CONFIG(scrollbar)
+#include <QtWidgets/qabstractslider.h>
-#ifndef QT_NO_SCROLLBAR
+QT_BEGIN_NAMESPACE
class QScrollBarPrivate;
class QStyleOptionSlider;
@@ -94,8 +94,8 @@ private:
#endif
};
-#endif // QT_NO_SCROLLBAR
-
QT_END_NAMESPACE
+#endif // QT_CONFIG(scrollbar)
+
#endif // QSCROLLBAR_H
diff --git a/src/widgets/widgets/qslider.h b/src/widgets/widgets/qslider.h
index 33b90ece06..001863c18d 100644
--- a/src/widgets/widgets/qslider.h
+++ b/src/widgets/widgets/qslider.h
@@ -41,13 +41,14 @@
#define QSLIDER_H
#include <QtWidgets/qtwidgetsglobal.h>
+
+#if QT_CONFIG(slider)
+
#include <QtWidgets/qabstractslider.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_SLIDER
-
class QSliderPrivate;
class QStyleOptionSlider;
class Q_WIDGETS_EXPORT QSlider : public QAbstractSlider
@@ -99,8 +100,8 @@ private:
Q_DECLARE_PRIVATE(QSlider)
};
-#endif // QT_NO_SLIDER
-
QT_END_NAMESPACE
+#endif // QT_CONFIG(slider)
+
#endif // QSLIDER_H
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index d25d8ce63e..f67640e40f 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -5,8 +5,6 @@ HEADERS += \
widgets/qbuttongroup_p.h \
widgets/qabstractbutton.h \
widgets/qabstractbutton_p.h \
- widgets/qabstractslider.h \
- widgets/qabstractslider_p.h \
widgets/qabstractspinbox.h \
widgets/qabstractspinbox_p.h \
widgets/qcalendarwidget.h \
@@ -79,7 +77,6 @@ HEADERS += \
SOURCES += \
widgets/qbuttongroup.cpp \
widgets/qabstractbutton.cpp \
- widgets/qabstractslider.cpp \
widgets/qabstractspinbox.cpp \
widgets/qcalendarwidget.cpp \
widgets/qcombobox.cpp \
@@ -131,6 +128,15 @@ SOURCES += \
widgets/qtoolbararealayout.cpp \
widgets/qplaintextedit.cpp
+qtConfig(abstractslider) {
+ HEADERS += \
+ widgets/qabstractslider.h \
+ widgets/qabstractslider_p.h
+
+ SOURCES += \
+ widgets/qabstractslider.cpp
+}
+
qtConfig(checkbox) {
HEADERS += \
widgets/qcheckbox.h