void DolphinColumnWidget::mousePressEvent(QMouseEvent* event)
{
requestActivation();
+ if (indexAt(event->pos()).isValid() && (event->button() == Qt::LeftButton)) {
+ // TODO: see comment in DolphinIconsView::mousePressEvent()
+ setState(QAbstractItemView::DraggingState);
+ }
QListView::mousePressEvent(event);
}
QTreeView::mousePressEvent(event);
const QModelIndex index = indexAt(event->pos());
+ if (index.isValid() && (event->button() == Qt::LeftButton)) {
+ // TODO: see comment in DolphinIconsView::mousePressEvent()
+ setState(QAbstractItemView::DraggingState);
+ }
+
if (!index.isValid() || (index.column() != DolphinModel::Name)) {
const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) {
void DolphinDetailsView::startDrag(Qt::DropActions supportedActions)
{
DragAndDropHelper::startDrag(this, supportedActions);
+ m_showElasticBand = false;
}
void DolphinDetailsView::dragEnterEvent(QDragEnterEvent* event)
void DolphinIconsView::mousePressEvent(QMouseEvent* event)
{
m_controller->requestActivation();
- if (!indexAt(event->pos()).isValid()) {
+ const QModelIndex index = indexAt(event->pos());
+ if (index.isValid() && (event->button() == Qt::LeftButton)) {
+ // TODO: It should not be necessary to manually set the dragging state, but I could
+ // not reproduce this issue with a Qt-only example yet to find the root cause.
+ // Issue description: start Dolphin, split the view and drag an item from the
+ // inactive view to the active view by a very fast mouse movement. Result:
+ // the item gets selected instead of being dragged...
+ setState(QAbstractItemView::DraggingState);
+ }
+
+ if (!index.isValid()) {
const Qt::KeyboardModifiers modifier = QApplication::keyboardModifiers();
if (!(modifier & Qt::ShiftModifier) && !(modifier & Qt::ControlModifier)) {
clearSelection();