Pyside6: Drop file in QTextEdit doesn't work anymore
Unsolved
Qt for Python
-
Hello,
I guess I founded a bug :
#!/bin/python3 from PySide6.QtWidgets import QApplication, QPlainTextEdit, QMainWindow, QTextEdit class QPlainTextEditCustom(QTextEdit): def __init__(self, parent): super().__init__(parent) self.setAcceptDrops(True) def dragEnterEvent(self, event): print("QPlainTextEditCustom dragEnterEvent") event.acceptProposedAction() def dropEvent(self, event): print("QPlainTextEditCustom dropEvent") event.acceptProposedAction() class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setAcceptDrops(True) self.MoviesSearchedTextEdit = QPlainTextEditCustom(self) if __name__ == '__main__': qApp = QApplication() MainWindow = MainWindow() MainWindow.show() qApp.exec()
Impossible to drop a file in the QTextEdit, Drag never accepted.
Same problem with QPlainTextEdit.
I tried with event.accept also...This code work with PySide2 or PyQt5.
It's work with another widget like QPushButton or QLineEdit or QDIal...
Any idea ?
Thank you.
-
Hi,
Which exact version of PySide6 ?
On which platform ?Just tested on Linux with 6.1.2 installed with pip and your code worked.
-
System pip ?
Virtualenv ?
Conda ?