Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-45365

QListWidget dropEvent is processed not correctly for items moving

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P1: Critical
    • None
    • 5.4.1
    • GUI: Drag and Drop
    • None
    • Win8, Qt5.4.1, QtCreator 3.3.1

    Description

      I noticed that my old code stop working correctly when I had upgraded to Qt 5.4.1. Part of code is below:

      TargetItemListWidget::TargetItemListWidget(QWidget * parent) : QListWidget(parent)
      {
      	setMouseTracking(false);
      	setDragEnabled(false);
      	setDragDropMode(QAbstractItemView::InternalMove);
      	setDefaultDropAction(Qt::MoveAction);
      	setSelectionMode(QAbstractItemView::ExtendedSelection);
      	setSelectionBehavior(QAbstractItemView::SelectRows);
      }
      
      void TargetItemListWidget::dropEvent(QDropEvent * event)
      {
      	QListWidget::dropEvent(event);
      	emit dropItem();
      }
      

      After drag'n'drop QListWidgetItem is deleted. So now I temporarily solved this problem by adding clearSelection() after emit dropItem()

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            vladimir Vladimir Kozlov
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes