From aad21102e94d0327fe16e089252aeb21b4dbb9ae Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 30 May 2017 21:09:02 +0200 Subject: [PATCH] Convert features.columnview to QT_[REQUIRE_]CONFIG Side effect: fix of QT_NO_COLUMNVIEW <-> QT_NO_QCOLUMNVIEW inconsistency. Change-Id: I42702ea7b362a4b6fb5dad78ee105e6cbbf8bcf6 Reviewed-by: Oswald Buddenhagen --- src/widgets/itemviews/itemviews.pri | 16 +++++++++++----- src/widgets/itemviews/qcolumnview.h | 7 ++----- src/widgets/itemviews/qcolumnview_p.h | 8 +++----- src/widgets/itemviews/qcolumnviewgrip.cpp | 4 ---- src/widgets/itemviews/qcolumnviewgrip_p.h | 4 +--- src/widgets/styles/qcommonstyle.cpp | 4 ++-- 6 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index d78bc4b40e..ed0e3fe072 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -28,9 +28,6 @@ HEADERS += \ itemviews/qitemeditorfactory_p.h \ itemviews/qtreewidgetitemiterator.h \ itemviews/qdatawidgetmapper.h \ - itemviews/qcolumnviewgrip_p.h \ - itemviews/qcolumnview.h \ - itemviews/qcolumnview_p.h \ itemviews/qstyleditemdelegate.h SOURCES += \ @@ -49,11 +46,20 @@ SOURCES += \ itemviews/qitemeditorfactory.cpp \ itemviews/qtreewidgetitemiterator.cpp \ itemviews/qdatawidgetmapper.cpp \ - itemviews/qcolumnview.cpp \ - itemviews/qcolumnviewgrip.cpp \ itemviews/qstyleditemdelegate.cpp } +qtConfig(columnview) { + HEADERS += \ + itemviews/qcolumnviewgrip_p.h \ + itemviews/qcolumnview.h \ + itemviews/qcolumnview_p.h + + SOURCES += \ + itemviews/qcolumnview.cpp \ + itemviews/qcolumnviewgrip.cpp +} + HEADERS += \ itemviews/qfileiconprovider.h \ itemviews/qfileiconprovider_p.h \ diff --git a/src/widgets/itemviews/qcolumnview.h b/src/widgets/itemviews/qcolumnview.h index 7d5e2f5cd1..42eac7426a 100644 --- a/src/widgets/itemviews/qcolumnview.h +++ b/src/widgets/itemviews/qcolumnview.h @@ -43,11 +43,10 @@ #include #include +QT_REQUIRE_CONFIG(columnview); + QT_BEGIN_NAMESPACE - -#ifndef QT_NO_COLUMNVIEW - class QColumnViewPrivate; class Q_WIDGETS_EXPORT QColumnView : public QAbstractItemView { @@ -109,8 +108,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_clicked(const QModelIndex &)) }; -#endif // QT_NO_COLUMNVIEW - QT_END_NAMESPACE #endif // QCOLUMNVIEW_H diff --git a/src/widgets/itemviews/qcolumnview_p.h b/src/widgets/itemviews/qcolumnview_p.h index 7eff0f66cd..fa276075fe 100644 --- a/src/widgets/itemviews/qcolumnview_p.h +++ b/src/widgets/itemviews/qcolumnview_p.h @@ -54,8 +54,6 @@ #include #include "qcolumnview.h" -#ifndef QT_NO_QCOLUMNVIEW - #include #include @@ -67,6 +65,8 @@ #include #include +QT_REQUIRE_CONFIG(columnview); + QT_BEGIN_NAMESPACE class QColumnViewPreviewColumn : public QAbstractItemView { @@ -190,9 +190,7 @@ public: const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; }; -#endif // QT_NO_QCOLUMNVIEW - QT_END_NAMESPACE -#endif //QCOLUMNVIEW_P_H +#endif //QCOLUMNVIEW_P_H diff --git a/src/widgets/itemviews/qcolumnviewgrip.cpp b/src/widgets/itemviews/qcolumnviewgrip.cpp index f7d6e6d2b0..4a4237805f 100644 --- a/src/widgets/itemviews/qcolumnviewgrip.cpp +++ b/src/widgets/itemviews/qcolumnviewgrip.cpp @@ -37,8 +37,6 @@ ** ****************************************************************************/ -#ifndef QT_NO_QCOLUMNVIEW - #include "qcolumnviewgrip_p.h" #include #include @@ -190,5 +188,3 @@ originalXLocation(-1) QT_END_NAMESPACE #include "moc_qcolumnviewgrip_p.cpp" - -#endif // QT_NO_QCOLUMNVIEW diff --git a/src/widgets/itemviews/qcolumnviewgrip_p.h b/src/widgets/itemviews/qcolumnviewgrip_p.h index 3447f9f824..16c0aefada 100644 --- a/src/widgets/itemviews/qcolumnviewgrip_p.h +++ b/src/widgets/itemviews/qcolumnviewgrip_p.h @@ -54,7 +54,7 @@ #include #include -#ifndef QT_NO_QCOLUMNVIEW +QT_REQUIRE_CONFIG(columnview); QT_BEGIN_NAMESPACE @@ -98,6 +98,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_QCOLUMNVIEW - #endif //QCOLUMNVIEWGRIP_P_H diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 752e385aa5..afcb50c866 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -608,7 +608,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } break; #endif // QT_NO_LINEEDIT -#ifndef QT_NO_COLUMNVIEW +#if QT_CONFIG(columnview) case PE_IndicatorColumnViewArrow: { if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast(opt)) { bool reverse = (viewOpt->direction == Qt::RightToLeft); @@ -660,7 +660,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->restore(); } break; } -#endif //QT_NO_COLUMNVIEW +#endif //QT_CONFIG(columnview) case PE_IndicatorItemViewItemDrop: { QRect rect = opt->rect; if (opt->rect.height() == 0)