I'm currently working on a Qt Quick application in which there is a TableView showing data from a backend model written in C++ (it is a custom model derived from QAbstractListModel).
I want to have to possibility to set which rows can be selected by the user, so I thought to extend the custom model by overriding the function:
Qt::ItemFlags flags(const QModelIndex &index) const
The change I made has no effect on the application and by debugging I noticed that the flags function is never called by anyone (tried both using a breakpoint and printing on console).
I tried several things (even changing the base model from QAbstractListModel to QAbstractTableModel) but didn't figure out why it is not working.
At the end I tried to launch an official example (Qt Quick TableView examples - Conway’s Game of Life) provided by Qt Creator but it has the same behavior (flags function overridden but never called).
How is that function supposed to work?
I'm using Qt Creator 4.10 with Qt 5.13.1 MSVC2015 (64 bit).
Thanks!