Qt Quick Controls 2 and QAbstractTableModel

278 Views Asked by At

I have a model based on QAbstractTableModel that I would like to use to display its content in a list in QML.

Actually, I need to display the first column only.

TableView does not exist in Qt Quick Controls 2 and suffers from performance issue and rendering issues on HiDPI devices.

There is suggestion in this question to use a ListView. But I fail to see how I can tell the model that I need to display the first column only.

Is there any solution for this ?

1

There are 1 best solutions below

0
On BEST ANSWER

This is automatically done in QML by ListView: the first column from the model is taken for any requested role.