Categories
Development

Optimize PyQt5 QAbstractView for Pandas Model

I am currently writing a SQL query interface through Python. When writing the data into a QTableView, I am using a QAbstractTableModel to write the query result. This works fine for smaller queries, but becomes extremely slow when trying to present many rows and columns. Is there anyway to increase the speed that the dataframe […]

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 Plugins

How to clear and redraw MapPolyline in Qt

I have MapPolyline on my map and want to clear that polyline and redraw new polyline when user click on mouseclick area. I am using clearMapItem() to clear MapPolyline. The problem is I’m unable to redraw MapPolyline once it clear. Also I want to add markers on map. I took PositionRole for marker but not […]

Categories
Development

Prevent ComboBox editing in StyledItemDelegate

I am trying to make everything shown by the current code un-editable. Previous searches all suggest either modifying the flags() function of the model or using the setEditTriggers of the table. I do both in this code, but neither of them work. Looking at a widget-by-widget case, I can find readonly modes for LineEdit and […]