Add feature.abstractslider

Change-Id: Ib5d0186162fc3b750e6440c74b1181787093ef97
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Stephan Binner 2017-03-07 21:29:09 +01:00
parent cf7d3b524d
commit b53d7664c9
9 changed files with 41 additions and 16 deletions

View File

@ -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": {

View File

@ -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

View File

@ -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())

View File

@ -43,6 +43,8 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
QT_REQUIRE_CONFIG(abstractslider);
QT_BEGIN_NAMESPACE

View File

@ -57,6 +57,8 @@
#include "private/qwidget_p.h"
#include "qstyle.h"
QT_REQUIRE_CONFIG(abstractslider);
QT_BEGIN_NAMESPACE
class QAbstractSliderPrivate : public QWidgetPrivate

View File

@ -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

View File

@ -42,13 +42,13 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
#if QT_CONFIG(scrollbar)
#include <QtWidgets/qabstractslider.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_SCROLLBAR
class QScrollBarPrivate;
class QStyleOptionSlider;
@ -94,8 +94,8 @@ private:
#endif
};
#endif // QT_NO_SCROLLBAR
QT_END_NAMESPACE
#endif // QT_CONFIG(scrollbar)
#endif // QSCROLLBAR_H

View File

@ -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

View File

@ -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