{
score = 0;
course = 0;
+ handicap = -1;
}
-void ScoreTableModel::set(Score * s, Course * c)
+void ScoreTableModel::set(Score * s, Course * c, int h)
{
score = s;
course = c;
+ handicap = h;
}
int ScoreTableModel::rowCount(const QModelIndex &) const
return course->getTotal(Total);
if (score && row == ROW_SCORE_2)
return score->getTotal(Total);
+ // calculate net score
+ if (score && course && row == ROW_HCP_2) {
+ int scoreTotal = score->getTotal(Total).toInt();
+ int courseTotal = course->getTotal(Total).toInt();
+ int n = scoreTotal - courseTotal;
+ return QString("+%1").arg(n);
+ }
}
else {
// data cells