Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.0
-
None
-
Windows 10 64bit Enterprise, Python3==3.6.8
-
-
52e0d9e23c3f7a1b0faf6649cf3dd825bcfd4f08 (qt/qtbase/5.12.1)
Description
drag text from QLineEdit to QPushButton, and cannot drop the text to QPushButton.
it seems something preventing the drop action.
the same source code works under PySide2==5.11.2
source code as follow:
(an example from http://zetcode.com/gui/pyqt5/dragdrop/)
# -*- coding: utf-8 -*- import sys from PySide2.QtWidgets import QPushButton, QWidget, QLineEdit, QApplication class Button(QPushButton): def __init__(self, title, parent): super().__init__(title, parent) self.setAcceptDrops(True) def dragEnterEvent(self, e): if e.mimeData().hasFormat('text/plain'): e.accept() else: e.ignore() def dropEvent(self, e): self.setText(e.mimeData().text()) class Example(QWidget): def __init__(self): super().__init__() self.initUI() # self.setAcceptDrops(True) # FIXME: have to use this code in PySide2==5.12.0, otherwise, drag&drop doesn't work def initUI(self): edit = QLineEdit('', self) edit.setDragEnabled(True) edit.move(30, 65) button = Button("Button", self) button.move(190, 65) self.setWindowTitle('Simple drag and drop') self.setGeometry(300, 300, 300, 150) if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() ex.show() app.exec_()
Attachments
Issue Links
- is duplicated by
-
QTBUG-73462 wayland drag and drop from gnome nautilus into QT application broken
- Closed
-
QTBUG-69246 REG 5.9->5.11 Dragging icons doesn't work most of the time
- Closed
-
QTBUG-72420 Widget rejects drag and drop operation if it's not the first widget the drag enters
- Closed
- relates to
-
QTBUG-73032 QDragEnterEvent acceptance ignored
- Closed
- resulted from
-
QTBUG-67155 [regression from qt4] QDragEnterEvent without QDragMoveEvent
- Closed
For Gerrit Dashboard: QTBUG-72844 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
249086,8 | Drag'n'Drop: fix dnd when dragMoveEvent() is not implemented | 5.12.1 | qt/qtbase | Status: MERGED | +2 | 0 |