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 <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-07-22 15:19:13 +02:00
parent 163863f77d
commit 16f375f549
40 changed files with 84 additions and 118 deletions

View File

@ -44,8 +44,6 @@
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#ifndef QT_NO_ITEMVIEWS
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
/*! /*!
@ -1917,5 +1915,3 @@ QDebug operator<<(QDebug dbg, const QItemSelectionRange &range)
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qitemselectionmodel.cpp" #include "moc_qitemselectionmodel.cpp"
#endif // QT_NO_ITEMVIEWS

View File

@ -42,8 +42,6 @@
#include <QtCore/qglobal.h> #include <QtCore/qglobal.h>
#ifndef QT_NO_ITEMVIEWS
#include <QtCore/qset.h> #include <QtCore/qset.h>
#include <QtCore/qvector.h> #include <QtCore/qvector.h>
#include <QtCore/qlist.h> #include <QtCore/qlist.h>
@ -273,6 +271,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QItemSelectionRange) Q_DECLARE_METATYPE(QItemSelectionRange)
Q_DECLARE_METATYPE(QItemSelection) Q_DECLARE_METATYPE(QItemSelection)
#endif // QT_NO_ITEMVIEWS
#endif // QITEMSELECTIONMODEL_H #endif // QITEMSELECTIONMODEL_H

View File

@ -55,7 +55,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ITEMVIEWS
class QItemSelectionModelPrivate: public QObjectPrivate class QItemSelectionModelPrivate: public QObjectPrivate
{ {
Q_DECLARE_PUBLIC(QItemSelectionModel) Q_DECLARE_PUBLIC(QItemSelectionModel)
@ -106,8 +105,6 @@ public:
int tableColCount, tableRowCount; int tableColCount, tableRowCount;
}; };
#endif // QT_NO_ITEMVIEWS
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QITEMSELECTIONMODEL_P_H #endif // QITEMSELECTIONMODEL_P_H

View File

@ -5,7 +5,6 @@ qtConfig(accessibility) {
accessible/qaccessiblewidget.h \ accessible/qaccessiblewidget.h \
accessible/qaccessiblewidgetfactory_p.h \ accessible/qaccessiblewidgetfactory_p.h \
accessible/complexwidgets_p.h \ accessible/complexwidgets_p.h \
accessible/itemviews_p.h \
accessible/qaccessiblemenu_p.h \ accessible/qaccessiblemenu_p.h \
accessible/qaccessiblewidgets_p.h \ accessible/qaccessiblewidgets_p.h \
accessible/rangecontrols_p.h \ accessible/rangecontrols_p.h \
@ -15,9 +14,13 @@ qtConfig(accessibility) {
accessible/qaccessiblewidget.cpp \ accessible/qaccessiblewidget.cpp \
accessible/qaccessiblewidgetfactory.cpp \ accessible/qaccessiblewidgetfactory.cpp \
accessible/complexwidgets.cpp \ accessible/complexwidgets.cpp \
accessible/itemviews.cpp \
accessible/qaccessiblemenu.cpp \ accessible/qaccessiblemenu.cpp \
accessible/qaccessiblewidgets.cpp \ accessible/qaccessiblewidgets.cpp \
accessible/rangecontrols.cpp \ accessible/rangecontrols.cpp \
accessible/simplewidgets.cpp accessible/simplewidgets.cpp
qtConfig(itemviews) {
HEADERS += accessible/itemviews_p.h
SOURCES += accessible/itemviews.cpp
}
} }

View File

@ -42,7 +42,9 @@
#include <qaccessible.h> #include <qaccessible.h>
#include <qapplication.h> #include <qapplication.h>
#include <qevent.h> #include <qevent.h>
#if QT_CONFIG(itemviews)
#include <qheaderview.h> #include <qheaderview.h>
#endif
#include <qtabbar.h> #include <qtabbar.h>
#if QT_CONFIG(combobox) #if QT_CONFIG(combobox)
#include <qcombobox.h> #include <qcombobox.h>

View File

@ -54,7 +54,9 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h> #include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtCore/qpointer.h> #include <QtCore/qpointer.h>
#include <QtWidgets/qaccessiblewidget.h> #include <QtWidgets/qaccessiblewidget.h>
#if QT_CONFIG(itemviews)
#include <QtWidgets/qabstractitemview.h> #include <QtWidgets/qabstractitemview.h>
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -56,7 +56,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ITEMVIEWS
/* /*
Implementation of the IAccessible2 table2 interface. Much simpler than Implementation of the IAccessible2 table2 interface. Much simpler than
the other table interfaces since there is only the main table and cells: the other table interfaces since there is only the main table and cells:
@ -1215,8 +1214,6 @@ QHeaderView *QAccessibleTableHeaderCell::headerView() const
return header; return header;
} }
#endif // QT_NO_ITEMVIEWS
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY #endif // QT_NO_ACCESSIBILITY

View File

@ -58,13 +58,12 @@
#include <QtWidgets/qabstractitemview.h> #include <QtWidgets/qabstractitemview.h>
#include <QtWidgets/qheaderview.h> #include <QtWidgets/qheaderview.h>
QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
#ifndef QT_NO_ITEMVIEWS
class QAccessibleTableCell; class QAccessibleTableCell;
class QAccessibleTableHeaderCell; class QAccessibleTableHeaderCell;
@ -299,8 +298,6 @@ private:
}; };
#endif
#endif // QT_NO_ACCESSIBILITY #endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -43,7 +43,9 @@
#include "simplewidgets_p.h" #include "simplewidgets_p.h"
#include "rangecontrols_p.h" #include "rangecontrols_p.h"
#include "complexwidgets_p.h" #include "complexwidgets_p.h"
#if QT_CONFIG(itemviews)
#include "itemviews_p.h" #include "itemviews_p.h"
#endif
#include <qtoolbutton.h> #include <qtoolbutton.h>
#if QT_CONFIG(treeview) #if QT_CONFIG(treeview)
@ -146,11 +148,11 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QTreeView")) { } else if (classname == QLatin1String("QTreeView")) {
iface = new QAccessibleTree(widget); iface = new QAccessibleTree(widget);
#endif // QT_CONFIG(treeview) #endif // QT_CONFIG(treeview)
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
} else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) { } else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) {
iface = new QAccessibleTable(widget); iface = new QAccessibleTable(widget);
// ### This should be cleaned up. We return the parent for the scrollarea to hide it. // ### 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 #ifndef QT_NO_TABBAR
} else if (classname == QLatin1String("QTabBar")) { } else if (classname == QLatin1String("QTabBar")) {
iface = new QAccessibleTabBar(widget); iface = new QAccessibleTabBar(widget);

View File

@ -65,7 +65,9 @@
#if QT_CONFIG(calendarwidget) #if QT_CONFIG(calendarwidget)
#include <QCalendarWidget> #include <QCalendarWidget>
#endif #endif
#if QT_CONFIG(itemviews)
#include <QAbstractItemView> #include <QAbstractItemView>
#endif
#include <QDockWidget> #include <QDockWidget>
#include <QMainWindow> #include <QMainWindow>
#include <private/qdockwidget_p.h> #include <private/qdockwidget_p.h>

View File

@ -39,7 +39,6 @@
#include "qabstractitemdelegate.h" #include "qabstractitemdelegate.h"
#ifndef QT_NO_ITEMVIEWS
#include <qabstractitemmodel.h> #include <qabstractitemmodel.h>
#include <qabstractitemview.h> #include <qabstractitemview.h>
#include <qfontmetrics.h> #include <qfontmetrics.h>
@ -606,5 +605,3 @@ void QAbstractItemDelegatePrivate::_q_commitDataAndCloseEditor(QWidget *editor)
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qabstractitemdelegate.cpp" #include "moc_qabstractitemdelegate.cpp"
#endif // QT_NO_ITEMVIEWS

View File

@ -44,11 +44,10 @@
#include <QtCore/qobject.h> #include <QtCore/qobject.h>
#include <QtWidgets/qstyleoption.h> #include <QtWidgets/qstyleoption.h>
QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ITEMVIEWS
class QPainter; class QPainter;
class QModelIndex; class QModelIndex;
class QAbstractItemModel; class QAbstractItemModel;
@ -127,8 +126,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_commitDataAndCloseEditor(QWidget*)) Q_PRIVATE_SLOT(d_func(), void _q_commitDataAndCloseEditor(QWidget*))
}; };
#endif // QT_NO_ITEMVIEWS
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QABSTRACTITEMDELEGATE_H #endif // QABSTRACTITEMDELEGATE_H

View File

@ -55,7 +55,7 @@
#include "qabstractitemdelegate.h" #include "qabstractitemdelegate.h"
#include <private/qobject_p.h> #include <private/qobject_p.h>
#ifndef QT_NO_ITEMVIEWS QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -73,6 +73,4 @@ public:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_ITEMVIEWS
#endif // QABSTRACTITEMDELEGATE_P_H #endif // QABSTRACTITEMDELEGATE_P_H

View File

@ -39,7 +39,6 @@
#include "qabstractitemview.h" #include "qabstractitemview.h"
#ifndef QT_NO_ITEMVIEWS
#include <qpointer.h> #include <qpointer.h>
#include <qapplication.h> #include <qapplication.h>
#include <qclipboard.h> #include <qclipboard.h>
@ -4490,5 +4489,3 @@ QModelIndexList QAbstractItemViewPrivate::selectedDraggableIndexes() const
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qabstractitemview.cpp" #include "moc_qabstractitemview.cpp"
#endif // QT_NO_ITEMVIEWS

View File

@ -49,11 +49,10 @@
class tst_QAbstractItemView; class tst_QAbstractItemView;
class tst_QTreeView; class tst_QTreeView;
QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ITEMVIEWS
class QMenu; class QMenu;
class QDrag; class QDrag;
class QEvent; class QEvent;
@ -381,8 +380,6 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractItemView::EditTriggers) Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractItemView::EditTriggers)
#endif // QT_NO_ITEMVIEWS
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QABSTRACTITEMVIEW_H #endif // QABSTRACTITEMVIEW_H

View File

@ -64,7 +64,7 @@
#include "QtCore/qbasictimer.h" #include "QtCore/qbasictimer.h"
#include "QtCore/qelapsedtimer.h" #include "QtCore/qelapsedtimer.h"
#ifndef QT_NO_ITEMVIEWS QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -477,6 +477,4 @@ inline int qBinarySearch(const QVector<T> &vec, const T &item, int start, int en
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_ITEMVIEWS
#endif // QABSTRACTITEMVIEW_P_H #endif // QABSTRACTITEMVIEW_P_H

View File

@ -39,7 +39,6 @@
#include "qheaderview.h" #include "qheaderview.h"
#ifndef QT_NO_ITEMVIEWS
#include <qbitarray.h> #include <qbitarray.h>
#include <qbrush.h> #include <qbrush.h>
#include <qdebug.h> #include <qdebug.h>
@ -3949,6 +3948,4 @@ bool QHeaderViewPrivate::read(QDataStream &in)
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_ITEMVIEWS
#include "moc_qheaderview.cpp" #include "moc_qheaderview.cpp"

View File

@ -43,11 +43,10 @@
#include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qabstractitemview.h> #include <QtWidgets/qabstractitemview.h>
QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ITEMVIEWS
class QHeaderViewPrivate; class QHeaderViewPrivate;
class QStyleOptionHeader; class QStyleOptionHeader;
@ -265,8 +264,6 @@ inline void QHeaderView::hideSection(int alogicalIndex)
inline void QHeaderView::showSection(int alogicalIndex) inline void QHeaderView::showSection(int alogicalIndex)
{ setSectionHidden(alogicalIndex, false); } { setSectionHidden(alogicalIndex, false); }
#endif // QT_NO_ITEMVIEWS
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QHEADERVIEW_H #endif // QHEADERVIEW_H

View File

@ -54,14 +54,14 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h> #include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "private/qabstractitemview_p.h" #include "private/qabstractitemview_p.h"
#ifndef QT_NO_ITEMVIEWS
#include "QtCore/qbitarray.h" #include "QtCore/qbitarray.h"
#include "QtWidgets/qapplication.h" #include "QtWidgets/qapplication.h"
#if QT_CONFIG(label) #if QT_CONFIG(label)
#include "QtWidgets/qlabel.h" #include "QtWidgets/qlabel.h"
#endif #endif
QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QHeaderViewPrivate: public QAbstractItemViewPrivate class QHeaderViewPrivate: public QAbstractItemViewPrivate
@ -391,6 +391,4 @@ Q_DECLARE_TYPEINFO(QHeaderViewPrivate::SectionItem, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_ITEMVIEWS
#endif // QHEADERVIEW_P_H #endif // QHEADERVIEW_P_H

View File

@ -39,7 +39,6 @@
#include "qitemdelegate.h" #include "qitemdelegate.h"
#ifndef QT_NO_ITEMVIEWS
#include <qabstractitemmodel.h> #include <qabstractitemmodel.h>
#include <qapplication.h> #include <qapplication.h>
#include <qbrush.h> #include <qbrush.h>
@ -1199,5 +1198,3 @@ QStyleOptionViewItem QItemDelegate::setOptions(const QModelIndex &index,
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qitemdelegate.cpp" #include "moc_qitemdelegate.cpp"
#endif // QT_NO_ITEMVIEWS

View File

@ -46,11 +46,10 @@
#include <QtGui/qpixmap.h> #include <QtGui/qpixmap.h>
#include <QtCore/qvariant.h> #include <QtCore/qvariant.h>
QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ITEMVIEWS
class QItemDelegatePrivate; class QItemDelegatePrivate;
class QItemEditorFactory; class QItemEditorFactory;
@ -126,8 +125,6 @@ private:
Q_DISABLE_COPY(QItemDelegate) Q_DISABLE_COPY(QItemDelegate)
}; };
#endif // QT_NO_ITEMVIEWS
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QITEMDELEGATE_H #endif // QITEMDELEGATE_H

View File

@ -41,8 +41,6 @@
#include "qitemeditorfactory.h" #include "qitemeditorfactory.h"
#include "qitemeditorfactory_p.h" #include "qitemeditorfactory_p.h"
#ifndef QT_NO_ITEMVIEWS
#if QT_CONFIG(combobox) #if QT_CONFIG(combobox)
#include <qcombobox.h> #include <qcombobox.h>
#endif #endif
@ -627,5 +625,3 @@ QT_END_NAMESPACE
#endif #endif
#include "moc_qitemeditorfactory_p.cpp" #include "moc_qitemeditorfactory_p.cpp"
#endif // QT_NO_ITEMVIEWS

View File

@ -46,11 +46,10 @@
#include <QtCore/qhash.h> #include <QtCore/qhash.h>
#include <QtCore/qvariant.h> #include <QtCore/qvariant.h>
QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ITEMVIEWS
class QWidget; class QWidget;
class Q_WIDGETS_EXPORT QItemEditorCreatorBase class Q_WIDGETS_EXPORT QItemEditorCreatorBase
@ -111,8 +110,6 @@ private:
QHash<int, QItemEditorCreatorBase *> creatorMap; QHash<int, QItemEditorCreatorBase *> creatorMap;
}; };
#endif // QT_NO_ITEMVIEWS
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QITEMEDITORFACTORY_H #endif // QITEMEDITORFACTORY_H

View File

@ -55,12 +55,11 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h> #include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <qlineedit.h> #include <qlineedit.h>
#ifndef QT_NO_ITEMVIEWS
#ifndef QT_NO_LINEEDIT #ifndef QT_NO_LINEEDIT
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE
class QExpandingLineEdit : public QLineEdit class QExpandingLineEdit : public QLineEdit
{ {
@ -92,6 +91,4 @@ QT_END_NAMESPACE
#endif // QT_NO_LINEEDIT #endif // QT_NO_LINEEDIT
#endif //QT_NO_ITEMVIEWS
#endif //QITEMEDITORFACTORY_P_H #endif //QITEMEDITORFACTORY_P_H

View File

@ -39,7 +39,6 @@
#include "qstyleditemdelegate.h" #include "qstyleditemdelegate.h"
#ifndef QT_NO_ITEMVIEWS
#include <qabstractitemmodel.h> #include <qabstractitemmodel.h>
#include <qapplication.h> #include <qapplication.h>
#include <qbrush.h> #include <qbrush.h>
@ -643,5 +642,3 @@ bool QStyledItemDelegate::editorEvent(QEvent *event,
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qstyleditemdelegate.cpp" #include "moc_qstyleditemdelegate.cpp"
#endif // QT_NO_ITEMVIEWS

View File

@ -46,11 +46,10 @@
#include <QtGui/qpixmap.h> #include <QtGui/qpixmap.h>
#include <QtCore/qvariant.h> #include <QtCore/qvariant.h>
QT_REQUIRE_CONFIG(itemviews);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_ITEMVIEWS
class QStyledItemDelegatePrivate; class QStyledItemDelegatePrivate;
class QItemEditorFactory; class QItemEditorFactory;
@ -101,8 +100,6 @@ private:
Q_DISABLE_COPY(QStyledItemDelegate) Q_DISABLE_COPY(QStyledItemDelegate)
}; };
#endif // QT_NO_ITEMVIEWS
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QSTYLEDITEMDELEGATE_H #endif // QSTYLEDITEMDELEGATE_H

View File

@ -41,7 +41,9 @@
#include "qcommonstyle_p.h" #include "qcommonstyle_p.h"
#include <qfile.h> #include <qfile.h>
#if QT_CONFIG(itemviews)
#include <qabstractitemview.h> #include <qabstractitemview.h>
#endif
#include <qapplication.h> #include <qapplication.h>
#include <private/qguiapplication_p.h> #include <private/qguiapplication_p.h>
#include <qpa/qplatformtheme.h> #include <qpa/qplatformtheme.h>
@ -91,7 +93,7 @@
#include <limits.h> #include <limits.h>
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
# include "private/qtextengine_p.h" # include "private/qtextengine_p.h"
#endif #endif
@ -675,7 +677,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
else else
p->drawRect(rect); p->drawRect(rect);
break; } break; }
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
case PE_PanelItemViewRow: case PE_PanelItemViewRow:
if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)) 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; break;
#endif //QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
case PE_PanelScrollAreaCorner: { case PE_PanelScrollAreaCorner: {
const QBrush brush(opt->palette.brush(QPalette::Window)); const QBrush brush(opt->palette.brush(QPalette::Window));
p->fillRect(opt->rect, brush); p->fillRect(opt->rect, brush);
@ -824,7 +826,7 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut
} }
#endif // QT_NO_TOOLBUTTON #endif // QT_NO_TOOLBUTTON
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth) static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth)
{ {
@ -1095,7 +1097,7 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect
*textRect = display; *textRect = display;
} }
} }
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
#ifndef QT_NO_TABBAR #ifndef QT_NO_TABBAR
@ -2168,7 +2170,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
} }
break; break;
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
case CE_ItemViewItem: case CE_ItemViewItem:
if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
p->save(); p->save();
@ -2248,7 +2250,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
} }
break; break;
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
#ifndef QT_NO_FRAME #ifndef QT_NO_FRAME
case CE_ShapedFrame: case CE_ShapedFrame:
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
@ -3020,7 +3022,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
break; break;
} }
#endif #endif
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
case SE_ItemViewItemCheckIndicator: case SE_ItemViewItemCheckIndicator:
if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
r = subElementRect(SE_CheckBoxIndicator, opt, widget); r = subElementRect(SE_CheckBoxIndicator, opt, widget);
@ -3047,7 +3049,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
r = d->displayRect; r = d->displayRect;
} }
break; break;
#endif //QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
#ifndef QT_NO_TOOLBAR #ifndef QT_NO_TOOLBAR
case SE_ToolBarHandle: case SE_ToolBarHandle:
if (const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) { if (const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
@ -4897,7 +4899,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(1 + 3 * (buttonSize + 1), buttonSize); sz = QSize(1 + 3 * (buttonSize + 1), buttonSize);
} }
break; break;
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
case CT_ItemViewItem: case CT_ItemViewItem:
if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
QRect decorationRect, displayRect, checkRect; QRect decorationRect, displayRect, checkRect;
@ -4909,7 +4911,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
break; break;
#else #else
Q_UNUSED(d); Q_UNUSED(d);
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
#ifndef QT_NO_SPINBOX #ifndef QT_NO_SPINBOX
case CT_SpinBox: case CT_SpinBox:
if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {

View File

@ -68,7 +68,7 @@ class QCommonStylePrivate : public QStylePrivate
Q_DECLARE_PUBLIC(QCommonStyle) Q_DECLARE_PUBLIC(QCommonStyle)
public: public:
inline QCommonStylePrivate() : inline QCommonStylePrivate() :
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
cachedOption(0), cachedOption(0),
#endif #endif
animationFps(30) animationFps(30)
@ -79,12 +79,12 @@ public:
#ifndef QT_NO_ANIMATION #ifndef QT_NO_ANIMATION
qDeleteAll(animations); qDeleteAll(animations);
#endif #endif
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
delete cachedOption; delete cachedOption;
#endif #endif
} }
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
void viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const; void viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const;
void viewItemLayout(const QStyleOptionViewItem *opt, QRect *checkRect, void viewItemLayout(const QStyleOptionViewItem *opt, QRect *checkRect,
QRect *pixmapRect, QRect *textRect, bool sizehint) const; QRect *pixmapRect, QRect *textRect, bool sizehint) const;

View File

@ -55,11 +55,13 @@
#if QT_CONFIG(combobox) #if QT_CONFIG(combobox)
#include <QComboBox> #include <QComboBox>
#endif #endif
#if QT_CONFIG(itemviews)
#include <QAbstractItemView> #include <QAbstractItemView>
#include <QStyledItemDelegate>
#endif
#if QT_CONFIG(listview) #if QT_CONFIG(listview)
#include <QListView> #include <QListView>
#endif #endif
#include <QStyledItemDelegate>
#include <QAbstractScrollArea> #include <QAbstractScrollArea>
#include <QScrollBar> #include <QScrollBar>

View File

@ -3000,7 +3000,7 @@ QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
\sa Qt::WindowFlags \sa Qt::WindowFlags
*/ */
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
/*! /*!
\class QStyleOptionViewItem \class QStyleOptionViewItem
\brief The QStyleOptionViewItem class is used to describe the \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. therefore both at the beginning and the end.
*/ */
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
/*! /*!
\fn T qstyleoption_cast<T>(const QStyleOption *option) \fn T qstyleoption_cast<T>(const QStyleOption *option)
\relates QStyleOption \relates QStyleOption

View File

@ -53,7 +53,7 @@
#include <QtWidgets/qrubberband.h> #include <QtWidgets/qrubberband.h>
#endif #endif
#include <QtWidgets/qframe.h> #include <QtWidgets/qframe.h>
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
# include <QtCore/qabstractitemmodel.h> # include <QtCore/qabstractitemmodel.h>
#endif #endif
@ -388,7 +388,7 @@ protected:
typedef Q_DECL_DEPRECATED QStyleOptionDockWidget QStyleOptionDockWidgetV2; typedef Q_DECL_DEPRECATED QStyleOptionDockWidget QStyleOptionDockWidgetV2;
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
class Q_WIDGETS_EXPORT QStyleOptionViewItem : public QStyleOption 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 QStyleOptionViewItemV3;
typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV4; typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV4;
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
class Q_WIDGETS_EXPORT QStyleOptionToolBox : public QStyleOption class Q_WIDGETS_EXPORT QStyleOptionToolBox : public QStyleOption
{ {

View File

@ -71,7 +71,9 @@
#include <qcheckbox.h> #include <qcheckbox.h>
#endif #endif
#include <qstatusbar.h> #include <qstatusbar.h>
#if QT_CONFIG(itemviews)
#include <qheaderview.h> #include <qheaderview.h>
#endif
#include <private/qwindowsstyle_p_p.h> #include <private/qwindowsstyle_p_p.h>
#include <private/qstyleanimation_p.h> #include <private/qstyleanimation_p.h>
#include <qtabbar.h> #include <qtabbar.h>
@ -2008,7 +2010,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
extraClass |= PseudoClass_Movable; extraClass |= PseudoClass_Movable;
} }
#endif // QT_NO_DOCKWIDGET #endif // QT_NO_DOCKWIDGET
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
else if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { else if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
if (vopt->features & QStyleOptionViewItem::Alternate) if (vopt->features & QStyleOptionViewItem::Alternate)
extraClass |= PseudoClass_Alternate; extraClass |= PseudoClass_Alternate;
@ -2805,7 +2807,7 @@ void QStyleSheetStyle::polish(QWidget *w)
QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Any); QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Any);
if (rule.hasDrawable() || rule.hasBox()) { if (rule.hasDrawable() || rule.hasBox()) {
if (w->metaObject() == &QWidget::staticMetaObject if (w->metaObject() == &QWidget::staticMetaObject
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
|| qobject_cast<QHeaderView *>(w) || qobject_cast<QHeaderView *>(w)
#endif #endif
#ifndef QT_NO_TABBAR #ifndef QT_NO_TABBAR
@ -4069,7 +4071,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
fallback = true; fallback = true;
break; break;
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
case CE_ItemViewItem: case CE_ItemViewItem:
if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
@ -4086,7 +4088,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
return; return;
} }
break; break;
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
#ifndef QT_NO_TABBAR #ifndef QT_NO_TABBAR
case CE_TabBarTab: case CE_TabBarTab:
@ -5107,7 +5109,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
} }
break; break;
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
case CT_ItemViewItem: { case CT_ItemViewItem: {
QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem);
sz = baseStyle()->sizeFromContents(ct, opt, csz, w); sz = baseStyle()->sizeFromContents(ct, opt, csz, w);
@ -5116,7 +5118,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
sz = subRule.boxSize(sz); sz = subRule.boxSize(sz);
return sz; return sz;
} }
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
default: default:
break; break;
@ -5756,7 +5758,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
case SE_CheckBoxClickRect: // relies on indicator and contents case SE_CheckBoxClickRect: // relies on indicator and contents
return ParentStyle::subElementRect(se, opt, w); return ParentStyle::subElementRect(se, opt, w);
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
case SE_ViewItemCheckIndicator: case SE_ViewItemCheckIndicator:
if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
return subElementRect(SE_CheckBoxIndicator, opt, w); return subElementRect(SE_CheckBoxIndicator, opt, w);
@ -5785,7 +5787,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c
} }
} }
break; break;
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
case SE_HeaderArrow: { case SE_HeaderArrow: {
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow); QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow);

View File

@ -1438,7 +1438,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
} }
} }
break; break;
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
case CE_ItemViewItem: case CE_ItemViewItem:
{ {
const QStyleOptionViewItem *vopt; const QStyleOptionViewItem *vopt;
@ -1473,7 +1473,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
} }
break; break;
} }
#endif // QT_NO_ITEMVIEWS #endif // QT_CONFIG(itemviews)
#if QT_CONFIG(combobox) #if QT_CONFIG(combobox)
case CE_ComboBoxLabel: case CE_ComboBoxLabel:
QCommonStyle::drawControl(element, option, painter, widget); QCommonStyle::drawControl(element, option, painter, widget);

View File

@ -40,7 +40,9 @@
#include "private/qabstractbutton_p.h" #include "private/qabstractbutton_p.h"
#include "private/qbuttongroup_p.h" #include "private/qbuttongroup_p.h"
#if QT_CONFIG(itemviews)
#include "qabstractitemview.h" #include "qabstractitemview.h"
#endif
#include "qbuttongroup.h" #include "qbuttongroup.h"
#include "qabstractbutton_p.h" #include "qabstractbutton_p.h"
#include "qevent.h" #include "qevent.h"
@ -1071,7 +1073,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
#ifndef QT_NO_BUTTONGROUP #ifndef QT_NO_BUTTONGROUP
|| d->group || d->group
#endif #endif
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
|| (pw && qobject_cast<QAbstractItemView *>(pw->parentWidget())) || (pw && qobject_cast<QAbstractItemView *>(pw->parentWidget()))
#endif #endif
) { ) {

View File

@ -50,7 +50,9 @@
#include "qboxlayout.h" #include "qboxlayout.h"
#include "qpainter.h" #include "qpainter.h"
#include "qmargins.h" #include "qmargins.h"
#if QT_CONFIG(itemviews)
#include "qheaderview.h" #include "qheaderview.h"
#endif
#include <QDebug> #include <QDebug>

View File

@ -68,7 +68,9 @@
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h" #include "qaccessible.h"
#endif #endif
#if QT_CONFIG(itemviews)
#include "qabstractitemview.h" #include "qabstractitemview.h"
#endif
#include "private/qstylesheetstyle_p.h" #include "private/qstylesheetstyle_p.h"
#ifndef QT_NO_SHORTCUT #ifndef QT_NO_SHORTCUT

View File

@ -43,7 +43,9 @@
#ifndef QT_NO_LINEEDIT #ifndef QT_NO_LINEEDIT
#include "qvariant.h" #include "qvariant.h"
#if QT_CONFIG(itemviews)
#include "qabstractitemview.h" #include "qabstractitemview.h"
#endif
#include "qdrag.h" #include "qdrag.h"
#include "qwidgetaction.h" #include "qwidgetaction.h"
#include "qclipboard.h" #include "qclipboard.h"

View File

@ -85,7 +85,7 @@ private:
Q_DISABLE_COPY(QScrollBar) Q_DISABLE_COPY(QScrollBar)
Q_DECLARE_PRIVATE(QScrollBar) Q_DECLARE_PRIVATE(QScrollBar)
#ifndef QT_NO_ITEMVIEWS #if QT_CONFIG(itemviews)
friend class QTableView; friend class QTableView;
friend class QTreeViewPrivate; friend class QTreeViewPrivate;
friend class QCommonListViewBase; friend class QCommonListViewBase;

View File

@ -38,7 +38,9 @@
****************************************************************************/ ****************************************************************************/
#include "private/qlayoutengine_p.h" #include "private/qlayoutengine_p.h"
#if QT_CONFIG(itemviews)
#include "qabstractitemdelegate.h" #include "qabstractitemdelegate.h"
#endif
#include "qapplication.h" #include "qapplication.h"
#include "qbitmap.h" #include "qbitmap.h"
#include "qcursor.h" #include "qcursor.h"

View File

@ -41,7 +41,9 @@
#ifndef QT_NO_LINEEDIT #ifndef QT_NO_LINEEDIT
#if QT_CONFIG(itemviews)
#include "qabstractitemview.h" #include "qabstractitemview.h"
#endif
#include "qclipboard.h" #include "qclipboard.h"
#include <private/qguiapplication_p.h> #include <private/qguiapplication_p.h>
#include <qpa/qplatformtheme.h> #include <qpa/qplatformtheme.h>