Convert features.listview to QT_[REQUIRE_]CONFIG

Change-Id: I707a839bcfc7ad481342d1adb98c9b593f5ca6e2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-07-09 17:01:21 +02:00
parent 6e2eeee7f5
commit e70258a155
14 changed files with 35 additions and 24 deletions

View File

@ -45,7 +45,9 @@
#ifdef QT_WIDGETS_LIB
#include <QtWidgets/qitemdelegate.h>
#if QT_CONFIG(listview)
#include <QtWidgets/qlistview.h>
#endif
#include <QtWidgets/qcombobox.h>
#include <QtSql/qsqldriver.h>
#include <QtSql/qsqlrelationaltablemodel.h>

View File

@ -45,7 +45,6 @@
#include <qheaderview.h>
#include <qtabbar.h>
#include <qcombobox.h>
#include <qlistview.h>
#include <qlineedit.h>
#include <qstyle.h>
#include <qstyleoption.h>

View File

@ -43,7 +43,9 @@
#if QT_CONFIG(tableview)
#include <qtableview.h>
#endif
#if QT_CONFIG(listview)
#include <qlistview.h>
#endif
#if QT_CONFIG(treeview)
#include <qtreeview.h>
#include <private/qtreeview_p.h>
@ -96,7 +98,7 @@ QAccessibleTable::QAccessibleTable(QWidget *w)
m_role = QAccessible::Tree;
} else
#endif
#ifndef QT_NO_LISTVIEW
#if QT_CONFIG(listview)
if (qobject_cast<const QListView*>(view())) {
m_role = QAccessible::List;
} else

View File

@ -55,7 +55,6 @@
#include <QtGui/qpainter.h>
#include <QtWidgets/qstyleoption.h>
#include <QtWidgets/qgraphicsview.h>
#include <QtWidgets/qlistview.h>
#include <QtWidgets/qlineedit.h>
#include <QtWidgets/qtextedit.h>

View File

@ -6,8 +6,6 @@ HEADERS += \
itemviews/qabstractitemview_p.h \
itemviews/qheaderview.h \
itemviews/qheaderview_p.h \
itemviews/qlistview.h \
itemviews/qlistview_p.h \
itemviews/qbsptree_p.h \
itemviews/qabstractitemdelegate.h \
itemviews/qabstractitemdelegate_p.h \
@ -22,7 +20,6 @@ HEADERS += \
SOURCES += \
itemviews/qabstractitemview.cpp \
itemviews/qheaderview.cpp \
itemviews/qlistview.cpp \
itemviews/qbsptree.cpp \
itemviews/qabstractitemdelegate.cpp \
itemviews/qitemdelegate.cpp \
@ -43,6 +40,14 @@ qtConfig(columnview) {
itemviews/qcolumnviewgrip.cpp
}
qtConfig(listview) {
HEADERS += \
itemviews/qlistview.h \
itemviews/qlistview_p.h
SOURCES += itemviews/qlistview.cpp
}
qtConfig(listwidget) {
HEADERS += \
itemviews/qlistwidget.h \

View File

@ -40,7 +40,6 @@
#include "qlistview.h"
#ifndef QT_NO_LISTVIEW
#include <qabstractitemdelegate.h>
#include <qapplication.h>
#include <qpainter.h>
@ -3298,5 +3297,3 @@ QSize QListView::viewportSizeHint() const
QT_END_NAMESPACE
#include "moc_qlistview.cpp"
#endif // QT_NO_LISTVIEW

View File

@ -43,11 +43,10 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qabstractitemview.h>
QT_REQUIRE_CONFIG(listview);
QT_BEGIN_NAMESPACE
#ifndef QT_NO_LISTVIEW
class QListViewPrivate;
class Q_WIDGETS_EXPORT QListView : public QAbstractItemView
@ -195,8 +194,6 @@ private:
Q_DISABLE_COPY(QListView)
};
#endif // QT_NO_LISTVIEW
QT_END_NAMESPACE
#endif // QLISTVIEW_H

View File

