PySide6: drag and drop broken after updating to 6.5.2
-
Hi! I updated my Qt/PySide6 version from 6.5.1.1 to 6.5.2 today and my drag-and-drop code no longer works. I've pasted a minimal example below. I would expect the
ListViewitem to follow the mouse when dragged, but instead the cursor turns into aQt.ForbiddenCursor. In my real code I have the user dragging items from aListViewinto aTreeView.import sys from PySide6 import QtGui, QtWidgets, QtCore class MainWindow(QtWidgets.QMainWindow): def __init__(self, parent=None): super().__init__(parent) self.model = QtGui.QStandardItemModel() item = QtGui.QStandardItem() item.setText('foo') item.setFlags(item.flags() | QtCore.Qt.ItemIsDragEnabled) self.model.appendRow(item) view = QtWidgets.QListView() view.setModel(self.model) view.setDragEnabled(True) self.setCentralWidget(view) application = QtWidgets.QApplication(sys.argv) window = MainWindow() window.show() sys.exit(application.exec()) -
Hi and welcome to devnet,
I just tested your code on macOS with PySide6 6.5.2 and it's working as expected.
Which OS are you on ?