QAbstractItemView: rename private canDecode to canDrop.
Change-Id: I9b1b3ead0bea35a75e20c5c18e288251de7ad7fe Reviewed-by: Stephen Kelly <steveire@gmail.com>
This commit is contained in:
parent
b13aa15e10
commit
b1cf07f495
@ -1904,7 +1904,7 @@ void QAbstractItemView::dragEnterEvent(QDragEnterEvent *event)
|
|||||||
&& (event->source() != this|| !(event->possibleActions() & Qt::MoveAction)))
|
&& (event->source() != this|| !(event->possibleActions() & Qt::MoveAction)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (d_func()->canDecode(event)) {
|
if (d_func()->canDrop(event)) {
|
||||||
event->accept();
|
event->accept();
|
||||||
setState(DraggingState);
|
setState(DraggingState);
|
||||||
} else {
|
} else {
|
||||||
@ -1933,7 +1933,7 @@ void QAbstractItemView::dragMoveEvent(QDragMoveEvent *event)
|
|||||||
QModelIndex index = indexAt(event->pos());
|
QModelIndex index = indexAt(event->pos());
|
||||||
d->hover = index;
|
d->hover = index;
|
||||||
if (!d->droppingOnItself(event, index)
|
if (!d->droppingOnItself(event, index)
|
||||||
&& d->canDecode(event)) {
|
&& d->canDrop(event)) {
|
||||||
|
|
||||||
if (index.isValid() && d->showDropIndicator) {
|
if (index.isValid() && d->showDropIndicator) {
|
||||||
QRect rect = visualRect(index);
|
QRect rect = visualRect(index);
|
||||||
@ -1978,7 +1978,7 @@ void QAbstractItemView::dragMoveEvent(QDragMoveEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
d->viewport->update();
|
d->viewport->update();
|
||||||
} // can decode
|
} // can drop
|
||||||
|
|
||||||
if (d->shouldAutoScroll(event->pos()))
|
if (d->shouldAutoScroll(event->pos()))
|
||||||
startAutoScroll();
|
startAutoScroll();
|
||||||
|
@ -164,7 +164,7 @@ public:
|
|||||||
#ifndef QT_NO_DRAGANDDROP
|
#ifndef QT_NO_DRAGANDDROP
|
||||||
virtual QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const;
|
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;
|
QModelIndex index;
|
||||||
int col = -1;
|
int col = -1;
|
||||||
int row = -1;
|
int row = -1;
|
||||||
|
@ -1977,7 +1977,7 @@ void QListModeViewBase::dragMoveEvent(QDragMoveEvent *event)
|
|||||||
? intersectVector.last() : QModelIndex();
|
? intersectVector.last() : QModelIndex();
|
||||||
dd->hover = index;
|
dd->hover = index;
|
||||||
if (!dd->droppingOnItself(event, index)
|
if (!dd->droppingOnItself(event, index)
|
||||||
&& dd->canDecode(event)) {
|
&& dd->canDrop(event)) {
|
||||||
|
|
||||||
if (index.isValid() && dd->showDropIndicator) {
|
if (index.isValid() && dd->showDropIndicator) {
|
||||||
QRect rect = qq->visualRect(index);
|
QRect rect = qq->visualRect(index);
|
||||||
@ -2023,7 +2023,7 @@ void QListModeViewBase::dragMoveEvent(QDragMoveEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dd->viewport->update();
|
dd->viewport->update();
|
||||||
} // can decode
|
} // can drop
|
||||||
|
|
||||||
if (dd->shouldAutoScroll(event->pos()))
|
if (dd->shouldAutoScroll(event->pos()))
|
||||||
qq->startAutoScroll();
|
qq->startAutoScroll();
|
||||||
@ -2757,7 +2757,7 @@ bool QIconModeViewBase::filterDragLeaveEvent(QDragLeaveEvent *e)
|
|||||||
|
|
||||||
bool QIconModeViewBase::filterDragMoveEvent(QDragMoveEvent *e)
|
bool QIconModeViewBase::filterDragMoveEvent(QDragMoveEvent *e)
|
||||||
{
|
{
|
||||||
if (e->source() != qq || !dd->canDecode(e))
|
if (e->source() != qq || !dd->canDrop(e))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// ignore by default
|
// ignore by default
|
||||||
|
Loading…
Reference in New Issue
Block a user