Hi!

I am experimenting with a subclass of QSqlQueryModel. Since I wanted to change the background color in the ListView, I reimplemented the data method

Qt Code:
  1. QVariant BrowseWoTableModel::data( const QModelIndex &item, int role ) const
  2. {
  3. if( role == Qt::BackgroundColorRole )
  4. {
  5. return Qt::green;
  6. }
  7.  
  8. else if( role == Qt::DisplayRole )
  9. {
  10. return record( item.row() ).value( item.column() );
  11. }
  12.  
  13. return QVariant();
  14. }
To copy to clipboard, switch view to plain text mode 

This works for setting the background color, but fails in displaying the data.

What am I missing here?

//John