Normally, you implement your own data() method that returns the value for a given ModelIndex. It could look something like this:

Qt Code:
  1. QVariant CalculatorTapeModel::data(const QModelIndex &index, int role) const
  2. {
  3. if (!index.isValid()) return QVariant();
  4.  
  5.  
  6. if (role == Qt::TextAlignmentRole)
  7. {
  8. ... alignment code ...
  9. }
  10.  
  11.  
  12. if (role == Qt::DisplayRole)
  13. {
  14. *** This is where you should check the state of your dynamic items ***
  15. ... return data for requested item ...
  16. }
  17. }
To copy to clipboard, switch view to plain text mode