/[projects]/infoscreen/clockoverlay.cpp
ViewVC logotype

Contents of /infoscreen/clockoverlay.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 889 - (show annotations) (download)
Thu Jun 24 12:36:17 2010 UTC (13 years, 10 months ago) by torben
File size: 629 byte(s)
Set LCD segmentstyle
1 #include "clockoverlay.h"
2 #include <QTime>
3
4 ClockOverlay::ClockOverlay(QWidget* parent)
5 : QLCDNumber(parent)
6 {
7 QPalette palette;
8 palette.setColor(QPalette::Window, Qt::white );
9
10 palette.setColor(QPalette::Light, Qt::blue );
11 palette.setColor(QPalette::Dark, Qt::darkBlue );
12
13 this->setSegmentStyle( Filled );
14 this->setAutoFillBackground ( true );
15 this->setPalette(palette);
16 }
17
18
19 void ClockOverlay::timerTick()
20 {
21 QTime now = QTime::currentTime();
22 QString format = ( (now.second()%2)==0) ? "HH:mm" : "HH mm";
23
24 this->display( QTime::currentTime().toString(format) );
25
26
27 this->raise();
28 }

  ViewVC Help
Powered by ViewVC 1.1.20