when I drag a row to place it in the same place somehow this causes a bug to happen and remove content of this dragged row! is there any fix to keep the data of this dragged row.
import sys
from PySide2.QtWidgets import QWidget, QLabel, QApplication, QVBoxLayout,QListWidget, QListWidgetItem, QAbstractItemView, QLineEdit, QComboBox
class main(QWidget):
def __init__(self):
super().__init__()
self.setStyleSheet('*{font-size:25px;}')
self.layout = QVBoxLayout()
table = QListWidget()
table.setDragDropMode(QAbstractItemView.InternalMove)
for i in range(5):
item = QListWidgetItem()
widget = QLabel(f'textt {i}')
table.addItem(item)
table.setItemWidget(item, widget)
self.layout.addWidget(table)
self.setLayout(self.layout)
class app(QApplication):
def __init__(self):
super().__init__()
self.main = main()
self.main.show()
app = app()
sys.exit(app.exec_())