Qt::ItemFlags ScoreTableModel::flags ( const QModelIndex & index )
{
- Qt::ItemFlags flags = QAbstractItemModel::flags(index);
- qDebug() << "flags " << currentMode;
-
- return flags;
+ return 0;
}
void ScoreTableModel::setMode(int m)
}
}
if (role == Qt::BackgroundRole) {
- int par = course->getPar(col).toInt();
- int shots = score->getScore(col).toInt();
-
// Hole numbers 1-18
if (row == ROW_HOLE || row == ROW_HOLE_2) {
QBrush brush(colorHoleBg);
}
if (row == ROW_SCORE || row == ROW_SCORE_2) {
+ int par;
+ int shots;
+ if (row == ROW_SCORE) {
+ par = course->getPar(col).toInt();
+ shots = score->getScore(col).toInt();
+ }
+ else {
+ par = course->getPar(col + 9).toInt();
+ shots = score->getScore(col + 9).toInt();
+ }
+
if (col == 10 && row == ROW_SCORE_2) {
// Total score
QBrush brush(colorTotal);