QTableView * table = new QTableView;
table->showGrid();
table->setSelectionMode(QAbstractItemView::NoSelection);
- table->setStyleSheet(ScoreStyle::style());
+ table->setStyleSheet(defaultStyleSheet);
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->verticalHeader()->setResizeMode(QHeaderView::Stretch);
table->horizontalHeader()->hide();
table->horizontalHeader()->hide();
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->verticalHeader()->setResizeMode(QHeaderView::Stretch);
- table->setStyleSheet(ScoreStyle::style());
+ table->setStyleSheet(defaultStyleSheet);
}
void CourseDialog::init(Course *course)
scoreListModel = new ScoreListModel(scoreList, clubList);
courseListModel = new CourseListModel(clubList);
- list->setStyleSheet(ScoreStyle::style());
+ list->setStyleSheet(defaultStyleSheet);
list->setSelectionMode(QAbstractItemView::SingleSelection);
list->setProperty("FingerScrolling", true);
QTableView *table = new QTableView;
table->showGrid();
table->setSelectionMode(QAbstractItemView::NoSelection);
- table->setStyleSheet(ScoreStyle::style());
+ table->setStyleSheet(statStyleSheet);
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->verticalHeader()->setResizeMode(QHeaderView::Stretch);
table->verticalHeader()->setAutoFillBackground(true);
#ifndef SCORE_COMMON_H
#define SCORE_COMMON_H
-#if 0
-#define SC_BLUE_THEME
-
-QColor colorHoleBg(64, 64, 64);
-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);
-#endif
#include <QColor>
#ifndef WANT_DEBUG
#define TRACE qDebug()<<QString("[%1] %2(): %3").arg(__FILE__).arg(__func__).arg(__LINE__);
#endif
+static int fontSize = 20;
class AppSettings {
public:
static QColor total() { return Qt::white; }
};
-class ScoreStyle {
-public:
- static QString style()
- {
- return QString("QTableView {"
- "background-color: white;"
- "color : gray;"
- "border: solid green;"
- "font-size : 20px;"
- "}"
- "QHeaderView::section {"
- "color : white;"
- "border: solid green;"
- "font: bold large;"
- "}");
-
+static QString statStyleSheet("QTableView {color : white;}");
+static QString defaultStyleSheet("QTableView {"
+ "background-color: white;"
+ "color : gray;"
+ "border: solid green;"
+ "}"
+ "QHeaderView::section {"
+ "color : white;"
+ "border: solid green;"
+ "}");
#if 0
- "QAbstractItemView::item[role=\"header\"]{"
- "background : orange;"
- "color : yellow;"
- "border: solid green;"
- "font-size : 16px;"
- "}"
- "QAbstractItemView::item"
- "background : orange;"
- "color : white;"
- "border: solid green;"
- "font-size : 16px;"
- "}"
- "QTableView {"
- "alternate-background-color: yellow;"
- "background-color: red;"
- "color : blue;"
- "border: solid green;"
- "gridline-color: green;"
- "}"
-
+"QAbstractItemView::item[role=\"header\"]{"
+"background : orange;"
+"color : yellow;"
+"border: solid green;"
+"font-size : 16px;"
+"}"
+"QAbstractItemView::item"
+"background : orange;"
+"color : white;"
+"border: solid green;"
+"font-size : 16px;"
+"}"
+"QTableView {"
+"alternate-background-color: yellow;"
+"background-color: red;"
+"color : blue;"
+"border: solid green;"
+"gridline-color: green;"
+"}"
#endif
- }
- static QString headerView()
- {
- return QString("QHeaderView::section { background-color : #404040 }");
- //return QString("QHeaderView { background-color : #404040 }");
- return QString("QTableView { background-color : red }");
- }
-};
-
#endif
QTableView * table = new QTableView;
table->showGrid();
table->setSelectionMode(QAbstractItemView::NoSelection);
- table->setStyleSheet(ScoreStyle::style());
+ table->setStyleSheet(defaultStyleSheet);
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->verticalHeader()->setResizeMode(QHeaderView::Stretch);
table->horizontalHeader()->hide();
{
TRACE;
resize(800, 400);
+ QFont font;
+ font.setPointSize(fontSize);
+ setFont(font);
QWidget *centralWidget = new QWidget(this);
table->verticalHeader()->setResizeMode(QHeaderView::Stretch);
table->horizontalHeader()->hide();
- table->setStyleSheet(ScoreStyle::style());
+ table->setStyleSheet(defaultStyleSheet);
QStringList headers;
headers << "" << "Par" << "HCP" << "Score" << "" << "Par" << "HCP" << "Score";
*/
#include <QVariant>
+#include <QFont>
+#include "score-common.h"
#include "stat-model.h"
StatModel::StatModel(QList<Club *> &cList, QList<Score *> &sList) : clubList(cList), scoreList(sList)
}
//
+ // FONT
+ //
+ if (role == Qt::FontRole) {
+ QFont font;
+ font.setPointSize(fontSize);
+ return font;
+ }
+ //
// NUMBERS
//
if (role == Qt::DisplayRole) {
//
if (role == Qt::FontRole) {
QFont font;
- font.setBold(true);
- font.setPointSize(26);
+ font.setPointSize(fontSize);
+ if (row == ROW_HOLE || row == ROW_HOLE_2) {
+ font.setBold(true);
+ }
return font;
}
if (orientation == Qt::Horizontal)
return QVariant();
+ if (role == Qt::FontRole) {
+ QFont font;
+ font.setPointSize(fontSize);
+ return font;
+ }
if (role == Qt::DisplayRole) {
switch(section) {
case ROW_HOLE:
// FONT
//
if (role == Qt::FontRole) {
+ QFont font;
+ font.setPointSize(fontSize);
if (row == ROW_HOLE || row == ROW_HOLE_2) {
- QFont font;
font.setBold(true);
- return font;
}
+ return font;
}
//
// COLORS
if (orientation == Qt::Horizontal)
return QVariant();
+ if (role == Qt::FontRole) {
+ QFont font;
+ font.setPointSize(fontSize);
+ return font;
+ }
if (role == Qt::DisplayRole) {
switch(section) {
case ROW_HOLE: