From 9f27bfb31acfba49a74a342d9249f24633a7ade2 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 13 Apr 2018 09:01:43 +0200 Subject: Make sure we can build with -no-feature-draganddrop We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis --- src/widgets/itemviews/qlistview.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/widgets/itemviews/qlistview.cpp') diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index 6777b09043..a7174a92e8 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -44,7 +44,9 @@ #include #include #include +#if QT_CONFIG(draganddrop) #include +#endif #include #include #include @@ -230,7 +232,7 @@ void QListView::setMovement(Movement movement) d->modeProperties |= uint(QListViewPrivate::Movement); d->movement = movement; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) bool movable = (movement != Static); setDragEnabled(movable); d->viewport->setAcceptDrops(movable); @@ -494,7 +496,7 @@ void QListView::setViewMode(ViewMode mode) d->showElasticBand = true; } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) bool movable = (d->movement != Static); setDragEnabled(movable); setAcceptDrops(movable); @@ -875,7 +877,7 @@ void QListView::resizeEvent(QResizeEvent *e) } } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! \reimp @@ -919,7 +921,7 @@ void QListView::startDrag(Qt::DropActions supportedActions) QAbstractItemView::startDrag(supportedActions); } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) /*! \reimp @@ -1048,7 +1050,7 @@ void QListView::paintEvent(QPaintEvent *e) d->delegateForIndex(*it)->paint(&painter, option, *it); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) d->commonListView->paintDragDrop(&painter); #endif @@ -1829,7 +1831,7 @@ QItemSelection QListViewPrivate::selection(const QRect &rect) const return selection; } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QAbstractItemView::DropIndicatorPosition QListViewPrivate::position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const { if (viewMode == QListView::ListMode && flow == QListView::LeftToRight) @@ -1871,7 +1873,7 @@ void QCommonListViewBase::removeHiddenRow(int row) dd->hiddenRows.remove(dd->model->index(row, 0, qq->rootIndex())); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void QCommonListViewBase::paintDragDrop(QPainter *painter) { // FIXME: Until the we can provide a proper drop indicator @@ -2006,7 +2008,7 @@ QListModeViewBase::QListModeViewBase(QListView *q, QListViewPrivate *d) #endif } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QAbstractItemView::DropIndicatorPosition QListModeViewBase::position(const QPoint &pos, const QRect &rect, const QModelIndex &index) const { QAbstractItemView::DropIndicatorPosition r = QAbstractItemView::OnViewport; @@ -2165,7 +2167,7 @@ bool QListModeViewBase::dropOn(QDropEvent *event, int *dropRow, int *dropCol, QM return false; } -#endif //QT_NO_DRAGANDDROP +#endif //QT_CONFIG(draganddrop) void QListModeViewBase::updateVerticalScrollBar(const QSize &step) { @@ -2740,7 +2742,7 @@ void QIconModeViewBase::removeHiddenRow(int row) tree.insertLeaf(items.at(row).rect(), row); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) bool QIconModeViewBase::filterStartDrag(Qt::DropActions supportedActions) { // This function does the same thing as in QAbstractItemView::startDrag(), @@ -2862,7 +2864,7 @@ bool QIconModeViewBase::filterDragMoveEvent(QDragMoveEvent *e) dd->startAutoScroll(); return true; } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) void QIconModeViewBase::setRowCount(int rowCount) { -- cgit v1.2.3