Search code examples
qtqmlqabstracttablemodel

Qt Quick Controls 2 and QAbstractTableModel


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 ?


Solution

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