Categories
Development

How to remove a selected row from pyqt5 QStandarditemmodel in python?

I’ve been working on this code for a few days and am just stuck on how to remove a selected row from the QLineEdit (list1). I understand that by using QStandardModel I can use removeRow() to remove a row at a certain index, but I can’t seem to figure out how to determine the specific […]

Categories
Development GitHub

How to alter dropEvent action in treeview without loosing basic drag-n-drop functionality in PyQt5?

I’m using my custom item model (subclassed from QAbstractItemModel) with custom QTreeView. I want to allow internal drag-n-drop movement (MoveAction) and, when modifier key or right mouse button is pressed, pass CopyAction to my model (to dropMimeData) to copy items. However, default implementation of dropEvent() in QTreeView seems (from C code) only capable of passing […]

Categories
Development

QHBarModelMapper and QAbstractItemModel row numbering

I am a beginner to Python and Qt and this is my first question in this forum that has been of great help in my learning process. I store some hierarchical data in a QAbstractItemModel and it is working well with QTreeView. I am also succesfully using QDataWidgetMapper and selectionModel.currentChanged to map data of selected […]