Qt World Summit: Register Today!

Model/View Tutorial & QTableView General Question

  • I am just learning QT and going through all the examples so apologies for my basic questions.

    In going through the Model/View Tutorial I am having difficulty understanding how the data gets populated in the cells.

    In the "2.2 Extending the Read Only Example with Roles" example what statement calls MyModel::data and steps through every row/column/role?


  • Lifetime Qt Champion


    The views call the model's data() function for each column/row with the DisplayRole to retrieve what should be displayed.

    Hope it helps

Log in to reply