src/gui/itemviews/qlistview.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 8 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
  2619         return false;
  2619         return false;
  2620 
  2620 
  2621     const QSize contents = contentsSize;
  2621     const QSize contents = contentsSize;
  2622     QPoint offset(horizontalOffset(), verticalOffset());
  2622     QPoint offset(horizontalOffset(), verticalOffset());
  2623     QPoint end = e->pos() + offset;
  2623     QPoint end = e->pos() + offset;
       
  2624     if (qq->acceptDrops()) {
       
  2625         const Qt::ItemFlags dropableFlags = Qt::ItemIsDropEnabled|Qt::ItemIsEnabled;
       
  2626         const QVector<QModelIndex> &dropIndices = intersectingSet(QRect(end, QSize(1, 1)));
       
  2627         foreach (const QModelIndex &index, dropIndices)
       
  2628             if ((index.flags() & dropableFlags) == dropableFlags)
       
  2629                 return false;
       
  2630     }
  2624     QPoint start = dd->pressedPosition;
  2631     QPoint start = dd->pressedPosition;
  2625     QPoint delta = (dd->movement == QListView::Snap ? snapToGrid(end) - snapToGrid(start) : end - start);
  2632     QPoint delta = (dd->movement == QListView::Snap ? snapToGrid(end) - snapToGrid(start) : end - start);
  2626     QList<QModelIndex> indexes = dd->selectionModel->selectedIndexes();
  2633     QList<QModelIndex> indexes = dd->selectionModel->selectedIndexes();
  2627     for (int i = 0; i < indexes.count(); ++i) {
  2634     for (int i = 0; i < indexes.count(); ++i) {
  2628         QModelIndex index = indexes.at(i);
  2635         QModelIndex index = indexes.at(i);