From 16f375f5490dec4bc69ceb52cd1f26e68011484f Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 22 Jul 2017 15:19:13 +0200 Subject: [PATCH] Convert features.itemviews to QT_[REQUIRE_]CONFIG The QT_NO_ITEMVIEWS queries in corelib/ seem to had no effect at all. Change-Id: I494ee2309a96b0cf25de18781fc9a675878a2ee9 Reviewed-by: Oswald Buddenhagen --- .../itemmodels/qitemselectionmodel.cpp | 4 ---- src/corelib/itemmodels/qitemselectionmodel.h | 4 ---- .../itemmodels/qitemselectionmodel_p.h | 3 --- src/widgets/accessible/accessible.pri | 7 ++++-- src/widgets/accessible/complexwidgets.cpp | 2 ++ src/widgets/accessible/complexwidgets_p.h | 2 ++ src/widgets/accessible/itemviews.cpp | 3 --- src/widgets/accessible/itemviews_p.h | 5 +--- .../accessible/qaccessiblewidgetfactory.cpp | 6 +++-- src/widgets/accessible/qaccessiblewidgets.cpp | 2 ++ .../itemviews/qabstractitemdelegate.cpp | 3 --- src/widgets/itemviews/qabstractitemdelegate.h | 7 ++---- .../itemviews/qabstractitemdelegate_p.h | 4 +--- src/widgets/itemviews/qabstractitemview.cpp | 3 --- src/widgets/itemviews/qabstractitemview.h | 7 ++---- src/widgets/itemviews/qabstractitemview_p.h | 4 +--- src/widgets/itemviews/qheaderview.cpp | 3 --- src/widgets/itemviews/qheaderview.h | 7 ++---- src/widgets/itemviews/qheaderview_p.h | 6 ++--- src/widgets/itemviews/qitemdelegate.cpp | 3 --- src/widgets/itemviews/qitemdelegate.h | 7 ++---- src/widgets/itemviews/qitemeditorfactory.cpp | 4 ---- src/widgets/itemviews/qitemeditorfactory.h | 7 ++---- src/widgets/itemviews/qitemeditorfactory_p.h | 7 ++---- src/widgets/itemviews/qstyleditemdelegate.cpp | 3 --- src/widgets/itemviews/qstyleditemdelegate.h | 7 ++---- src/widgets/styles/qcommonstyle.cpp | 24 ++++++++++--------- src/widgets/styles/qcommonstyle_p.h | 6 ++--- src/widgets/styles/qpixmapstyle.cpp | 4 +++- src/widgets/styles/qstyleoption.cpp | 4 ++-- src/widgets/styles/qstyleoption.h | 6 ++--- src/widgets/styles/qstylesheetstyle.cpp | 18 +++++++------- src/widgets/styles/qwindowsvistastyle.cpp | 4 ++-- src/widgets/widgets/qabstractbutton.cpp | 4 +++- src/widgets/widgets/qabstractscrollarea.cpp | 2 ++ src/widgets/widgets/qlineedit.cpp | 2 ++ src/widgets/widgets/qlineedit_p.cpp | 2 ++ src/widgets/widgets/qscrollbar.h | 2 +- src/widgets/widgets/qtabbar.cpp | 2 ++ src/widgets/widgets/qwidgetlinecontrol.cpp | 2 ++ 40 files changed, 84 insertions(+), 118 deletions(-) diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index 8dcd80808b..59a10e9057 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -44,8 +44,6 @@ #include #include -#ifndef QT_NO_ITEMVIEWS - QT_BEGIN_NAMESPACE /*! @@ -1917,5 +1915,3 @@ QDebug operator<<(QDebug dbg, const QItemSelectionRange &range) QT_END_NAMESPACE #include "moc_qitemselectionmodel.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 2421610bce..9d33303ddc 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -42,8 +42,6 @@ #include -#ifndef QT_NO_ITEMVIEWS - #include #include #include @@ -273,6 +271,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QItemSelectionRange) Q_DECLARE_METATYPE(QItemSelection) -#endif // QT_NO_ITEMVIEWS - #endif // QITEMSELECTIONMODEL_H diff --git a/src/corelib/itemmodels/qitemselectionmodel_p.h b/src/corelib/itemmodels/qitemselectionmodel_p.h index c2d9384b09..dfc0387563 100644 --- a/src/corelib/itemmodels/qitemselectionmodel_p.h +++ b/src/corelib/itemmodels/qitemselectionmodel_p.h @@ -55,7 +55,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_ITEMVIEWS class QItemSelectionModelPrivate: public QObjectPrivate { Q_DECLARE_PUBLIC(QItemSelectionModel) @@ -106,8 +105,6 @@ public: int tableColCount, tableRowCount; }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMSELECTIONMODEL_P_H diff --git a/src/widgets/accessible/accessible.pri b/src/widgets/accessible/accessible.pri index e63ae28d30..06467d0ff0 100644 --- a/src/widgets/accessible/accessible.pri +++ b/src/widgets/accessible/accessible.pri @@ -5,7 +5,6 @@ qtConfig(accessibility) { accessible/qaccessiblewidget.h \ accessible/qaccessiblewidgetfactory_p.h \ accessible/complexwidgets_p.h \ - accessible/itemviews_p.h \ accessible/qaccessiblemenu_p.h \ accessible/qaccessiblewidgets_p.h \ accessible/rangecontrols_p.h \ @@ -15,9 +14,13 @@ qtConfig(accessibility) { accessible/qaccessiblewidget.cpp \ accessible/qaccessiblewidgetfactory.cpp \ accessible/complexwidgets.cpp \ - accessible/itemviews.cpp \ accessible/qaccessiblemenu.cpp \ accessible/qaccessiblewidgets.cpp \ accessible/rangecontrols.cpp \ accessible/simplewidgets.cpp + + qtConfig(itemviews) { + HEADERS += accessible/itemviews_p.h + SOURCES += accessible/itemviews.cpp + } } diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp index 29e11556aa..9475b5a96c 100644 --- a/src/widgets/accessible/complexwidgets.cpp +++ b/src/widgets/accessible/complexwidgets.cpp @@ -42,7 +42,9 @@ #include #include #include +#if QT_CONFIG(itemviews) #include +#endif #include #if QT_CONFIG(combobox) #include diff --git a/src/widgets/accessible/complexwidgets_p.h b/src/widgets/accessible/complexwidgets_p.h index b4b4e89a1a..849169ab8a 100644 --- a/src/widgets/accessible/complexwidgets_p.h +++ b/src/widgets/accessible/complexwidgets_p.h @@ -54,7 +54,9 @@ #include #include #include +#if QT_CONFIG(itemviews) #include +#endif QT_BEGIN_NAMESPACE diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp index 1ccfcbe4e5..4d37400dc9 100644 --- a/src/widgets/accessible/itemviews.cpp +++ b/src/widgets/accessible/itemviews.cpp @@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_ITEMVIEWS /* Implementation of the IAccessible2 table2 interface. Much simpler than the other table interfaces since there is only the main table and cells: @@ -1215,8 +1214,6 @@ QHeaderView *QAccessibleTableHeaderCell::headerView() const return header; } -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QT_NO_ACCESSIBILITY diff --git a/src/widgets/accessible/itemviews_p.h b/src/widgets/accessible/itemviews_p.h index 9542a569db..72841b8a0f 100644 --- a/src/widgets/accessible/itemviews_p.h +++ b/src/widgets/accessible/itemviews_p.h @@ -58,13 +58,12 @@ #include #include +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE #ifndef QT_NO_ACCESSIBILITY -#ifndef QT_NO_ITEMVIEWS - class QAccessibleTableCell; class QAccessibleTableHeaderCell; @@ -299,8 +298,6 @@ private: }; -#endif - #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index 371158c73c..8c1e591f0e 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -43,7 +43,9 @@ #include "simplewidgets_p.h" #include "rangecontrols_p.h" #include "complexwidgets_p.h" +#if QT_CONFIG(itemviews) #include "itemviews_p.h" +#endif #include #if QT_CONFIG(treeview) @@ -146,11 +148,11 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje } else if (classname == QLatin1String("QTreeView")) { iface = new QAccessibleTree(widget); #endif // QT_CONFIG(treeview) -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) } else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) { iface = new QAccessibleTable(widget); // ### This should be cleaned up. We return the parent for the scrollarea to hide it. -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TABBAR } else if (classname == QLatin1String("QTabBar")) { iface = new QAccessibleTabBar(widget); diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp index eec60ac0c8..676ac67b56 100644 --- a/src/widgets/accessible/qaccessiblewidgets.cpp +++ b/src/widgets/accessible/qaccessiblewidgets.cpp @@ -65,7 +65,9 @@ #if QT_CONFIG(calendarwidget) #include #endif +#if QT_CONFIG(itemviews) #include +#endif #include #include #include diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index 5b119cc79e..fd4699409c 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -39,7 +39,6 @@ #include "qabstractitemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -606,5 +605,3 @@ void QAbstractItemDelegatePrivate::_q_commitDataAndCloseEditor(QWidget *editor) QT_END_NAMESPACE #include "moc_qabstractitemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qabstractitemdelegate.h b/src/widgets/itemviews/qabstractitemdelegate.h index 9f7a7716af..9b6bde1c87 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.h +++ b/src/widgets/itemviews/qabstractitemdelegate.h @@ -44,11 +44,10 @@ #include #include +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_ITEMVIEWS - class QPainter; class QModelIndex; class QAbstractItemModel; @@ -127,8 +126,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_commitDataAndCloseEditor(QWidget*)) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QABSTRACTITEMDELEGATE_H diff --git a/src/widgets/itemviews/qabstractitemdelegate_p.h b/src/widgets/itemviews/qabstractitemdelegate_p.h index 0b03be63f0..da76d31e8b 100644 --- a/src/widgets/itemviews/qabstractitemdelegate_p.h +++ b/src/widgets/itemviews/qabstractitemdelegate_p.h @@ -55,7 +55,7 @@ #include "qabstractitemdelegate.h" #include -#ifndef QT_NO_ITEMVIEWS +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE @@ -73,6 +73,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QABSTRACTITEMDELEGATE_P_H diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 396016c44d..f056b7e5e5 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -39,7 +39,6 @@ #include "qabstractitemview.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -4490,5 +4489,3 @@ QModelIndexList QAbstractItemViewPrivate::selectedDraggableIndexes() const QT_END_NAMESPACE #include "moc_qabstractitemview.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h index f315ea6e4c..6be776ec52 100644 --- a/src/widgets/itemviews/qabstractitemview.h +++ b/src/widgets/itemviews/qabstractitemview.h @@ -49,11 +49,10 @@ class tst_QAbstractItemView; class tst_QTreeView; +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_ITEMVIEWS - class QMenu; class QDrag; class QEvent; @@ -381,8 +380,6 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractItemView::EditTriggers) -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QABSTRACTITEMVIEW_H diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index 5e3858f491..d8af96af55 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -64,7 +64,7 @@ #include "QtCore/qbasictimer.h" #include "QtCore/qelapsedtimer.h" -#ifndef QT_NO_ITEMVIEWS +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE @@ -477,6 +477,4 @@ inline int qBinarySearch(const QVector &vec, const T &item, int start, int en QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QABSTRACTITEMVIEW_P_H diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 6a6991ebb8..213cc96b03 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -39,7 +39,6 @@ #include "qheaderview.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -3949,6 +3948,4 @@ bool QHeaderViewPrivate::read(QDataStream &in) QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #include "moc_qheaderview.cpp" diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h index 4be97c0c7e..ec4500d81e 100644 --- a/src/widgets/itemviews/qheaderview.h +++ b/src/widgets/itemviews/qheaderview.h @@ -43,11 +43,10 @@ #include #include +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_ITEMVIEWS - class QHeaderViewPrivate; class QStyleOptionHeader; @@ -265,8 +264,6 @@ inline void QHeaderView::hideSection(int alogicalIndex) inline void QHeaderView::showSection(int alogicalIndex) { setSectionHidden(alogicalIndex, false); } -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QHEADERVIEW_H diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h index d6b119512c..8fc8b88aa5 100644 --- a/src/widgets/itemviews/qheaderview_p.h +++ b/src/widgets/itemviews/qheaderview_p.h @@ -54,14 +54,14 @@ #include #include "private/qabstractitemview_p.h" -#ifndef QT_NO_ITEMVIEWS - #include "QtCore/qbitarray.h" #include "QtWidgets/qapplication.h" #if QT_CONFIG(label) #include "QtWidgets/qlabel.h" #endif +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE class QHeaderViewPrivate: public QAbstractItemViewPrivate @@ -391,6 +391,4 @@ Q_DECLARE_TYPEINFO(QHeaderViewPrivate::SectionItem, Q_PRIMITIVE_TYPE); QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QHEADERVIEW_P_H diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp index 6a6220cd0a..68c02e9edb 100644 --- a/src/widgets/itemviews/qitemdelegate.cpp +++ b/src/widgets/itemviews/qitemdelegate.cpp @@ -39,7 +39,6 @@ #include "qitemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -1199,5 +1198,3 @@ QStyleOptionViewItem QItemDelegate::setOptions(const QModelIndex &index, QT_END_NAMESPACE #include "moc_qitemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qitemdelegate.h b/src/widgets/itemviews/qitemdelegate.h index 3d98419c80..21594327ef 100644 --- a/src/widgets/itemviews/qitemdelegate.h +++ b/src/widgets/itemviews/qitemdelegate.h @@ -46,11 +46,10 @@ #include #include +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_ITEMVIEWS - class QItemDelegatePrivate; class QItemEditorFactory; @@ -126,8 +125,6 @@ private: Q_DISABLE_COPY(QItemDelegate) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMDELEGATE_H diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp index dcfe4065a6..54b7c6666f 100644 --- a/src/widgets/itemviews/qitemeditorfactory.cpp +++ b/src/widgets/itemviews/qitemeditorfactory.cpp @@ -41,8 +41,6 @@ #include "qitemeditorfactory.h" #include "qitemeditorfactory_p.h" -#ifndef QT_NO_ITEMVIEWS - #if QT_CONFIG(combobox) #include #endif @@ -627,5 +625,3 @@ QT_END_NAMESPACE #endif #include "moc_qitemeditorfactory_p.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qitemeditorfactory.h b/src/widgets/itemviews/qitemeditorfactory.h index dea9bce794..f2610ad3de 100644 --- a/src/widgets/itemviews/qitemeditorfactory.h +++ b/src/widgets/itemviews/qitemeditorfactory.h @@ -46,11 +46,10 @@ #include #include +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_ITEMVIEWS - class QWidget; class Q_WIDGETS_EXPORT QItemEditorCreatorBase @@ -111,8 +110,6 @@ private: QHash creatorMap; }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMEDITORFACTORY_H diff --git a/src/widgets/itemviews/qitemeditorfactory_p.h b/src/widgets/itemviews/qitemeditorfactory_p.h index 91edcf65ba..409ecc684f 100644 --- a/src/widgets/itemviews/qitemeditorfactory_p.h +++ b/src/widgets/itemviews/qitemeditorfactory_p.h @@ -55,12 +55,11 @@ #include #include -#ifndef QT_NO_ITEMVIEWS - #ifndef QT_NO_LINEEDIT -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(itemviews); +QT_BEGIN_NAMESPACE class QExpandingLineEdit : public QLineEdit { @@ -92,6 +91,4 @@ QT_END_NAMESPACE #endif // QT_NO_LINEEDIT -#endif //QT_NO_ITEMVIEWS - #endif //QITEMEDITORFACTORY_P_H diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index 0b8019c21c..bda3325adb 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -39,7 +39,6 @@ #include "qstyleditemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -643,5 +642,3 @@ bool QStyledItemDelegate::editorEvent(QEvent *event, QT_END_NAMESPACE #include "moc_qstyleditemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qstyleditemdelegate.h b/src/widgets/itemviews/qstyleditemdelegate.h index d30e6e0e9c..f3b7c4d1f4 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.h +++ b/src/widgets/itemviews/qstyleditemdelegate.h @@ -46,11 +46,10 @@ #include #include +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_ITEMVIEWS - class QStyledItemDelegatePrivate; class QItemEditorFactory; @@ -101,8 +100,6 @@ private: Q_DISABLE_COPY(QStyledItemDelegate) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QSTYLEDITEMDELEGATE_H diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index b1b84501c5..7a177fa604 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -41,7 +41,9 @@ #include "qcommonstyle_p.h" #include +#if QT_CONFIG(itemviews) #include +#endif #include #include #include @@ -91,7 +93,7 @@ #include -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) # include "private/qtextengine_p.h" #endif @@ -675,7 +677,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q else p->drawRect(rect); break; } -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case PE_PanelItemViewRow: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)) @@ -713,7 +715,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } } break; -#endif //QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) case PE_PanelScrollAreaCorner: { const QBrush brush(opt->palette.brush(QPalette::Window)); p->fillRect(opt->rect, brush); @@ -824,7 +826,7 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut } #endif // QT_NO_TOOLBUTTON -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth) { @@ -1095,7 +1097,7 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect *textRect = display; } } -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TABBAR @@ -2168,7 +2170,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { p->save(); @@ -2248,7 +2250,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_FRAME case CE_ShapedFrame: if (const QStyleOptionFrame *f = qstyleoption_cast(opt)) { @@ -3020,7 +3022,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, break; } #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case SE_ItemViewItemCheckIndicator: if (!qstyleoption_cast(opt)) { r = subElementRect(SE_CheckBoxIndicator, opt, widget); @@ -3047,7 +3049,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = d->displayRect; } break; -#endif //QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TOOLBAR case SE_ToolBarHandle: if (const QStyleOptionToolBar *tbopt = qstyleoption_cast(opt)) { @@ -4897,7 +4899,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QSize(1 + 3 * (buttonSize + 1), buttonSize); } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CT_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { QRect decorationRect, displayRect, checkRect; @@ -4909,7 +4911,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, break; #else Q_UNUSED(d); -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_SPINBOX case CT_SpinBox: if (const QStyleOptionSpinBox *vopt = qstyleoption_cast(opt)) { diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h index 2ef7f30d21..7c69109ff7 100644 --- a/src/widgets/styles/qcommonstyle_p.h +++ b/src/widgets/styles/qcommonstyle_p.h @@ -68,7 +68,7 @@ class QCommonStylePrivate : public QStylePrivate Q_DECLARE_PUBLIC(QCommonStyle) public: inline QCommonStylePrivate() : -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) cachedOption(0), #endif animationFps(30) @@ -79,12 +79,12 @@ public: #ifndef QT_NO_ANIMATION qDeleteAll(animations); #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) delete cachedOption; #endif } -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) void viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const; void viewItemLayout(const QStyleOptionViewItem *opt, QRect *checkRect, QRect *pixmapRect, QRect *textRect, bool sizehint) const; diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index 795fe34975..63308a5e36 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -55,11 +55,13 @@ #if QT_CONFIG(combobox) #include #endif +#if QT_CONFIG(itemviews) #include +#include +#endif #if QT_CONFIG(listview) #include #endif -#include #include #include diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 452f112117..80585a4825 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -3000,7 +3000,7 @@ QStyleOptionTitleBar::QStyleOptionTitleBar(int version) \sa Qt::WindowFlags */ -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) /*! \class QStyleOptionViewItem \brief The QStyleOptionViewItem class is used to describe the @@ -3267,7 +3267,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version) therefore both at the beginning and the end. */ -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) /*! \fn T qstyleoption_cast(const QStyleOption *option) \relates QStyleOption diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index a3ed35c762..c57c3eefef 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -53,7 +53,7 @@ #include #endif #include -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) # include #endif @@ -388,7 +388,7 @@ protected: typedef Q_DECL_DEPRECATED QStyleOptionDockWidget QStyleOptionDockWidgetV2; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) class Q_WIDGETS_EXPORT QStyleOptionViewItem : public QStyleOption { @@ -443,7 +443,7 @@ typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV2; typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV3; typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV4; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) class Q_WIDGETS_EXPORT QStyleOptionToolBox : public QStyleOption { diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index e23a1f60b5..4e4907b1d4 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -71,7 +71,9 @@ #include #endif #include +#if QT_CONFIG(itemviews) #include +#endif #include #include #include @@ -2008,7 +2010,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption extraClass |= PseudoClass_Movable; } #endif // QT_NO_DOCKWIDGET -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) else if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { if (vopt->features & QStyleOptionViewItem::Alternate) extraClass |= PseudoClass_Alternate; @@ -2805,7 +2807,7 @@ void QStyleSheetStyle::polish(QWidget *w) QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Any); if (rule.hasDrawable() || rule.hasBox()) { if (w->metaObject() == &QWidget::staticMetaObject -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) || qobject_cast(w) #endif #ifndef QT_NO_TABBAR @@ -4069,7 +4071,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q fallback = true; break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); @@ -4086,7 +4088,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q return; } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TABBAR case CE_TabBarTab: @@ -5107,7 +5109,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CT_ItemViewItem: { QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); sz = baseStyle()->sizeFromContents(ct, opt, csz, w); @@ -5116,7 +5118,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op sz = subRule.boxSize(sz); return sz; } -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) default: break; @@ -5756,7 +5758,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c case SE_CheckBoxClickRect: // relies on indicator and contents return ParentStyle::subElementRect(se, opt, w); -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case SE_ViewItemCheckIndicator: if (!qstyleoption_cast(opt)) { return subElementRect(SE_CheckBoxIndicator, opt, w); @@ -5785,7 +5787,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c } } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) case SE_HeaderArrow: { QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow); diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index e400820256..8ab4a61f5f 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -1438,7 +1438,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption } } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: { const QStyleOptionViewItem *vopt; @@ -1473,7 +1473,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption } break; } -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #if QT_CONFIG(combobox) case CE_ComboBoxLabel: QCommonStyle::drawControl(element, option, painter, widget); diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index e65613d5cd..1d78d24a88 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -40,7 +40,9 @@ #include "private/qabstractbutton_p.h" #include "private/qbuttongroup_p.h" +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qbuttongroup.h" #include "qabstractbutton_p.h" #include "qevent.h" @@ -1071,7 +1073,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e) #ifndef QT_NO_BUTTONGROUP || d->group #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) || (pw && qobject_cast(pw->parentWidget())) #endif ) { diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 673983d575..14498c8b90 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -50,7 +50,9 @@ #include "qboxlayout.h" #include "qpainter.h" #include "qmargins.h" +#if QT_CONFIG(itemviews) #include "qheaderview.h" +#endif #include diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index b9b50c307b..50eb1a7371 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -68,7 +68,9 @@ #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "private/qstylesheetstyle_p.h" #ifndef QT_NO_SHORTCUT diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index e1c7a4e280..83dab9e110 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -43,7 +43,9 @@ #ifndef QT_NO_LINEEDIT #include "qvariant.h" +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qdrag.h" #include "qwidgetaction.h" #include "qclipboard.h" diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h index 963ae4263b..c180a62585 100644 --- a/src/widgets/widgets/qscrollbar.h +++ b/src/widgets/widgets/qscrollbar.h @@ -85,7 +85,7 @@ private: Q_DISABLE_COPY(QScrollBar) Q_DECLARE_PRIVATE(QScrollBar) -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) friend class QTableView; friend class QTreeViewPrivate; friend class QCommonListViewBase; diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 9e803f4388..5ec60b0425 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -38,7 +38,9 @@ ****************************************************************************/ #include "private/qlayoutengine_p.h" +#if QT_CONFIG(itemviews) #include "qabstractitemdelegate.h" +#endif #include "qapplication.h" #include "qbitmap.h" #include "qcursor.h" diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 976cd173c5..9555ccc5b6 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -41,7 +41,9 @@ #ifndef QT_NO_LINEEDIT +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qclipboard.h" #include #include