Back Multiple Qt Views with One QAbstractItemModel
Stop copying contact data into every Qt view. QAbstractItemModel lets QTableView, QListView, and QTreeView share one data source.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Stop copying contact data into every Qt view. QAbstractItemModel lets QTableView, QListView, and QTreeView share one data source.
QStringListModel stores exactly what it shows. When your display format diverges from your data—like showing file names for full paths—you need a custom QAbstractItemModel. Here is how to implement the required functions and keep views synchronized.