Convert features.spinbox to QT_[REQUIRE_]CONFIG
Change-Id: Idecb6927c20ff009795b0ad94bbb7199df98a8f8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>bb10
parent
bef8b905af
commit
df99fbdbed
|
|
@ -87,7 +87,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
|
|||
} else if (classname == QLatin1String("QComboBox")) {
|
||||
iface = new QAccessibleComboBox(widget);
|
||||
#endif
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
} else if (classname == QLatin1String("QAbstractSpinBox")) {
|
||||
iface = new QAccessibleAbstractSpinBox(widget);
|
||||
} else if (classname == QLatin1String("QSpinBox")) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@
|
|||
#if QT_CONFIG(dial)
|
||||
#include <qdial.h>
|
||||
#endif
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <qspinbox.h>
|
||||
#endif
|
||||
#if QT_CONFIG(scrollbar)
|
||||
#include <qscrollbar.h>
|
||||
#endif
|
||||
|
|
@ -51,7 +53,6 @@
|
|||
#include <qstyleoption.h>
|
||||
#include <qdebug.h>
|
||||
#include <qglobal.h>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QtWidgets/qlineedit.h>
|
||||
#include <qmath.h>
|
||||
#include <private/qmath_p.h>
|
||||
|
|
@ -62,7 +63,7 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
QAccessibleAbstractSpinBox::QAccessibleAbstractSpinBox(QWidget *w)
|
||||
: QAccessibleWidget(w, QAccessible::SpinBox), lineEdit(Q_NULLPTR)
|
||||
{
|
||||
|
|
@ -285,7 +286,7 @@ QString QAccessibleDoubleSpinBox::text(QAccessible::Text textType) const
|
|||
return QAccessibleWidget::text(textType);
|
||||
}
|
||||
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
#if QT_CONFIG(scrollbar)
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class QDoubleSpinBox;
|
|||
class QDial;
|
||||
class QAccessibleLineEdit;
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
class QAccessibleAbstractSpinBox:
|
||||
public QAccessibleWidget,
|
||||
public QAccessibleValueInterface,
|
||||
|
|
@ -141,7 +141,7 @@ public:
|
|||
protected:
|
||||
QDoubleSpinBox *doubleSpinBox() const;
|
||||
};
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
#if QT_CONFIG(slider)
|
||||
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
#include <qwindow.h>
|
||||
#include <private/qwindowcontainer_p.h>
|
||||
#include <QtCore/qvarlengtharray.h>
|
||||
#include <QtGui/qvalidator.h>
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include <qfocusframe.h>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@
|
|||
#include "qwizard.h"
|
||||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include "qabstractspinbox.h"
|
||||
#endif
|
||||
#include "qalgorithms.h"
|
||||
#include "qapplication.h"
|
||||
#include "qboxlayout.h"
|
||||
|
|
@ -3686,7 +3688,7 @@ bool QWizardPage::isComplete() const
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
|
||||
if (!spinBox->hasAcceptableInput())
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
#include <qtextedit.h>
|
||||
#include <qplaintextedit.h>
|
||||
#include <qapplication.h>
|
||||
#include <qvalidator.h>
|
||||
#include <private/qtextengine_p.h>
|
||||
#include <private/qabstractitemdelegate_p.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
#include <qtooltip.h>
|
||||
#include <qdatetime.h>
|
||||
#include <qlineedit.h>
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <qspinbox.h>
|
||||
#endif
|
||||
#include <qheaderview.h>
|
||||
#include <qstyleditemdelegate.h>
|
||||
#include <private/qabstractitemview_p.h>
|
||||
|
|
@ -4219,7 +4221,7 @@ QWidget *QAbstractItemViewPrivate::editor(const QModelIndex &index,
|
|||
if (QLineEdit *le = qobject_cast<QLineEdit*>(focusWidget))
|
||||
le->selectAll();
|
||||
#endif
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (QSpinBox *sb = qobject_cast<QSpinBox*>(focusWidget))
|
||||
sb->selectAll();
|
||||
else if (QDoubleSpinBox *dsb = qobject_cast<QDoubleSpinBox*>(focusWidget))
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@
|
|||
#include <qlabel.h>
|
||||
#endif
|
||||
#include <qlineedit.h>
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <qspinbox.h>
|
||||
#endif
|
||||
#include <qstyle.h>
|
||||
#include <qstyleoption.h>
|
||||
#include <limits.h>
|
||||
|
|
@ -80,7 +82,7 @@ public:
|
|||
#endif // QT_CONFIG(combobox)
|
||||
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
|
||||
class QUIntSpinBox : public QSpinBox
|
||||
{
|
||||
|
|
@ -107,7 +109,7 @@ Q_SIGNALS:
|
|||
void uintValueChanged();
|
||||
};
|
||||
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
/*!
|
||||
\class QItemEditorFactory
|
||||
|
|
@ -242,7 +244,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
|
|||
cb->setFrame(false);
|
||||
return cb; }
|
||||
#endif
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case QVariant::UInt: {
|
||||
QSpinBox *sb = new QUIntSpinBox(parent);
|
||||
sb->setFrame(false);
|
||||
|
|
@ -274,7 +276,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
|
|||
case QVariant::Pixmap:
|
||||
return new QLabel(parent);
|
||||
#endif
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case QVariant::Double: {
|
||||
QDoubleSpinBox *sb = new QDoubleSpinBox(parent);
|
||||
sb->setFrame(false);
|
||||
|
|
@ -306,7 +308,7 @@ QByteArray QDefaultItemEditorFactory::valuePropertyName(int userType) const
|
|||
case QVariant::Bool:
|
||||
return "currentIndex";
|
||||
#endif
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case QVariant::UInt:
|
||||
case QVariant::Int:
|
||||
case QVariant::Double:
|
||||
|
|
|
|||
|
|
@ -512,7 +512,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
|
|||
break;
|
||||
}
|
||||
#endif // QT_NO_TOOLBAR
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case PE_IndicatorSpinPlus:
|
||||
case PE_IndicatorSpinMinus: {
|
||||
QRect r = opt->rect;
|
||||
|
|
@ -570,7 +570,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
|
|||
}
|
||||
p->restore();
|
||||
break; }
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
case PE_PanelTipLabel: {
|
||||
const QBrush brush(opt->palette.toolTipBase());
|
||||
qDrawPlainRect(p, opt->rect, opt->palette.toolTipText().color(), 1, &brush);
|
||||
|
|
@ -3285,7 +3285,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
|
|||
}
|
||||
break;
|
||||
#endif // QT_CONFIG(scrollbar)
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
QStyleOptionSpinBox copy = *sb;
|
||||
|
|
@ -3349,7 +3349,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
|
|||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
#if QT_CONFIG(toolbutton)
|
||||
case CC_ToolButton:
|
||||
if (const QStyleOptionToolButton *toolbutton
|
||||
|
|
@ -3868,7 +3868,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
|
|||
}
|
||||
break;
|
||||
#endif // QT_CONFIG(toolbutton)
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
QRect r;
|
||||
|
|
@ -3883,7 +3883,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
|
|||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
case CC_TitleBar:
|
||||
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
|
||||
QRect r;
|
||||
|
|
@ -4080,7 +4080,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
|||
}
|
||||
break;
|
||||
#endif // QT_CONFIG(scrollbar)
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
QSize bs;
|
||||
|
|
@ -4917,7 +4917,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
|||
#else
|
||||
Q_UNUSED(d);
|
||||
#endif // QT_CONFIG(itemviews)
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CT_SpinBox:
|
||||
if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
// Add button + frame widths
|
||||
|
|
|
|||
|
|
@ -66,7 +66,9 @@
|
|||
#if QT_CONFIG(scrollbar)
|
||||
#include <qscrollbar.h>
|
||||
#endif
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <qspinbox.h>
|
||||
#endif
|
||||
#if QT_CONFIG(abstractslider)
|
||||
#include <qabstractslider.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5753,7 +5753,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||
}
|
||||
}
|
||||
break;
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
QStyleOptionSpinBox newSB = *sb;
|
||||
|
|
@ -6505,7 +6505,7 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
|
|||
}
|
||||
}
|
||||
break;
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
QAquaWidgetSize aquaSize = d->aquaSizeConstrain(spin, widget);
|
||||
|
|
@ -6625,7 +6625,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
|||
bool useAquaGuideline = true;
|
||||
|
||||
switch (ct) {
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CT_SpinBox:
|
||||
if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
// Add button + frame widths
|
||||
|
|
|
|||
|
|
@ -102,7 +102,9 @@
|
|||
#if QT_CONFIG(sizegrip)
|
||||
#include <qsizegrip.h>
|
||||
#endif
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <qspinbox.h>
|
||||
#endif
|
||||
#if QT_CONFIG(splitter)
|
||||
#include <qsplitter.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -69,13 +69,13 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize &
|
|||
% HexString<uint>(size.width())
|
||||
% HexString<uint>(size.height());
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
|
||||
tmp = tmp % HexString<uint>(spinBox->buttonSymbols)
|
||||
% HexString<uint>(spinBox->stepEnabled)
|
||||
% QLatin1Char(spinBox->frame ? '1' : '0'); ;
|
||||
}
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
// QTBUG-56743, try to create a palette cache key reflecting the value,
|
||||
// as leaks may occur in conjunction with QStyleSheetStyle/QRenderRule modifying
|
||||
|
|
|
|||
|
|
@ -2152,7 +2152,7 @@ QStyleOptionSlider::QStyleOptionSlider(int version)
|
|||
*/
|
||||
#endif // QT_NO_SLIDER
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
/*!
|
||||
\class QStyleOptionSpinBox
|
||||
\brief The QStyleOptionSpinBox class is used to describe the
|
||||
|
|
@ -2256,7 +2256,7 @@ QStyleOptionSpinBox::QStyleOptionSpinBox(int version)
|
|||
|
||||
The default value is false, i.e. the spin box has no frame.
|
||||
*/
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
/*!
|
||||
\class QStyleOptionDockWidget
|
||||
|
|
|
|||
|
|
@ -41,8 +41,11 @@
|
|||
#define QSTYLEOPTION_H
|
||||
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtCore/qlocale.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <QtWidgets/qabstractspinbox.h>
|
||||
#endif
|
||||
#include <QtGui/qicon.h>
|
||||
#include <QtGui/qmatrix.h>
|
||||
#include <QtWidgets/qslider.h>
|
||||
|
|
@ -533,7 +536,7 @@ protected:
|
|||
};
|
||||
#endif // QT_NO_SLIDER
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
class Q_WIDGETS_EXPORT QStyleOptionSpinBox : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
|
|
@ -550,7 +553,7 @@ public:
|
|||
protected:
|
||||
QStyleOptionSpinBox(int version);
|
||||
};
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
class Q_WIDGETS_EXPORT QStyleOptionToolButton : public QStyleOptionComplex
|
||||
{
|
||||
|
|
|
|||
|
|
@ -98,7 +98,9 @@
|
|||
#include <qdialog.h>
|
||||
#endif
|
||||
#include <private/qwidget_p.h>
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <QAbstractSpinBox>
|
||||
#endif
|
||||
#if QT_CONFIG(label)
|
||||
#include <QLabel>
|
||||
#endif
|
||||
|
|
@ -1651,7 +1653,7 @@ int QStyleSheetStyle::nativeFrameWidth(const QWidget *w)
|
|||
{
|
||||
QStyle *base = baseStyle();
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (qobject_cast<const QAbstractSpinBox *>(w))
|
||||
return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w);
|
||||
#endif
|
||||
|
|
@ -1809,7 +1811,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
|
|||
case PseudoElement_SpinBoxDownButton:
|
||||
case PseudoElement_SpinBoxUpArrow:
|
||||
case PseudoElement_SpinBoxDownArrow:
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
bool on = false;
|
||||
bool up = pseudoElement == PseudoElement_SpinBoxUpButton
|
||||
|
|
@ -1820,7 +1822,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
|
|||
on = true;
|
||||
state |= (on ? QStyle::State_On : QStyle::State_Off);
|
||||
}
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
break;
|
||||
case PseudoElement_GroupBoxTitle:
|
||||
state |= (complex->state & (QStyle::State_MouseOver | QStyle::State_Sunken));
|
||||
|
|
@ -1855,11 +1857,11 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
|
|||
extraClass |= PseudoClass_ReadOnly;
|
||||
else
|
||||
extraClass |= PseudoClass_Editable;
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
} else if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
if (!spin->frame)
|
||||
extraClass |= PseudoClass_Frameless;
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
} else if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
|
||||
if (gb->features & QStyleOptionFrame::Flat)
|
||||
extraClass |= PseudoClass_Flat;
|
||||
|
|
@ -2364,7 +2366,7 @@ static QWidget *embeddedWidget(QWidget *w)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (QAbstractSpinBox *sb = qobject_cast<QAbstractSpinBox *>(w))
|
||||
return sb->findChild<QLineEdit *>();
|
||||
#endif
|
||||
|
|
@ -2393,7 +2395,7 @@ static QWidget *containerWidget(const QWidget *w)
|
|||
if (qobject_cast<const QComboBox *>(w->parentWidget()))
|
||||
return w->parentWidget();
|
||||
#endif
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (qobject_cast<const QAbstractSpinBox *>(w->parentWidget()))
|
||||
return w->parentWidget();
|
||||
#endif
|
||||
|
|
@ -2985,7 +2987,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
|
|||
}
|
||||
break;
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
QStyleOptionSpinBox spinOpt(*spin);
|
||||
|
|
@ -3048,7 +3050,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
|
|||
return;
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
case CC_GroupBox:
|
||||
if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
|
||||
|
|
@ -4341,7 +4343,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
|
|||
|
||||
case PE_PanelLineEdit:
|
||||
if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (w && qobject_cast<const QAbstractSpinBox *>(w->parentWidget())) {
|
||||
QRenderRule spinboxRule = renderRule(w->parentWidget(), opt);
|
||||
if (!spinboxRule.hasNativeBorder() || !spinboxRule.baseStyleCanDraw())
|
||||
|
|
@ -4994,7 +4996,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
|
|||
break;
|
||||
case CT_GroupBox:
|
||||
case CT_LineEdit:
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0))
|
||||
return csz; // we only care about the size hint of the line edit
|
||||
#endif
|
||||
|
|
@ -5390,7 +5392,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
|
|||
}
|
||||
break;
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
|
||||
|
|
@ -5449,7 +5451,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
|
|||
: QWindowsStyle::subControlRect(cc, &spinBox, sc, w);
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
case CC_GroupBox:
|
||||
if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
|
||||
|
|
|
|||
|
|
@ -2231,7 +2231,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
|
|||
}
|
||||
break;
|
||||
#endif // QT_CONFIG(combobox)
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||
QStyleOptionSpinBox copy = *sb;
|
||||
|
|
@ -2320,7 +2320,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
|
|||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
|
||||
default:
|
||||
QCommonStyle::drawComplexControl(cc, opt, p, widget);
|
||||
|
|
|
|||
|
|
@ -1774,7 +1774,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
|
|||
}
|
||||
}
|
||||
break;
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(option))
|
||||
{
|
||||
|
|
@ -1832,7 +1832,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
|
|||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
default:
|
||||
QWindowsXPStyle::drawComplexControl(control, option, painter, widget);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,9 @@
|
|||
#if QT_CONFIG(toolbutton)
|
||||
#include <qtoolbutton.h>
|
||||
#endif
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <qspinbox.h>
|
||||
#endif
|
||||
#include <qtoolbar.h>
|
||||
#if QT_CONFIG(combobox)
|
||||
#include <qcombobox.h>
|
||||
|
|
|
|||
|
|
@ -70,7 +70,9 @@
|
|||
#include <qscrollbar.h>
|
||||
#endif
|
||||
#include <qheaderview.h>
|
||||
#if QT_CONFIG(spinbox)
|
||||
#include <qspinbox.h>
|
||||
#endif
|
||||
#if QT_CONFIG(listview)
|
||||
#include <qlistview.h>
|
||||
#endif
|
||||
|
|
@ -383,10 +385,10 @@ bool QWindowsXPStylePrivate::isLineEditBaseColorSet(const QStyleOption *option,
|
|||
// Since spin box includes a line edit we need to resolve the palette mask also from
|
||||
// the parent, as while the color is always correct on the palette supplied by panel,
|
||||
// the mask can still be empty. If either mask specifies custom base color, use that.
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
if (const QAbstractSpinBox *spinbox = qobject_cast<QAbstractSpinBox*>(widget->parentWidget()))
|
||||
resolveMask |= spinbox->palette().resolve();
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
}
|
||||
return (resolveMask & (1 << QPalette::Base)) != 0;
|
||||
}
|
||||
|
|
@ -1163,10 +1165,10 @@ void QWindowsXPStyle::polish(QWidget *widget)
|
|||
|| qobject_cast<QScrollBar*>(widget)
|
||||
|| qobject_cast<QSlider*>(widget)
|
||||
|| qobject_cast<QHeaderView*>(widget)
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
|| qobject_cast<QAbstractSpinBox*>(widget)
|
||||
|| qobject_cast<QSpinBox*>(widget)
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
) {
|
||||
widget->setAttribute(Qt::WA_Hover);
|
||||
}
|
||||
|
|
@ -1238,10 +1240,10 @@ void QWindowsXPStyle::unpolish(QWidget *widget)
|
|||
|| qobject_cast<QScrollBar*>(widget)
|
||||
|| qobject_cast<QSlider*>(widget)
|
||||
|| qobject_cast<QHeaderView*>(widget)
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
|| qobject_cast<QAbstractSpinBox*>(widget)
|
||||
|| qobject_cast<QSpinBox*>(widget)
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
) {
|
||||
widget->setAttribute(Qt::WA_Hover, false);
|
||||
}
|
||||
|
|
@ -2507,7 +2509,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
|
|||
flags |= State_MouseOver;
|
||||
|
||||
switch (cc) {
|
||||
#ifndef QT_NO_SPINBOX
|
||||
#if QT_CONFIG(spinbox)
|
||||
case CC_SpinBox:
|
||||
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(option))
|
||||
{
|
||||
|
|
@ -2559,7 +2561,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
|
|||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_SPINBOX
|
||||
#endif // QT_CONFIG(spinbox)
|
||||
#if QT_CONFIG(combobox)
|
||||
case CC_ComboBox:
|
||||
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option))
|
||||
|
|
|
|||
|
|
@ -43,8 +43,6 @@
|
|||
#include <private/qlineedit_p.h>
|
||||
#include <qabstractspinbox.h>
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qstylehints.h>
|
||||
#include <qclipboard.h>
|
||||
|
|
@ -2145,5 +2143,3 @@ QVariant QAbstractSpinBoxPrivate::variantBound(const QVariant &min,
|
|||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qabstractspinbox.cpp"
|
||||
|
||||
#endif // QT_NO_SPINBOX
|
||||
|
|
|
|||
|
|
@ -44,11 +44,10 @@
|
|||
#include <QtWidgets/qwidget.h>
|
||||
#include <QtGui/qvalidator.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(spinbox);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
class QAbstractSpinBoxPrivate;
|
||||
|
|
@ -175,8 +174,6 @@ private:
|
|||
};
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractSpinBox::StepEnabled)
|
||||
|
||||
#endif // QT_NO_SPINBOX
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QABSTRACTSPINBOX_H
|
||||
|
|
|
|||
|
|
@ -54,8 +54,6 @@
|
|||
#include <QtWidgets/private/qtwidgetsglobal_p.h>
|
||||
#include "QtWidgets/qabstractspinbox.h"
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
|
||||
#include "QtWidgets/qlineedit.h"
|
||||
#include "QtWidgets/qstyleoption.h"
|
||||
#include "QtGui/qvalidator.h"
|
||||
|
|
@ -63,6 +61,8 @@
|
|||
#include "QtCore/qvariant.h"
|
||||
#include "private/qwidget_p.h"
|
||||
|
||||
QT_REQUIRE_CONFIG(spinbox);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QVariant operator+(const QVariant &arg1, const QVariant &arg2);
|
||||
|
|
@ -165,6 +165,4 @@ private:
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_SPINBOX
|
||||
|
||||
#endif // QABSTRACTSPINBOX_P_H
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include <QtWidgets/qabstractitemdelegate.h>
|
||||
#include <QtCore/qabstractitemmodel.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtGui/qvalidator.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(combobox);
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
#endif
|
||||
#include <qpainter.h>
|
||||
#include <qpropertyanimation.h>
|
||||
#include <qvalidator.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@
|
|||
#include <private/qabstractspinbox_p.h>
|
||||
#include <qspinbox.h>
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
|
||||
#include <qlineedit.h>
|
||||
#include <qlocale.h>
|
||||
#include <qvalidator.h>
|
||||
|
|
@ -1321,5 +1319,3 @@ bool QSpinBox::event(QEvent *event)
|
|||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qspinbox.cpp"
|
||||
|
||||
#endif // QT_NO_SPINBOX
|
||||
|
|
|
|||
|
|
@ -43,11 +43,10 @@
|
|||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtWidgets/qabstractspinbox.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(spinbox);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
|
||||
class QSpinBoxPrivate;
|
||||
class Q_WIDGETS_EXPORT QSpinBox : public QAbstractSpinBox
|
||||
{
|
||||
|
|
@ -168,8 +167,6 @@ private:
|
|||
Q_DECLARE_PRIVATE(QDoubleSpinBox)
|
||||
};
|
||||
|
||||
#endif // QT_NO_SPINBOX
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QSPINBOX_H
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@
|
|||
#include "qgraphicssceneevent.h"
|
||||
#endif
|
||||
|
||||
#include "qvalidator.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
# Qt widgets module
|
||||
|
||||
HEADERS += \
|
||||
widgets/qabstractspinbox.h \
|
||||
widgets/qabstractspinbox_p.h \
|
||||
widgets/qframe.h \
|
||||
widgets/qframe_p.h \
|
||||
widgets/qlineedit.h \
|
||||
|
|
@ -10,7 +8,6 @@ HEADERS += \
|
|||
widgets/qmenu.h \
|
||||
widgets/qmenu_p.h \
|
||||
widgets/qslider.h \
|
||||
widgets/qspinbox.h \
|
||||
widgets/qtextedit.h \
|
||||
widgets/qtextedit_p.h \
|
||||
widgets/qtoolbar.h \
|
||||
|
|
@ -27,13 +24,11 @@ HEADERS += \
|
|||
widgets/qplaintextedit_p.h
|
||||
|
||||
SOURCES += \
|
||||
widgets/qabstractspinbox.cpp \
|
||||
widgets/qframe.cpp \
|
||||
widgets/qlineedit_p.cpp \
|
||||
widgets/qlineedit.cpp \
|
||||
widgets/qmenu.cpp \
|
||||
widgets/qslider.cpp \
|
||||
widgets/qspinbox.cpp \
|
||||
widgets/qtextedit.cpp \
|
||||
widgets/qtoolbar.cpp \
|
||||
widgets/qtoolbarlayout.cpp \
|
||||
|
|
@ -256,6 +251,17 @@ qtConfig(sizegrip) {
|
|||
SOURCES += widgets/qsizegrip.cpp
|
||||
}
|
||||
|
||||
qtConfig(spinbox) {
|
||||
HEADERS += \
|
||||
widgets/qabstractspinbox.h \
|
||||
widgets/qabstractspinbox_p.h \
|
||||
widgets/qspinbox.h
|
||||
|
||||
SOURCES += \
|
||||
widgets/qabstractspinbox.cpp \
|
||||
widgets/qspinbox.cpp
|
||||
}
|
||||
|
||||
qtConfig(splashscreen) {
|
||||
HEADERS += \
|
||||
widgets/qsplashscreen.h
|
||||
|
|
|
|||
Loading…
Reference in New Issue