QAbstractItemView: rename private canDecode to canDrop.

Change-Id: I9b1b3ead0bea35a75e20c5c18e288251de7ad7fe
Reviewed-by: Stephen Kelly <steveire@gmail.com>
This commit is contained in:
David Faure 2014-11-21 00:43:54 +01:00
parent b13aa15e10
commit b1cf07f495
3 changed files with 7 additions and 7 deletions

View File

@ -1904,7 +1904,7 @@ void QAbstractItemView::dragEnterEvent(QDragEnterEvent *event)
&& (event->source() != this|| !(event->possibleActions() & Qt::MoveAction)))
return;
if (d_func()->canDecode(event)) {
if (d_func()->canDrop(event)) {
event->accept();
setState(DraggingState);
} else {
@ -1933,7 +1933,7 @@ void QAbstractItemView::dragMoveEvent(QDragMoveEvent *event)
QModelIndex index = indexAt(event->pos());
d->hover = index;
if (!d->droppingOnItself(event, index)
&& d->canDecode(event)) {
&& d->canDrop(event)) {
if (index.isValid() && d->showDropIndicator) {
QRect rect = visualRect(index);
@ -1978,7 +1978,7 @@ void QAbstractItemView::dragMoveEvent(QDragMoveEvent *event)
}
}
d->viewport->update();
} // can decode
} // can drop
if (d->shouldAutoScroll(event->pos()))
startAutoScroll();

View File

@ -164,7 +164,7 @@ public:
#ifndef QT_NO_DRAGANDDROP
virtual QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const;
inline bool canDecode(QDropEvent *event) {
inline bool canDrop(QDropEvent *event) {
QModelIndex index;
int col = -1;
int row = -1;

View File

@ -1977,7 +1977,7 @@ void QListModeViewBase::dragMoveEvent(QDragMoveEvent *event)
? intersectVector.last() : QModelIndex();
dd->hover = index;
if (!dd->droppingOnItself(event, index)
&& dd->canDecode(event)) {
&& dd->canDrop(event)) {
if (index.isValid() && dd->showDropIndicator) {
QRect rect = qq->visualRect(index);
@ -2023,7 +2023,7 @@ void QListModeViewBase::dragMoveEvent(QDragMoveEvent *event)
}
}
dd->viewport->update();
} // can decode
} // can drop
if (dd->shouldAutoScroll(event->pos()))
qq->startAutoScroll();
@ -2757,7 +2757,7 @@ bool QIconModeViewBase::filterDragLeaveEvent(QDragLeaveEvent *e)
bool QIconModeViewBase::filterDragMoveEvent(QDragMoveEvent *e)
{
if (e->source() != qq || !dd->canDecode(e))
if (e->source() != qq || !dd->canDrop(e))
return false;
// ignore by default