diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp index eec9a0021c..3cef564781 100644 --- a/src/widgets/accessible/itemviews.cpp +++ b/src/widgets/accessible/itemviews.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #ifndef QT_NO_ACCESSIBILITY diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index a1401aff98..af0a6f6898 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -17,12 +17,9 @@ HEADERS += \ itemviews/qabstractitemdelegate_p.h \ itemviews/qitemdelegate.h \ itemviews/qdirmodel.h \ - itemviews/qtreewidget.h \ - itemviews/qtreewidget_p.h \ itemviews/qwidgetitemdata_p.h \ itemviews/qitemeditorfactory.h \ itemviews/qitemeditorfactory_p.h \ - itemviews/qtreewidgetitemiterator.h \ itemviews/qdatawidgetmapper.h \ itemviews/qstyleditemdelegate.h @@ -36,9 +33,7 @@ SOURCES += \ itemviews/qabstractitemdelegate.cpp \ itemviews/qitemdelegate.cpp \ itemviews/qdirmodel.cpp \ - itemviews/qtreewidget.cpp \ itemviews/qitemeditorfactory.cpp \ - itemviews/qtreewidgetitemiterator.cpp \ itemviews/qdatawidgetmapper.cpp \ itemviews/qstyleditemdelegate.cpp } @@ -70,6 +65,17 @@ qtConfig(tablewidget) { SOURCES += itemviews/qtablewidget.cpp } +qtConfig(treewidget) { + HEADERS += \ + itemviews/qtreewidget.h \ + itemviews/qtreewidget_p.h \ + itemviews/qtreewidgetitemiterator.h + + SOURCES += \ + itemviews/qtreewidget.cpp \ + itemviews/qtreewidgetitemiterator.cpp +} + HEADERS += \ itemviews/qfileiconprovider.h \ itemviews/qfileiconprovider_p.h \ diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index 8ce36ab47e..337089056d 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -39,7 +39,6 @@ #include "qtreewidget.h" -#ifndef QT_NO_TREEWIDGET #include #include #include @@ -3461,5 +3460,3 @@ QT_END_NAMESPACE #include "moc_qtreewidget.cpp" #include "moc_qtreewidget_p.cpp" - -#endif // QT_NO_TREEWIDGET diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h index fc0bccf2fe..27b7fa4fb1 100644 --- a/src/widgets/itemviews/qtreewidget.h +++ b/src/widgets/itemviews/qtreewidget.h @@ -46,11 +46,10 @@ #include #include +QT_REQUIRE_CONFIG(treewidget); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_TREEWIDGET - class QTreeWidget; class QTreeModel; class QWidgetItemData; @@ -422,8 +421,6 @@ inline void QTreeWidgetItem::setDisabled(bool disabled) inline bool QTreeWidgetItem::isDisabled() const { return !(flags() & Qt::ItemIsEnabled); } -#endif // QT_NO_TREEWIDGET - QT_END_NAMESPACE #endif // QTREEWIDGET_H diff --git a/src/widgets/itemviews/qtreewidget_p.h b/src/widgets/itemviews/qtreewidget_p.h index 7789693db4..7aa4daefc0 100644 --- a/src/widgets/itemviews/qtreewidget_p.h +++ b/src/widgets/itemviews/qtreewidget_p.h @@ -59,7 +59,7 @@ #include #include -#ifndef QT_NO_TREEWIDGET +QT_REQUIRE_CONFIG(treewidget); QT_BEGIN_NAMESPACE @@ -242,6 +242,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_TREEWIDGET - #endif // QTREEWIDGET_P_H diff --git a/src/widgets/itemviews/qtreewidgetitemiterator.cpp b/src/widgets/itemviews/qtreewidgetitemiterator.cpp index 4f27af70a8..1c1f60bc37 100644 --- a/src/widgets/itemviews/qtreewidgetitemiterator.cpp +++ b/src/widgets/itemviews/qtreewidgetitemiterator.cpp @@ -42,8 +42,6 @@ #include "qtreewidget_p.h" #include "qwidgetitemdata_p.h" -#ifndef QT_NO_TREEWIDGET - QT_BEGIN_NAMESPACE /*! @@ -453,5 +451,3 @@ void QTreeWidgetItemIteratorPrivate::ensureValidIterator(const QTreeWidgetItem * */ QT_END_NAMESPACE - -#endif // QT_NO_TREEWIDGET diff --git a/src/widgets/itemviews/qtreewidgetitemiterator.h b/src/widgets/itemviews/qtreewidgetitemiterator.h index db17a96abd..39e0244776 100644 --- a/src/widgets/itemviews/qtreewidgetitemiterator.h +++ b/src/widgets/itemviews/qtreewidgetitemiterator.h @@ -43,11 +43,10 @@ #include #include +QT_REQUIRE_CONFIG(treewidget); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_TREEWIDGET - class QTreeWidget; class QTreeWidgetItem; class QTreeModel; @@ -146,7 +145,5 @@ inline QTreeWidgetItem *QTreeWidgetItemIterator::operator*() const Q_DECLARE_OPERATORS_FOR_FLAGS(QTreeWidgetItemIterator::IteratorFlags) - QT_END_NAMESPACE -#endif // QT_NO_TREEWIDGET #endif // QTREEWIDGETITEMITERATOR_H