I need to change order of data elements themselves. How can i do this?
I need to change order of data elements themselves. How can i do this?
Enable "InternalMove" dragDropMode for the view.
Enabling "InternalMove" does not make it possible to change the order of elements in a table. In fact it seems to have no effect whatsoever.
I have a custom model (inherited from QAbstractListModel) and use a QTableView to view the data. I would like to be able to reorder the columns by dragging and dropping them.
Does anyone know how to achieve this?
If you want the column (row) display order to be changeable by drag and drop of the column (row) headers then you need to look at QHeaderView::setMovable(). Wysota's suggestion is to do with moving data about within the model underlying the view (using drag and drop on the view).
I was addressing the "changing row order in model" issue.
Bookmarks