summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-07-22 15:16:51 +0200
committerStephan Binner <stephan.binner@basyskom.com>2017-07-25 11:23:45 +0000
commit163863f77d891f56573e4dae316d16cfc2fefc8f (patch)
treeb4d909413d084babd124e614df55e333f4d07b45 /src/widgets
parent3ade30a2af5b64cb2437d214f25e4dcbfa00c49d (diff)
Convert features.combobox to QT_[REQUIRE_]CONFIG
Change-Id: I2f415de8556289a6461a645d559be17089c43c99 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/accessible/complexwidgets.cpp6
-rw-r--r--src/widgets/accessible/complexwidgets_p.h4
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory.cpp2
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp18
-rw-r--r--src/widgets/styles/qcommonstyle.cpp20
-rw-r--r--src/widgets/styles/qfusionstyle.cpp2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm22
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h2
-rw-r--r--src/widgets/styles/qpixmapstyle.cpp2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp20
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp8
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp8
-rw-r--r--src/widgets/styles/qwindowsvistastyle_p_p.h2
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp14
-rw-r--r--src/widgets/widgets/qcombobox.cpp3
-rw-r--r--src/widgets/widgets/qcombobox.h6
-rw-r--r--src/widgets/widgets/qcombobox_p.h5
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h1
-rw-r--r--src/widgets/widgets/qtoolbar.cpp2
-rw-r--r--src/widgets/widgets/widgets.pri11
20 files changed, 89 insertions, 69 deletions
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp
index 42775d7324..29e11556aa 100644
--- a/src/widgets/accessible/complexwidgets.cpp
+++ b/src/widgets/accessible/complexwidgets.cpp
@@ -44,7 +44,9 @@
#include <qevent.h>
#include <qheaderview.h>
#include <qtabbar.h>
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#include <qlineedit.h>
#include <qstyle.h>
#include <qstyleoption.h>
@@ -260,7 +262,7 @@ QString QAccessibleTabBar::text(QAccessible::Text t) const
#endif // QT_NO_TABBAR
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
/*!
\class QAccessibleComboBox
\brief The QAccessibleComboBox class implements the QAccessibleInterface for editable and read-only combo boxes.
@@ -378,7 +380,7 @@ QStringList QAccessibleComboBox::keyBindingsForAction(const QString &/*actionNam
return QStringList();
}
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
#ifndef QT_NO_SCROLLAREA
// ======================= QAccessibleAbstractScrollArea =======================
diff --git a/src/widgets/accessible/complexwidgets_p.h b/src/widgets/accessible/complexwidgets_p.h
index d43b06f4a4..b4b4e89a1a 100644
--- a/src/widgets/accessible/complexwidgets_p.h
+++ b/src/widgets/accessible/complexwidgets_p.h
@@ -124,7 +124,7 @@ protected:
};
#endif // QT_NO_TABBAR
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
class QAccessibleComboBox : public QAccessibleWidget
{
public:
@@ -146,7 +146,7 @@ public:
protected:
QComboBox *comboBox() const;
};
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
index 20104eea68..371158c73c 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp
+++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
@@ -79,7 +79,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
else
iface = new QAccessibleLineEdit(widget);
#endif
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
} else if (classname == QLatin1String("QComboBox")) {
iface = new QAccessibleComboBox(widget);
#endif
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index a31689e0b5..dcfe4065a6 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -43,7 +43,9 @@
#ifndef QT_NO_ITEMVIEWS
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#if QT_CONFIG(datetimeedit)
#include <qdatetimeedit.h>
#endif
@@ -52,6 +54,8 @@
#endif
#include <qlineedit.h>
#include <qspinbox.h>
+#include <qstyle.h>
+#include <qstyleoption.h>
#include <limits.h>
#include <float.h>
#include <qapplication.h>
@@ -62,7 +66,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
class QBooleanComboBox : public QComboBox
{
@@ -75,7 +79,7 @@ public:
bool value() const;
};
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
#ifndef QT_NO_SPINBOX
@@ -234,7 +238,7 @@ public:
QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent) const
{
switch (userType) {
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case QVariant::Bool: {
QBooleanComboBox *cb = new QBooleanComboBox(parent);
cb->setFrame(false);
@@ -300,7 +304,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
QByteArray QDefaultItemEditorFactory::valuePropertyName(int userType) const
{
switch (userType) {
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case QVariant::Bool:
return "currentIndex";
#endif
@@ -595,7 +599,7 @@ void QExpandingLineEdit::resizeToContents()
#endif // QT_NO_LINEEDIT
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
QBooleanComboBox::QBooleanComboBox(QWidget *parent)
: QComboBox(parent)
@@ -614,11 +618,11 @@ bool QBooleanComboBox::value() const
return (currentIndex() == 1);
}
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
QT_END_NAMESPACE
-#if !defined(QT_NO_LINEEDIT) || !defined(QT_NO_COMBOBOX)
+#if !defined(QT_NO_LINEEDIT) || QT_CONFIG(combobox)
#include "qitemeditorfactory.moc"
#endif
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 973e89b3ef..b1b84501c5 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -2096,7 +2096,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
case CE_HeaderEmptyArea:
p->fillRect(opt->rect, opt->palette.background());
break;
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CE_ComboBoxLabel:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget);
@@ -2128,7 +2128,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
p->restore();
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
#ifndef QT_NO_TOOLBAR
case CE_ToolBar:
if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
@@ -2505,7 +2505,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
}
break;
#endif // QT_NO_PROGRESSBAR
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case SE_ComboBoxFocusRect:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
int margin = cb->frame ? 3 : 0;
@@ -2514,7 +2514,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
r = visualRect(opt->direction, opt->rect, r);
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
#ifndef QT_NO_TOOLBOX
case SE_ToolBoxTabContents:
r = opt->rect;
@@ -3892,7 +3892,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
}
break;
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
QRect r;
@@ -3907,7 +3907,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
#ifndef QT_NO_GROUPBOX
case CC_GroupBox:
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
@@ -4140,7 +4140,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
}
break;
#endif // QT_NO_TOOLBUTTON
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
int x = cb->rect.x(),
@@ -4172,7 +4172,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
ret = visualRect(cb->direction, cb->rect, ret);
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
case CC_TitleBar:
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
const int controlMargin = 2;
@@ -4839,7 +4839,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(sz.width() + 6, sz.height() + 5);
break;
#endif // QT_NO_TOOLBUTTON
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CT_ComboBox:
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
int fw = cmb->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, opt, widget) * 2 : 0;
@@ -4849,7 +4849,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(sz.width() + fw + other, sz.height() + fw);
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
case CT_HeaderSection:
if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
bool nullIcon = hdr->icon.isNull();
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index b6e61e7cc9..792d958d8b 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -42,7 +42,9 @@
#if QT_CONFIG(style_fusion) || defined(QT_PLUGIN)
#include "qcommonstyle_p.h"
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#if QT_CONFIG(pushbutton)
#include <qpushbutton.h>
#endif
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 6e8796970f..dbba51b00d 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -51,12 +51,14 @@
//#define DEBUG_SIZE_CONSTRAINT
#include <private/qcore_mac_p.h>
-#include <private/qcombobox_p.h>
#include <private/qtabbar_p.h>
#include <private/qpainter_p.h>
#include <qapplication.h>
#include <qbitmap.h>
+#if QT_CONFIG(combobox)
+#include <private/qcombobox_p.h>
#include <qcombobox.h>
+#endif
#if QT_CONFIG(dialogbuttonbox)
#include <qdialogbuttonbox.h>
#endif
@@ -643,7 +645,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
else if (qobject_cast<const QCheckBox *>(widg))
ct = QStyle::CT_CheckBox;
#endif
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
else if (qobject_cast<const QComboBox *>(widg))
ct = QStyle::CT_ComboBox;
#endif
@@ -889,7 +891,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
break;
}
#endif
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case QStyle::CT_LineEdit:
if (!widg || !qobject_cast<QComboBox *>(widg->parentWidget())) {
//should I take into account the font dimentions of the lineedit? -Sam
@@ -2264,7 +2266,7 @@ void QMacStyle::polish(QWidget* w)
#ifndef QT_NO_MENU
if (qobject_cast<QMenu*>(w)
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
|| qobject_cast<QComboBoxPrivateContainer *>(w)
#endif
) {
@@ -2332,7 +2334,7 @@ void QMacStyle::unpolish(QWidget* w)
w->setWindowOpacity(1.0);
}
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (QComboBox *combo = qobject_cast<QComboBox *>(w)) {
if (!combo->isEditable()) {
if (QWidget *widget = combo->findChild<QComboBoxPrivateContainer *>())
@@ -4484,7 +4486,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// Always be normal or disabled to follow the Mac style.
int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize);
QSize iconSize(smallIconSize, smallIconSize);
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (const QComboBox *comboBox = qobject_cast<const QComboBox *>(w)) {
iconSize = comboBox->iconSize();
}
@@ -5065,7 +5067,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
#endif
case SE_LineEditContents:
rect = QCommonStyle::subElementRect(sr, opt, widget);
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (widget && qobject_cast<const QComboBox*>(widget->parentWidget()))
rect.adjust(-1, -2, 0, 0);
else
@@ -6742,7 +6744,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
case QStyle::CT_MenuItem:
if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
int maxpmw = mi->maxIconWidth;
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
const QComboBox *comboBox = qobject_cast<const QComboBox *>(widget);
#endif
int w = sz.width(),
@@ -6755,7 +6757,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
} else {
h = mi->fontMetrics.height() + 2;
if (!mi->icon.isNull()) {
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (comboBox) {
const QSize &iconSize = comboBox->iconSize();
h = qMax(h, iconSize.height() + 4);
@@ -6776,7 +6778,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
w += maxpmw + 6;
// add space for a check. All items have place for a check too.
w += 20;
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (comboBox && comboBox->isVisible()) {
QStyleOptionComboBox cmb;
cmb.initFrom(comboBox);
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index 4a3ff1b8bf..17e60e3bef 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -48,7 +48,9 @@
#include "qmacstyle_mac_p.h"
#include "qcommonstyle_p.h"
#include <private/qapplication_p.h>
+#if QT_CONFIG(combobox)
#include <private/qcombobox_p.h>
+#endif
#include <private/qpainter_p.h>
#include <private/qstylehelper_p.h>
#include <qapplication.h>
diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp
index 20c9040a53..795fe34975 100644
--- a/src/widgets/styles/qpixmapstyle.cpp
+++ b/src/widgets/styles/qpixmapstyle.cpp
@@ -52,7 +52,9 @@
#include <QProgressBar>
#include <QSlider>
#include <QEvent>
+#if QT_CONFIG(combobox)
#include <QComboBox>
+#endif
#include <QAbstractItemView>
#if QT_CONFIG(listview)
#include <QListView>
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 5d977d75c0..e23a1f60b5 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -51,7 +51,9 @@
#include <qstyleoption.h>
#include <qlineedit.h>
#include <private/qwindowsstyle_p.h>
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#include "private/qcssparser_p.h"
#include "private/qmath_p.h"
#include <qabstractscrollarea.h>
@@ -1639,7 +1641,7 @@ int QStyleSheetStyle::nativeFrameWidth(const QWidget *w)
return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w);
#endif
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (qobject_cast<const QComboBox *>(w))
return base->pixelMetric(QStyle::PM_ComboBoxFrameWidth, 0, w);
#endif
@@ -2338,7 +2340,7 @@ QRect QStyleSheetStyle::positionRect(const QWidget *w, const QRenderRule& rule1,
*/
static QWidget *embeddedWidget(QWidget *w)
{
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (QComboBox *cmb = qobject_cast<QComboBox *>(w)) {
if (cmb->isEditable())
return cmb->lineEdit();
@@ -2372,7 +2374,7 @@ static QWidget *containerWidget(const QWidget *w)
#ifndef QT_NO_LINEEDIT
if (qobject_cast<const QLineEdit *>(w)) {
//if the QLineEdit is an embeddedWidget, we need the rule of the real widget
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (qobject_cast<const QComboBox *>(w->parentWidget()))
return w->parentWidget();
#endif
@@ -2411,7 +2413,7 @@ static bool unstylable(const QWidget *w)
// detect QComboBoxPrivateContainer
else if (qobject_cast<const QFrame *>(w)) {
if (0
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
|| qobject_cast<const QComboBox *>(w->parentWidget())
#endif
)
@@ -2436,7 +2438,7 @@ static quint64 extendedPseudoClass(const QWidget *w)
pc |= ((slider->orientation() == Qt::Vertical) ? PseudoClass_Vertical : PseudoClass_Horizontal);
} else
#endif
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (const QComboBox *combo = qobject_cast<const QComboBox *>(w)) {
if (combo->isEditable())
pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly);
@@ -3769,7 +3771,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
}
return;
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CE_ComboBoxLabel:
if (!rule.hasBox())
break;
@@ -3805,7 +3807,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
return;
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
case CE_Header:
if (hasStyleRule(w, PseudoElement_HeaderViewUpArrow)
@@ -5297,7 +5299,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break;
case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break;
case SH_ComboBox_PopupFrameStyle:
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
if (qobject_cast<const QComboBox *>(w)) {
QAbstractItemView *view = w->findChild<QAbstractItemView *>();
if (view) {
@@ -5307,7 +5309,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
return QFrame::NoFrame;
}
}
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
break;
case SH_DialogButtonBox_ButtonsHaveIcons: s = QLatin1String("dialogbuttonbox-buttons-have-icons"); break;
case SH_Workspace_FillSpaceOnMaximize: s = QLatin1String("mdi-fill-space-on-maximize"); break;
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index d0ede56010..7b6da75089 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -1859,7 +1859,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
}
return;
#endif // QT_NO_DOCKWIDGET
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CE_ComboBoxLabel:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
if (cb->state & State_HasFocus) {
@@ -1872,7 +1872,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
}
QCommonStyle::drawControl(ce, opt, p, widget);
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
default:
QCommonStyle::drawControl(ce, opt, p, widget);
}
@@ -2150,7 +2150,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
}
break;
#endif // QT_NO_SCROLLBAR
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
QBrush editBrush = cmb->palette.brush(QPalette::Base);
@@ -2223,7 +2223,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
}
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
#ifndef QT_NO_SPINBOX
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index ae1b83957c..e400820256 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -1474,11 +1474,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
break;
}
#endif // QT_NO_ITEMVIEWS
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CE_ComboBoxLabel:
QCommonStyle::drawControl(element, option, painter, widget);
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
default:
QWindowsXPStyle::drawControl(element, option, painter, widget);
break;
@@ -2121,7 +2121,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
QRect rect = QWindowsXPStyle::subControlRect(control, option, subControl, widget);
switch (control) {
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
int x = cb->rect.x(),
@@ -2154,7 +2154,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
return rect;
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
case CC_TitleBar:
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) {
if (!buttonVisible(subControl, tb))
diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h
index 5c342df5a6..22ca1d3534 100644
--- a/src/widgets/styles/qwindowsvistastyle_p_p.h
+++ b/src/widgets/styles/qwindowsvistastyle_p_p.h
@@ -72,7 +72,9 @@
#include <qtoolbutton.h>
#include <qspinbox.h>
#include <qtoolbar.h>
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#include <qscrollbar.h>
#include <qprogressbar.h>
#include <qdockwidget.h>
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index e1c32d4ed6..418c4d256e 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -59,7 +59,9 @@
#include <qdesktopwidget.h>
#include <qtoolbutton.h>
#include <qtabbar.h>
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#include <qscrollbar.h>
#include <qheaderview.h>
#include <qspinbox.h>
@@ -1147,9 +1149,9 @@ void QWindowsXPStyle::polish(QWidget *widget)
#endif
|| qobject_cast<QToolButton*>(widget)
|| qobject_cast<QTabBar*>(widget)
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
|| qobject_cast<QComboBox*>(widget)
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
|| qobject_cast<QScrollBar*>(widget)
|| qobject_cast<QSlider*>(widget)
|| qobject_cast<QHeaderView*>(widget)
@@ -1222,9 +1224,9 @@ void QWindowsXPStyle::unpolish(QWidget *widget)
#endif
|| qobject_cast<QToolButton*>(widget)
|| qobject_cast<QTabBar*>(widget)
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
|| qobject_cast<QComboBox*>(widget)
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
|| qobject_cast<QScrollBar*>(widget)
|| qobject_cast<QSlider*>(widget)
|| qobject_cast<QHeaderView*>(widget)
@@ -2550,7 +2552,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
break;
#endif // QT_NO_SPINBOX
-#ifndef QT_NO_COMBOBOX
+#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option))
{
@@ -2601,7 +2603,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
}
break;
-#endif // QT_NO_COMBOBOX
+#endif // QT_CONFIG(combobox)
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option))
{
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 6a8167b5e5..506986f4ba 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -39,7 +39,6 @@
#include "qcombobox.h"
-#ifndef QT_NO_COMBOBOX
#include <qstylepainter.h>
#include <qpa/qplatformtheme.h>
#include <qpa/qplatformmenu.h>
@@ -3486,5 +3485,3 @@ QT_END_NAMESPACE
#include "moc_qcombobox.cpp"
#include "moc_qcombobox_p.cpp"
-
-#endif // QT_NO_COMBOBOX
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index 8f99594a76..a6aac6f8aa 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -46,9 +46,9 @@
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qvariant.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(combobox);
-#ifndef QT_NO_COMBOBOX
+QT_BEGIN_NAMESPACE
class QAbstractItemView;
class QLineEdit;
@@ -277,8 +277,6 @@ inline void QComboBox::insertItem(int aindex, const QString &atext,
const QVariant &auserData)
{ insertItem(aindex, QIcon(), atext, auserData); }
-#endif // QT_NO_COMBOBOX
-
QT_END_NAMESPACE
#endif // QCOMBOBOX_H
diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h
index 6c36359f81..ab4dd0281f 100644
--- a/src/widgets/widgets/qcombobox_p.h
+++ b/src/widgets/widgets/qcombobox_p.h
@@ -54,7 +54,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "QtWidgets/qcombobox.h"
-#ifndef QT_NO_COMBOBOX
#include "QtWidgets/qabstractslider.h"
#include "QtWidgets/qapplication.h"
#include "QtWidgets/qitemdelegate.h"
@@ -74,6 +73,8 @@
#include <limits.h>
+QT_REQUIRE_CONFIG(combobox);
+
QT_BEGIN_NAMESPACE
class QAction;
@@ -423,6 +424,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_COMBOBOX
-
#endif // QCOMBOBOX_P_H
diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h
index bc70780de9..5ac5a9db6a 100644
--- a/src/widgets/widgets/qdatetimeedit_p.h
+++ b/src/widgets/widgets/qdatetimeedit_p.h
@@ -52,7 +52,6 @@
//
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#include "QtWidgets/qcombobox.h"
#include "QtWidgets/qcalendarwidget.h"
#include "QtWidgets/qspinbox.h"
#include "QtWidgets/qtoolbutton.h"
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index bdb17f10d3..893506f16f 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -42,7 +42,9 @@
#ifndef QT_NO_TOOLBAR
#include <qapplication.h>
+#if QT_CONFIG(combobox)
#include <qcombobox.h>
+#endif
#include <qevent.h>
#include <qlayout.h>
#include <qmainwindow.h>
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index ee510bd120..7a39f3fb3e 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -5,8 +5,6 @@ HEADERS += \
widgets/qbuttongroup_p.h \
widgets/qabstractspinbox.h \
widgets/qabstractspinbox_p.h \
- widgets/qcombobox.h \
- widgets/qcombobox_p.h \
widgets/qdial.h \
widgets/qdockwidget.h \
widgets/qdockwidget_p.h \
@@ -66,7 +64,6 @@ HEADERS += \
SOURCES += \
widgets/qbuttongroup.cpp \
widgets/qabstractspinbox.cpp \
- widgets/qcombobox.cpp \
widgets/qdial.cpp \
widgets/qdockwidget.cpp \
widgets/qdockarealayout.cpp \
@@ -140,6 +137,14 @@ qtConfig(checkbox) {
widgets/qcheckbox.cpp
}
+qtConfig(combobox) {
+ HEADERS += \
+ widgets/qcombobox.h \
+ widgets/qcombobox_p.h
+
+ SOURCES += widgets/qcombobox.cpp
+}
+
qtConfig(commandlinkbutton) {
HEADERS += \
widgets/qcommandlinkbutton.h