How to use a QAbstractTableModel with a QListView



  • I have a table model that implements QAbstractTableModel which is used by a QTableView, and I also have another widget that includes a QListView to display content that is extracted from columns of the table model. I could add a list model that implements QAbstractListModel, but I feel that duplicates the code already used to define the table model. With that in mind, does anyone know if it's possible to reuse the table model in a list view?



  • @rmam Perhaps you could use a QStandardItemModel for both your tableView and listView.


  • Lifetime Qt Champion

    Hi,

    What kind of content would that be ?

    Depending on that, a proxy model might be enough.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.