title: Qt Abstract Model - flags() function never called
body: <p>I'm currently working on a <strong>Qt Quick application</strong> in which there is a <strong><a href="https://doc.qt.io/qt-5/qml-qtquick-controls-tableview.html" rel="nofollow noreferrer">TableView</a></strong> showing data from a <strong>backend model</strong> written in C++ (it is a custom model derived from <strong><a href="https://doc.qt.io/qt-5/qabstractlistmodel.html" rel="nofollow noreferrer">QAbstractListModel</a></strong>).</p>
  
  <p>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:</p>
  
  <pre><code>Qt::ItemFlags flags(const QModelIndex &amp;index) const
  </code></pre>
  
  <p>The change I made has no effect on the application and by debugging I noticed that the <em><a href="https://doc.qt.io/qt-5/qabstractlistmodel.html#flags" rel="nofollow noreferrer">flags</a></em> function is <strong>never called</strong> by anyone (tried both using a breakpoint and printing on console).</p>
  
  <p>I tried several things (even changing the base model from QAbstractListModel to QAbstractTableModel) but didn't figure out why it is not working.</p>
  
  <p>At the end I tried to launch an <strong>official example</strong> (<strong><a href="https://doc.qt.io/qt-5.12/qtquick-tableview-gameoflife-example.html" rel="nofollow noreferrer">Qt Quick TableView examples - Conway’s Game of Life</a></strong>) provided by <strong>Qt Creator</strong> but it has the same behavior (flags function overridden but never called).</p>
  
  <p>How is that function supposed to work?</p>
  
  <p>I'm using Qt Creator 4.10 with Qt 5.13.1 MSVC2015 (64 bit).</p>
  
  <p>Thanks!</p>