Important: Please read the Qt Code of Conduct -

QStyledItemDelegate vs QSqlQueryModel::data()

  • Given a QSqlQueryModel and a QTableView.

    How exactly are items displayed, wrt QStyledItemDelegate vs QSqlQueryModel::data()?

    Specifically: when an item is just being displayed, i.e. Qt::DisplayRole, does the (default?) QStyledItemDelegate call QSqlQueryModel::data(index, Qt::DisplayRole) to get the string representation of the data and display that, or does the (default?) QStyledItemDelegate have its own code to do the display role/string work?

  • Lifetime Qt Champion


    It will call QModelIndex::data that it will then feed to displayText in order to have the text to draw in the cell.

Log in to reply