A
A
Alexey2014-09-26 16:33:47
Qt
Alexey, 2014-09-26 16:33:47

Is it possible to implement ordered insertion in QTableView?

Good day!
The situation is this - I use QTableView to display the state of the input data stream. Those. I have the vertical and horizontal header disabled and the "Tables" element is a cell with a PID/LID data pair and a color. It turns out that the columns and rows do not have any names, they are not responsible for anything.
Before adding data to the table for the first time, I initially just sort the array with pids / leads and sequentially add them to the table. The table is sorted, first there are cells with PID==0, sorted by LID, then with PID==1, and so on.
Is it possible to implement ordered insertion at all? Without sorting the original array, and so that you can then insert cells into the table while maintaining order? Or maybe something else should be used for such purposes?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lolshto, 2014-09-26
@Renzo

You can hang QSortFilterProxyModel between your model and View. Enable for QSortFilterProxyModel dynamicSort . Then you can add to yours any way you like.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question