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

Annotation of /infoscreen/clockoverlay.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 889 - (hide 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 torben 883 #include "clockoverlay.h"
2     #include <QTime>
3    
4     ClockOverlay::ClockOverlay(QWidget* parent)
5     : QLCDNumber(parent)
6     {
7 torben 886 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 torben 889 this->setSegmentStyle( Filled );
14 torben 886 this->setAutoFillBackground ( true );
15     this->setPalette(palette);
16 torben 883 }
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 torben 886
27 torben 883 this->raise();
28     }

  ViewVC Help
Powered by ViewVC 1.1.20