@ -58,7 +58,7 @@
#include <limits.h>
#include <qscrollbar.h>
#ifndef QT_NO_LISTVIEW
QT_REQUIRE_CONFIG(listview);
QT_BEGIN_NAMESPACE
@ -474,6 +474,4 @@ inline bool QCommonListViewBase::isRightToLeft() const { return qq->isRightToLef
QT_END_NAMESPACE
#endif // QT_NO_LISTVIEW
#endif // QLISTVIEW_P_H

View File

@ -69,7 +69,9 @@
#include <qheaderview.h>
#include <qlayout.h>
#include <qlineedit.h>
#if QT_CONFIG(listview)
#include <qlistview.h>
#endif
#include <qmainwindow.h>
#include <qmap.h>
#include <qmenubar.h>

View File

@ -54,7 +54,9 @@
#include <QEvent>
#include <QComboBox>
#include <QAbstractItemView>
#if QT_CONFIG(listview)
#include <QListView>
#endif
#include <QStyledItemDelegate>
#include <QAbstractScrollArea>
#include <QScrollBar>

View File

@ -65,7 +65,9 @@
#if QT_CONFIG(wizard)
#include "qwizard.h"
#endif
#if QT_CONFIG(listview)
#include "qlistview.h"
#endif
#include <private/qmath_p.h>
#include <qmath.h>
#include <QtGui/qscreen.h>
@ -548,7 +550,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
break;
case SH_ItemView_ShowDecorationSelected:
#ifndef QT_NO_LISTVIEW
#if QT_CONFIG(listview)
if (qobject_cast<const QListView*>(widget))
ret = 1;
#endif

View File

@ -76,7 +76,9 @@
#include <qscrollbar.h>
#include <qprogressbar.h>
#include <qdockwidget.h>
#if QT_CONFIG(listview)
#include <qlistview.h>
#endif
#if QT_CONFIG(treeview)
#include <qtreeview.h>
#endif

View File

@ -63,7 +63,9 @@
#include <qscrollbar.h>
#include <qheaderview.h>
#include <qspinbox.h>
#if QT_CONFIG(listview)
#include <qlistview.h>
#endif
#include <qstackedwidget.h>
#if QT_CONFIG(pushbutton)
#include <qpushbutton.h>

View File

@ -152,7 +152,9 @@
#include "QtWidgets/qfilesystemmodel.h"
#endif
#include "QtWidgets/qheaderview.h"
#if QT_CONFIG(listview)
#include "QtWidgets/qlistview.h"
#endif
#include "QtWidgets/qapplication.h"
#include "QtGui/qevent.h"
#include "QtWidgets/qdesktopwidget.h"
@ -816,11 +818,11 @@ void QCompleterPrivate::init(QAbstractItemModel *m)
proxy = new QCompletionModel(this, q);
QObject::connect(proxy, SIGNAL(rowsAdded()), q, SLOT(_q_autoResizePopup()));
q->setModel(m);
#ifdef QT_NO_LISTVIEW
#if !QT_CONFIG(listview)
q->setCompletionMode(QCompleter::InlineCompletion);
#else
q->setCompletionMode(QCompleter::PopupCompletion);
#endif // QT_NO_LISTVIEW
#endif // QT_CONFIG(listview)
}
void QCompleterPrivate::setCurrentIndex(QModelIndex index, bool select)
@ -1214,7 +1216,7 @@ void QCompleter::setPopup(QAbstractItemView *popup)
popup->setFocusProxy(d->widget);
popup->installEventFilter(this);
popup->setItemDelegate(new QCompleterItemDelegate(popup));
#ifndef QT_NO_LISTVIEW
#if QT_CONFIG(listview)
if (QListView *listView = qobject_cast<QListView *>(popup)) {
listView->setModelColumn(d->column);
}
@ -1238,7 +1240,7 @@ void QCompleter::setPopup(QAbstractItemView *popup)
QAbstractItemView *QCompleter::popup() const
{
Q_D(const QCompleter);
#ifndef QT_NO_LISTVIEW
#if QT_CONFIG(listview)
if (!d->popup && completionMode() != QCompleter::InlineCompletion) {
QListView *listView = new QListView;
listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
@ -1249,7 +1251,7 @@ QAbstractItemView *QCompleter::popup() const
QCompleter *that = const_cast<QCompleter*>(this);
that->setPopup(listView);
}
#endif // QT_NO_LISTVIEW
#endif // QT_CONFIG(listview)
return d->popup;
}
@ -1580,7 +1582,7 @@ void QCompleter::setCompletionColumn(int column)
Q_D(QCompleter);
if (d->column == column)
return;
#ifndef QT_NO_LISTVIEW
#if QT_CONFIG(listview)
if (QListView *listView = qobject_cast<QListView *>(d->popup))
listView->setModelColumn(column);
#endif