From ebe1c953c0b73867733f7890ea36e949940002e8 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 13 Jun 2017 21:03:57 +0200 Subject: [PATCH] Convert features.listwidget to QT_[REQUIRE_]CONFIG Also fix too specific #includes on the way Change-Id: Id626928513e89dd4a8854640994661f0d329470b Reviewed-by: Oswald Buddenhagen --- src/widgets/dialogs/qinputdialog.cpp | 2 +- src/widgets/dialogs/qsidebar_p.h | 2 +- src/widgets/itemviews/itemviews.pri | 11 ++++++++--- src/widgets/itemviews/qlistwidget.cpp | 3 --- src/widgets/itemviews/qlistwidget.h | 7 ++----- src/widgets/itemviews/qlistwidget_p.h | 4 +--- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp index 4ca3923d8d..47551ae6fd 100644 --- a/src/widgets/dialogs/qinputdialog.cpp +++ b/src/widgets/dialogs/qinputdialog.cpp @@ -48,7 +48,7 @@ #include "qlayout.h" #include "qlineedit.h" #include "qplaintextedit.h" -#include "qlistwidget.h" +#include "qlistview.h" #include "qpushbutton.h" #include "qspinbox.h" #include "qstackedlayout.h" diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h index 0685e81b2b..ee57f2fb48 100644 --- a/src/widgets/dialogs/qsidebar_p.h +++ b/src/widgets/dialogs/qsidebar_p.h @@ -52,7 +52,7 @@ // #include -#include +#include #include #include #include diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index 799458e4ad..a1401aff98 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -17,8 +17,6 @@ HEADERS += \ itemviews/qabstractitemdelegate_p.h \ itemviews/qitemdelegate.h \ itemviews/qdirmodel.h \ - itemviews/qlistwidget.h \ - itemviews/qlistwidget_p.h \ itemviews/qtreewidget.h \ itemviews/qtreewidget_p.h \ itemviews/qwidgetitemdata_p.h \ @@ -38,7 +36,6 @@ SOURCES += \ itemviews/qabstractitemdelegate.cpp \ itemviews/qitemdelegate.cpp \ itemviews/qdirmodel.cpp \ - itemviews/qlistwidget.cpp \ itemviews/qtreewidget.cpp \ itemviews/qitemeditorfactory.cpp \ itemviews/qtreewidgetitemiterator.cpp \ @@ -57,6 +54,14 @@ qtConfig(columnview) { itemviews/qcolumnviewgrip.cpp } +qtConfig(listwidget) { + HEADERS += \ + itemviews/qlistwidget.h \ + itemviews/qlistwidget_p.h + + SOURCES += itemviews/qlistwidget.cpp +} + qtConfig(tablewidget) { HEADERS += \ itemviews/qtablewidget.h \ diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index 0a1f85facb..21747d4e6e 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -39,7 +39,6 @@ #include "qlistwidget.h" -#ifndef QT_NO_LISTWIDGET #include #include #include @@ -1969,5 +1968,3 @@ QT_END_NAMESPACE #include "moc_qlistwidget.cpp" #include "moc_qlistwidget_p.cpp" - -#endif // QT_NO_LISTWIDGET diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h index 85ca639e50..4e67486708 100644 --- a/src/widgets/itemviews/qlistwidget.h +++ b/src/widgets/itemviews/qlistwidget.h @@ -46,11 +46,10 @@ #include #include +QT_REQUIRE_CONFIG(listwidget); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_LISTWIDGET - class QListWidget; class QListModel; class QWidgetItemData; @@ -329,8 +328,6 @@ inline void QListWidgetItem::setHidden(bool ahide) inline bool QListWidgetItem::isHidden() const { return (view ? view->isItemHidden(this) : false); } -#endif // QT_NO_LISTWIDGET - QT_END_NAMESPACE #endif // QLISTWIDGET_H diff --git a/src/widgets/itemviews/qlistwidget_p.h b/src/widgets/itemviews/qlistwidget_p.h index 0594fd511e..e8f5540f9c 100644 --- a/src/widgets/itemviews/qlistwidget_p.h +++ b/src/widgets/itemviews/qlistwidget_p.h @@ -58,7 +58,7 @@ #include #include -#ifndef QT_NO_LISTWIDGET +QT_REQUIRE_CONFIG(listwidget); QT_BEGIN_NAMESPACE @@ -171,6 +171,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_LISTWIDGET - #endif // QLISTWIDGET_P_H