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

Annotation of /infoscreen/clockoverlay.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 903 - (hide annotations) (download)
Fri Jun 25 07:19:20 2010 UTC (13 years, 10 months ago) by torben
File size: 821 byte(s)
show correct time on first display
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 torben 890 palette.setColor(QPalette::WindowText, Qt::darkBlue );
11     palette.setColor(QPalette::Light, Qt::darkBlue ); //Light and dark are used for shadows when SegmentStyle is filled or Outline
12     palette.setColor(QPalette::Dark, Qt::darkBlue ); //they are also used in the border
13 torben 886
14 torben 890
15     this->setSegmentStyle( Flat );
16 torben 886 this->setAutoFillBackground ( true );
17     this->setPalette(palette);
18 torben 903
19     timerTick();
20 torben 883 }
21    
22    
23     void ClockOverlay::timerTick()
24     {
25     QTime now = QTime::currentTime();
26     QString format = ( (now.second()%2)==0) ? "HH:mm" : "HH mm";
27    
28     this->display( QTime::currentTime().toString(format) );
29    
30 torben 886
31 torben 883 this->raise();
32     }

  ViewVC Help
Powered by ViewVC 1.1.20