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/qabstractitemdelegate.cpp | 6 +++-- src/widgets/itemviews/qabstractitemview.cpp | 30 +++++++++++++------------ src/widgets/itemviews/qabstractitemview.h | 10 ++++----- src/widgets/itemviews/qabstractitemview_p.h | 6 ++--- src/widgets/itemviews/qcolumnview.cpp | 2 +- src/widgets/itemviews/qlistview.cpp | 24 +++++++++++--------- src/widgets/itemviews/qlistview.h | 4 ++-- src/widgets/itemviews/qlistview_p.h | 8 +++---- src/widgets/itemviews/qlistwidget.cpp | 8 +++---- src/widgets/itemviews/qlistwidget.h | 2 +- src/widgets/itemviews/qlistwidget_p.h | 2 +- src/widgets/itemviews/qtableview.cpp | 2 +- src/widgets/itemviews/qtableview_p.h | 2 +- src/widgets/itemviews/qtablewidget.cpp | 4 ++-- src/widgets/itemviews/qtreeview.cpp | 4 ++-- src/widgets/itemviews/qtreeview.h | 2 +- src/widgets/itemviews/qtreewidget.cpp | 2 +- 17 files changed, 62 insertions(+), 56 deletions(-) (limited to 'src/widgets/itemviews') diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index 117de8edf9..c9f321c3f6 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -63,9 +63,11 @@ #include #include +#if QT_CONFIG(draganddrop) #include -#include #include +#endif +#include QT_BEGIN_NAMESPACE @@ -515,7 +517,7 @@ bool QAbstractItemDelegatePrivate::editorEventFilter(QObject *object, QEvent *ev return false; w = w->parentWidget(); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) // The window may lose focus during an drag operation. // i.e when dragging involves the taskbar on Windows. QPlatformDrag *platformDrag = QGuiApplicationPrivate::instance()->platformIntegration()->drag(); diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index a07297863d..02eae33a12 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -44,7 +44,9 @@ #include #include #include +#if QT_CONFIG(draganddrop) #include +#endif #include #include #include @@ -90,7 +92,7 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate() editTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed), lastTrigger(QAbstractItemView::NoEditTriggers), tabKeyNavigation(false), -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) showDropIndicator(true), dragEnabled(false), dragDropMode(QAbstractItemView::NoDragDrop), @@ -1325,7 +1327,7 @@ void QAbstractItemView::resetHorizontalScrollMode() d_func()->horizontalScrollModeSet = false; } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! \since 4.2 \property QAbstractItemView::dragDropOverwriteMode @@ -1432,7 +1434,7 @@ QSize QAbstractItemView::viewportSizeHint() const return QAbstractScrollArea::viewportSizeHint(); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! \property QAbstractItemView::showDropIndicator \brief whether the drop indicator is shown when dragging items and dropping. @@ -1551,7 +1553,7 @@ Qt::DropAction QAbstractItemView::defaultDropAction() const return d->defaultDropAction; } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) /*! \property QAbstractItemView::alternatingRowColors @@ -1828,7 +1830,7 @@ void QAbstractItemView::mouseMoveEvent(QMouseEvent *event) if (state() == ExpandingState || state() == CollapsingState) return; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) if (state() == DraggingState) { topLeft = d->pressedPosition - d->offset(); if ((topLeft - bottomRight).manhattanLength() > QApplication::startDragDistance()) { @@ -1839,7 +1841,7 @@ void QAbstractItemView::mouseMoveEvent(QMouseEvent *event) } return; } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) QPersistentModelIndex index = indexAt(bottomRight); QModelIndex buddy = d->model->buddy(d->pressedIndex); @@ -1854,7 +1856,7 @@ void QAbstractItemView::mouseMoveEvent(QMouseEvent *event) d->checkMouseMove(index); -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) if (d->pressedIndex.isValid() && d->dragEnabled && (state() != DragSelectingState) @@ -1962,7 +1964,7 @@ void QAbstractItemView::mouseDoubleClickEvent(QMouseEvent *event) emit activated(persistent); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! This function is called with the given \a event when a drag and drop operation enters @@ -2216,7 +2218,7 @@ QAbstractItemViewPrivate::position(const QPoint &pos, const QRect &rect, const Q return r; } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) /*! This function is called with the given \a event when the widget obtains the focus. @@ -2567,7 +2569,7 @@ void QAbstractItemView::inputMethodEvent(QInputMethodEvent *event) } } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! \enum QAbstractItemView::DropIndicatorPosition @@ -3667,7 +3669,7 @@ void QAbstractItemView::currentChanged(const QModelIndex ¤t, const QModelI setAttribute(Qt::WA_InputMethodEnabled, (current.isValid() && (current.flags() & Qt::ItemIsEditable))); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! Starts a drag by calling drag->exec() using the given \a supportedActions. */ @@ -3698,7 +3700,7 @@ void QAbstractItemView::startDrag(Qt::DropActions supportedActions) d->dropIndicatorPosition = OnItem; } } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) /*! Returns a QStyleOptionViewItem structure populated with the view's @@ -3911,7 +3913,7 @@ void QAbstractItemView::doAutoScroll() if (verticalUnchanged && horizontalUnchanged) { stopAutoScroll(); } else { -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) d->dropIndicatorRect = QRect(); d->dropIndicatorPosition = QAbstractItemView::OnViewport; #endif @@ -4286,7 +4288,7 @@ void QAbstractItemViewPrivate::updateEditorData(const QModelIndex &tl, const QMo */ void QAbstractItemViewPrivate::clearOrRemove() { -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) const QItemSelection selection = selectionModel->selection(); QList::const_iterator it = selection.constBegin(); diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h index 8a138bdb67..981582c166 100644 --- a/src/widgets/itemviews/qabstractitemview.h +++ b/src/widgets/itemviews/qabstractitemview.h @@ -65,7 +65,7 @@ class Q_WIDGETS_EXPORT QAbstractItemView : public QAbstractScrollArea Q_PROPERTY(int autoScrollMargin READ autoScrollMargin WRITE setAutoScrollMargin) Q_PROPERTY(EditTriggers editTriggers READ editTriggers WRITE setEditTriggers) Q_PROPERTY(bool tabKeyNavigation READ tabKeyNavigation WRITE setTabKeyNavigation) -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) Q_PROPERTY(bool showDropIndicator READ showDropIndicator WRITE setDropIndicatorShown) Q_PROPERTY(bool dragEnabled READ dragEnabled WRITE setDragEnabled) Q_PROPERTY(bool dragDropOverwriteMode READ dragDropOverwriteMode WRITE setDragDropOverwriteMode) @@ -165,7 +165,7 @@ public: void setTabKeyNavigation(bool enable); bool tabKeyNavigation() const; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void setDropIndicatorShown(bool enable); bool showDropIndicator() const; @@ -297,7 +297,7 @@ protected: virtual QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex &index, const QEvent *event = nullptr) const; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) virtual void startDrag(Qt::DropActions supportedActions); #endif @@ -334,7 +334,7 @@ protected: void mouseMoveEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; void mouseDoubleClickEvent(QMouseEvent *event) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void dragEnterEvent(QDragEnterEvent *event) override; void dragMoveEvent(QDragMoveEvent *event) override; void dragLeaveEvent(QDragLeaveEvent *event) override; @@ -348,7 +348,7 @@ protected: void inputMethodEvent(QInputMethodEvent *event) override; bool eventFilter(QObject *object, QEvent *event) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) enum DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport }; DropIndicatorPosition dropIndicatorPosition() const; #endif diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index d8af96af55..fe1c00248f 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -130,7 +130,7 @@ public: } void stopAutoScroll() { autoScrollTimer.stop(); autoScrollCount = 0;} -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) virtual bool dropOn(QDropEvent *event, int *row, int *col, QModelIndex *index); #endif bool droppingOnItself(QDropEvent *event, const QModelIndex &index); @@ -162,7 +162,7 @@ public: } } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) virtual QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const; inline bool canDrop(QDropEvent *event) { @@ -400,7 +400,7 @@ public: bool tabKeyNavigation; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) bool showDropIndicator; QRect dropIndicatorRect; bool dragEnabled; diff --git a/src/widgets/itemviews/qcolumnview.cpp b/src/widgets/itemviews/qcolumnview.cpp index d94f25de78..5100d2a427 100644 --- a/src/widgets/itemviews/qcolumnview.cpp +++ b/src/widgets/itemviews/qcolumnview.cpp @@ -772,7 +772,7 @@ void QColumnView::initializeColumn(QAbstractItemView *column) const column->setMinimumWidth(100); column->setAttribute(Qt::WA_MacShowFocusRect, false); -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) column->setDragDropMode(dragDropMode()); column->setDragDropOverwriteMode(dragDropOverwriteMode()); column->setDropIndicatorShown(showDropIndicator()); 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) { diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h index 2da510facf..9fc4035999 100644 --- a/src/widgets/itemviews/qlistview.h +++ b/src/widgets/itemviews/qlistview.h @@ -158,12 +158,12 @@ protected: void timerEvent(QTimerEvent *e) override; void resizeEvent(QResizeEvent *e) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void dragMoveEvent(QDragMoveEvent *e) override; void dragLeaveEvent(QDragLeaveEvent *e) override; void dropEvent(QDropEvent *e) override; void startDrag(Qt::DropActions supportedActions) override; -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) QStyleOptionViewItem viewOptions() const override; void paintEvent(QPaintEvent *e) override; diff --git a/src/widgets/itemviews/qlistview_p.h b/src/widgets/itemviews/qlistview_p.h index 8d29767951..ca947292e3 100644 --- a/src/widgets/itemviews/qlistview_p.h +++ b/src/widgets/itemviews/qlistview_p.h @@ -143,7 +143,7 @@ public: virtual void removeHiddenRow(int row); virtual void setPositionForIndex(const QPoint &, const QModelIndex &) { } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) virtual void paintDragDrop(QPainter *painter); virtual bool filterDragMoveEvent(QDragMoveEvent *) { return false; } virtual bool filterDragLeaveEvent(QDragLeaveEvent *) { return false; } @@ -228,7 +228,7 @@ public: void updateHorizontalScrollBar(const QSize &step) override; void updateVerticalScrollBar(const QSize &step) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) // The next two methods are to be used on LefToRight flow only. // WARNING: Plenty of duplicated code from QAbstractItemView{,Private}. QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const; @@ -274,7 +274,7 @@ public: void removeHiddenRow(int row) override; void setPositionForIndex(const QPoint &position, const QModelIndex &index) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) bool filterDragMoveEvent(QDragMoveEvent *) override; bool filterDragLeaveEvent(QDragLeaveEvent *) override; bool filterDropEvent(QDropEvent *e) override; @@ -358,7 +358,7 @@ public: QItemSelection selection(const QRect &rect) const; void selectAll(QItemSelectionModel::SelectionFlags command) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const override; bool dropOn(QDropEvent *event, int *row, int *col, QModelIndex *index) override; #endif diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index 1fedad80aa..4f1c7fe80a 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -444,7 +444,7 @@ QMimeData *QListModel::mimeData(const QModelIndexList &indexes) const return mimeData; } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) bool QListModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &index) { @@ -463,7 +463,7 @@ Qt::DropActions QListModel::supportedDropActions() const const QListWidget *view = qobject_cast(QObject::parent()); return view->supportedDropActions(); } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) /*! \class QListWidgetItem @@ -1859,7 +1859,7 @@ QMimeData *QListWidget::mimeData(const QList items) const return d->listModel()->internalMimeData(); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! Handles \a data supplied by an external drag and drop operation that ended with the given \a action in the given \a index. Returns \c true if \a data and @@ -1934,7 +1934,7 @@ Qt::DropActions QListWidget::supportedDropActions() const Q_D(const QListWidget); return d->listModel()->QAbstractListModel::supportedDropActions() | Qt::MoveAction; } -#endif // QT_NO_DRAGANDDROP +#endif // QT_CONFIG(draganddrop) /*! Returns a list of pointers to the items contained in the \a data object. If diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h index 8a31411429..947fdb1a2f 100644 --- a/src/widgets/itemviews/qlistwidget.h +++ b/src/widgets/itemviews/qlistwidget.h @@ -286,7 +286,7 @@ protected: #else virtual QMimeData *mimeData(const QList items) const; #endif -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action); virtual Qt::DropActions supportedDropActions() const; #endif diff --git a/src/widgets/itemviews/qlistwidget_p.h b/src/widgets/itemviews/qlistwidget_p.h index 30b5016db6..9cb3d5966b 100644 --- a/src/widgets/itemviews/qlistwidget_p.h +++ b/src/widgets/itemviews/qlistwidget_p.h @@ -124,7 +124,7 @@ public: // dnd QStringList mimeTypes() const override; QMimeData *mimeData(const QModelIndexList &indexes) const override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; Qt::DropActions supportedDropActions() const override; diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index ec25ccdb12..1938fd8e92 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -1512,7 +1512,7 @@ void QTableView::paintEvent(QPaintEvent *event) } } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) // Paint the dropIndicator d->paintDropIndicator(&painter); #endif diff --git a/src/widgets/itemviews/qtableview_p.h b/src/widgets/itemviews/qtableview_p.h index 1a0fef9017..805787597c 100644 --- a/src/widgets/itemviews/qtableview_p.h +++ b/src/widgets/itemviews/qtableview_p.h @@ -142,7 +142,7 @@ public: visualCursor(QPoint()) { wrapItemText = true; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) overwrite = true; #endif } diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp index 301d5dbe4d..9d5a2aa1bd 100644 --- a/src/widgets/itemviews/qtablewidget.cpp +++ b/src/widgets/itemviews/qtablewidget.cpp @@ -2618,7 +2618,7 @@ QMimeData *QTableWidget::mimeData(const QList items) const bool QTableWidget::dropMimeData(int row, int column, const QMimeData *data, Qt::DropAction action) { QModelIndex idx; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) if (dropIndicatorPosition() == QAbstractItemView::OnItem) { // QAbstractTableModel::dropMimeData will overwrite on the index if row == -1 and column == -1 idx = model()->index(row, column); @@ -2701,7 +2701,7 @@ bool QTableWidget::event(QEvent *e) return QTableView::event(e); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! \reimp */ void QTableWidget::dropEvent(QDropEvent *event) { Q_D(QTableWidget); diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index ebeefad682..fbfbe56246 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1287,7 +1287,7 @@ void QTreeView::timerEvent(QTimerEvent *event) /*! \reimp */ -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void QTreeView::dragMoveEvent(QDragMoveEvent *event) { Q_D(QTreeView); @@ -1342,7 +1342,7 @@ void QTreeView::paintEvent(QPaintEvent *event) #endif //QT_NO_ANIMATION { drawTree(&painter, event->region()); -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) d->paintDropIndicator(&painter); #endif } diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h index e7ee55aa2a..09ce0e3fff 100644 --- a/src/widgets/itemviews/qtreeview.h +++ b/src/widgets/itemviews/qtreeview.h @@ -201,7 +201,7 @@ protected: void mouseDoubleClickEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; void keyPressEvent(QKeyEvent *event) override; -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) void dragMoveEvent(QDragMoveEvent *event) override; #endif bool viewportEvent(QEvent *event) override; diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index de7f7c0b77..654c241079 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -3394,7 +3394,7 @@ QTreeWidgetItem *QTreeWidget::itemFromIndex(const QModelIndex &index) const return d->item(index); } -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) /*! \reimp */ void QTreeWidget::dropEvent(QDropEvent *event) { Q_D(QTreeWidget); -- cgit v1.2.3