Well, this is my code for data() function:
{
if(index.isValid() && role==Qt::EditRole)
return m_pMerchandizeOrder->orders()->at(index.row()).strDisplayString;
//QStandardItemModel::data(index, role);
if(index.isValid() && role==Qt::FontRole)
return QVariant();
// returns invalid record }
QVariant CShoppingCartModel::data(const QModelIndex &index, int role) const
{
if(index.isValid() && role==Qt::EditRole)
return m_pMerchandizeOrder->orders()->at(index.row()).strDisplayString;
//QStandardItemModel::data(index, role);
if(index.isValid() && role==Qt::FontRole)
return QFont("Courier New", 24, QFont::Bold);
return QVariant(); // returns invalid record
}
To copy to clipboard, switch view to plain text mode
And the result is still the same, the cell size is not updated. What is still missing?
Bookmarks