summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-01-18 19:00:43 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-01-18 19:00:43 (GMT)
commitf62d047bf20cd45f78db14f1ef4f9ba7f7a7b131 (patch)
treecf7b8d64fbc94504822096314f56a4a16a66bfa1 /src/gui/itemviews
parent7dee69caea20b189d5f4f8e27179c5abfd73a815 (diff)
parenta764519a658031ce2fb375b659ff889b5241357f (diff)
downloadQt-f62d047bf20cd45f78db14f1ef4f9ba7f7a7b131.zip
Qt-f62d047bf20cd45f78db14f1ef4f9ba7f7a7b131.tar.gz
Qt-f62d047bf20cd45f78db14f1ef4f9ba7f7a7b131.tar.bz2
Merge branch '4.6'
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qlistview.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index f289c7d..19b1e8c 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -2621,6 +2621,13 @@ bool QIconModeViewBase::filterDropEvent(QDropEvent *e)
const QSize contents = contentsSize;
QPoint offset(horizontalOffset(), verticalOffset());
QPoint end = e->pos() + offset;
+ if (qq->acceptDrops()) {
+ const Qt::ItemFlags dropableFlags = Qt::ItemIsDropEnabled|Qt::ItemIsEnabled;
+ const QVector<QModelIndex> &dropIndices = intersectingSet(QRect(end, QSize(1, 1)));
+ foreach (const QModelIndex &index, dropIndices)
+ if ((index.flags() & dropableFlags) == dropableFlags)
+ return false;
+ }
QPoint start = dd->pressedPosition;
QPoint delta = (dd->movement == QListView::Snap ? snapToGrid(end) - snapToGrid(start) : end - start);
QList<QModelIndex> indexes = dd->selectionModel->selectedIndexes();