Calendar move defaults to constructor

This commit is contained in:
Berend De Schouwer
2009-12-31 10:58:21 +02:00
committed by Sean Rhea
parent 255f57b5f7
commit d4ee3fe8cd
2 changed files with 6 additions and 6 deletions

View File

@@ -130,12 +130,7 @@ MainWindow::MainWindow(const QDir &home) :
// Analysis toolbox contents
calendar = new RideCalendar;
calendar->setFirstDayOfWeek(Qt::Monday);
calendar->setHome(home);
calendar->addWorkoutCode(QString("race"), QColor(Qt::red));
calendar->addWorkoutCode(QString("sick"), QColor(Qt::yellow));
calendar->addWorkoutCode(QString("swim"), QColor(Qt::blue));
calendar->addWorkoutCode(QString("gym"), QColor(Qt::gray));
treeWidget = new QTreeWidget;
treeWidget->setColumnCount(3);

View File

@@ -14,6 +14,11 @@
RideCalendar::RideCalendar(QWidget *parent)
: QCalendarWidget(parent)
{
this->setFirstDayOfWeek(Qt::Monday);
this->addWorkoutCode(QString("race"), QColor(255,128,128));
this->addWorkoutCode(QString("sick"), QColor(255,255,128));
this->addWorkoutCode(QString("swim"), QColor(128,128,255));
this->addWorkoutCode(QString("gym"), QColor(Qt::lightGray));
};
void RideCalendar::paintCell(QPainter *painter, const QRect &rect, const QDate &date) const
@@ -60,7 +65,7 @@ void RideCalendar::paintCell(QPainter *painter, const QRect &rect, const QDate &
QString notesPath = home.absolutePath() + "/" + ride->notesFileName;
QFile notesFile(notesPath);
QColor color(Qt::green);
QColor color(128, 255, 128);
QString line("Ride");
QString code;
if (notesFile.exists()) {