Im using a QAbstractTableModel with a QTableView and I would like to change a few things graphically.
1. I know how to make one specific column editable. However, when I select a row, the entire row does not highlight, only the editable column on that row is highlighted. How do I go about getting the entire row highlighted, but leaving the one column eligible for editing.

Here is my flags function:
Qt Code:
  1. Qt::ItemFlags WTrackTableModel::flags(const QModelIndex &index) const
  2. {
  3. if (!index.isValid())
  4. return Qt::ItemIsEnabled;
  5. switch(index.column())
  6. {
  7. case 7: return QAbstractItemModel::flags(index) | Qt::ItemIsEditable;
  8. }
  9. return Qt::ItemIsEnabled;
  10. }
To copy to clipboard, switch view to plain text mode 

2. I set my row colors according to the color taken from an xml file like so if row colors are present:
Qt Code:
  1. void WTrackTableView::setup(QDomNode node)
  2. {
  3. // Position
  4. if (!WWidget::selectNode(node, "Pos").isNull())
  5. {
  6. QString pos = WWidget::selectNodeQString(node, "Pos");
  7. int x = pos.left(pos.find(",")).toInt();
  8. int y = pos.mid(pos.find(",")+1).toInt();
  9. move(x,y);
  10. }
  11.  
  12. // Size
  13. if (!WWidget::selectNode(node, "Size").isNull())
  14. {
  15. QString size = WWidget::selectNodeQString(node, "Size");
  16. int x = size.left(size.find(",")).toInt();
  17. int y = size.mid(size.find(",")+1).toInt();
  18. setFixedSize(x,y);
  19. }
  20. // Foreground color
  21. QColor fgc(0,0,0);
  22. if (!WWidget::selectNode(node, "FgColor").isNull())
  23. {
  24. fgc.setNamedColor(WWidget::selectNodeQString(node, "FgColor"));
  25. }
  26. m_pTable->setForegroundColor(fgc);
  27.  
  28. // Row colors
  29. if (!WWidget::selectNode(node, "BgColorRowEven").isNull())
  30. {
  31. QColor r1;
  32. r1.setNamedColor(WWidget::selectNodeQString(node, "BgColorRowEven"));
  33. QColor r2;
  34. r2.setNamedColor(WWidget::selectNodeQString(node, "BgColorRowUneven"));
  35. setAlternatingRowColors ( true );
  36. m_pTable->setRowColor(r1, r2);
  37. QPalette Rowpalette = palette();
  38. Rowpalette.setColor(QPalette::Base, r1);
  39. Rowpalette.setColor(QPalette::AlternateBase, r2);
  40. setPalette(Rowpalette);
  41. }
  42.  
  43. /*
  44.   // BPM confidence colors
  45.   if (!WWidget::selectNode(node, "BgColorBpmNoConfirm").isNull())
  46.   {
  47.   QColor c1;
  48.   c1.setNamedColor(WWidget::selectNodeQString(node, "BgColorBpmNoConfirm"));
  49.   QColor c2;
  50.   c2.setNamedColor(WWidget::selectNodeQString(node, "BgColorBpmConfirm"));
  51.  
  52.   }
  53.   */
  54. }
To copy to clipboard, switch view to plain text mode 
in the QTableView on lines 28-41. Now what I would like to do is use the colors found in the BPM if statement on items in one single column. Say I have a function [bool bpmConfirm()] that returns true if the BPM is confirmed, I would then like to use r2, and r1 is the BPM is not confirmed. How would I go about doing this?

just for reference, here is what my data function looks like in my model:
Qt Code:
  1. QVariant WTrackTableModel :: data(const QModelIndex &index, int role) const
  2. {
  3. TrackInfoObject *m_pTrackInfo = m_pTrackPlaylist->getTrackAt(index.row());
  4.  
  5. if (!index.isValid())
  6. return QVariant();
  7.  
  8. if (index.row() >= m_pTrackPlaylist->getSongNum())
  9. return QVariant();
  10.  
  11. if (role == Qt::ForegroundRole )
  12. {
  13. return foregroundColor;
  14. }
  15. else if (role == Qt::DisplayRole )
  16. {
  17. switch(index.column())
  18. {
  19. case 0: return m_pTrackInfo->getScoreStr();
  20. case 1: return m_pTrackInfo->getTitle();
  21. case 2: return m_pTrackInfo->getArtist();
  22. case 3: return m_pTrackInfo->getType();
  23. case 4: return m_pTrackInfo->getDurationStr();
  24. case 5: return m_pTrackInfo->getBitrateStr();
  25. case 6: return m_pTrackInfo->getBpmStr();
  26. case 7: return m_pTrackInfo->getComment();
  27. }
  28. }
  29.  
  30. else
  31. return QVariant();
  32. }
To copy to clipboard, switch view to plain text mode 
Thanks!
Nate