#include <QBrush>
#include <QFont>
#include "table-model.h"
+#include "score-common.h"
-QString empty("");
-#define SC_BLUE_THEME
-QColor colorHoleBg(26, 26, 26);
-QColor colorHoleFg(Qt::yellow);
-QColor colorBirdie(00, 0x99, 00);
-QColor colorPar(Qt::black);
-#ifdef SC_ORANGE_THEME
-QColor colorBogey(0xfc, 0xaf, 0x3e);
-QColor colorDoubleBogey(0xf5, 0x79, 0x00);
-QColor colorBad(0xce, 0x5c, 0x00);
-#endif
-#ifdef SC_BLUE_THEME
-QColor colorBogey(0x20, 0x4a, 0x87);
-QColor colorDoubleBogey(0x34, 0x65, 0xa4);
-QColor colorBad(0x72, 0x9f, 0xcf);
-#endif
-QColor colorSubTotal(Qt::black);
-QColor colorTotal(Qt::black);
-
-Qt::ItemFlags ScoreTableModel::flags (const QModelIndex & index)
+Qt::ItemFlags ScoreTableModel::flags (const QModelIndex &)
{
return 0;
}
}
}
-int ScoreTableModel::rowCount(const QModelIndex & parent) const
+int ScoreTableModel::rowCount(const QModelIndex &) const
{
return 8;
}
-int ScoreTableModel::columnCount(const QModelIndex & parent) const
+int ScoreTableModel::columnCount(const QModelIndex &) const
{
return 9 + 2; // 2 for in/out and tot columns
}
shots = score->getScore(col + 9).toInt();
}
- if (col == 10 && row == ROW_SCORE_2) {
+ if (col == (COLS+1) && row == ROW_SCORE_2) {
// Total score
QBrush brush(colorTotal);
return brush;
}
- if (col == 9) {
+ if (col == COLS) {
// In and Out scores
QBrush brush(colorSubTotal);
return brush;
}
- if (col < 9) {
+ if (col < COLS) {
if (shots == par) {
// Par
QBrush brush(colorPar);
// FONT
//
if (role == Qt::FontRole) {
- if (row == ROW_SCORE_2 && col == 10) {
+ if (row == ROW_SCORE_2 && col == (COLS+1)) {
QFont font;
font.setBold(true);
return font;
//
if (role == Qt::DisplayRole) {
- if (col == 9) {
+ if (col == COLS) {
// In/out label
if (row == ROW_HOLE)
return QString("Out");
return score->getTotal(TotalIn);
}
- else if (col == 10) {
+ else if (col == (COLS+1)) {
// Total label
if (row == ROW_HOLE_2)
return QString("Tot");
return QVariant();
}
-int ScoreTableModel::setItem(int row, int col, int data)
+int ScoreTableModel::setItem(int row, int col, int)
{
emit dataChanged(createIndex(row, col), createIndex(row, col));
return 1;
if (orientation == Qt::Horizontal)
return QVariant();
-#if 0
- if (role == Qt::BackgroundRole) {
- QColor colorHoleBg(Qt::darkGray);
- QBrush brush(colorHoleBg);
- return brush;
- }
-#endif
if (role == Qt::DisplayRole) {
switch(section) {
case ROW_PAR: