Quote Originally Posted by istdasklar View Post
Exemple, change the background color of a selected items with values 69:

Qt Code:
  1. QModelIndex id = tableView->currentIndex();
  2. if ( model->data(id,Qt::DisplayRole) == 69 )
  3. id->setBackground ( pink) ..... //SOMETHING THAT
To copy to clipboard, switch view to plain text mode 
Subclass QSqlTableModel and reimplement QAbstractItemModel::data():
Qt Code:
  1. QVariant MySqlTableModel::data(const QModelIndex& index, int role) const
  2. {
  3. QVariant val = QSqlTableModel::data(index, role);
  4. if (role == Qt::BackgroundRole && val == 69)
  5. {
  6. return QVariant::fromValue(QBrush(Qt::red)); // or QColor?
  7. }
  8. return val;
  9. }
To copy to clipboard, switch view to plain text mode 

Or , I want an icons near items with values = 69.
Similar approach works. Use QModelIndex::sibling() to test sibling items' values.