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

Annotation of /infoscreen/clockoverlay.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 886 - (hide annotations) (download)
Thu Jun 24 12:14:33 2010 UTC (13 years, 10 months ago) by torben
File size: 592 byte(s)
Style clockoverlay
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     this->setAutoFillBackground ( true );
14     this->setPalette(palette);
15 torben 883 }
16    
17    
18     void ClockOverlay::timerTick()
19     {
20     QTime now = QTime::currentTime();
21     QString format = ( (now.second()%2)==0) ? "HH:mm" : "HH mm";
22    
23     this->display( QTime::currentTime().toString(format) );
24    
25 torben 886
26 torben 883 this->raise();
27     }

  ViewVC Help
Powered by ViewVC 1.1.20