Hi,

I've a TableWidget:

Qt Code:
  1. TableResult = new QTableWidget;
  2. TableResult->setRowCount(10);
  3. TableResult->setColumnCount(5);
  4. for(int c=1;c<5;c++){
  5. for(int r=1;r<10;r++){
  6. QTableWidgetItem *tmpItem;
  7. tmpItem= new QTableWidgetItem(tr("%1 x %2").arg(c).arg(r));
  8. TableResult->setItem(r, c, tmpItem);
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 

How to set background color rows number 1, 3, 5, 7, 9 to (example) blue, and rows number 2,4,6,8 to red?

If I had a model-view-delegate pattern, I could do it in delegate, but I've any view, any model, any delegate :/