diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-01-29 06:51:18 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-01-29 06:51:18 (GMT) |
commit | 245f2d6d8bf32dcfa28501a9944de00e1e4e1875 (patch) | |
tree | bba1eb8796905fb1ed3d92c59f8841cf848bf2aa /src/gui/itemviews/qlistview.cpp | |
parent | 7123ef04484f283ffa30ece8cb73f541bd81e830 (diff) | |
parent | 2f91e9ce0e02f613d68b5b59d00b61c8f4f12c68 (diff) | |
download | Qt-245f2d6d8bf32dcfa28501a9944de00e1e4e1875.zip Qt-245f2d6d8bf32dcfa28501a9944de00e1e4e1875.tar.gz Qt-245f2d6d8bf32dcfa28501a9944de00e1e4e1875.tar.bz2 |
Merge ../../qt/master
Conflicts:
tests/auto/tests.xml
Diffstat (limited to 'src/gui/itemviews/qlistview.cpp')
-rw-r--r-- | src/gui/itemviews/qlistview.cpp | 7 |
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(); |