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

Contents of /infoscreen/clockoverlay.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 890 - (show annotations) (download)
Thu Jun 24 12:50:01 2010 UTC (13 years, 10 months ago) by torben
File size: 803 byte(s)
more styling
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::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
14
15 this->setSegmentStyle( Flat );
16 this->setAutoFillBackground ( true );
17 this->setPalette(palette);
18 }
19
20
21 void ClockOverlay::timerTick()
22 {
23 QTime now = QTime::currentTime();
24 QString format = ( (now.second()%2)==0) ? "HH:mm" : "HH mm";
25
26 this->display( QTime::currentTime().toString(format) );
27
28
29 this->raise();
30 }

  ViewVC Help
Powered by ViewVC 1.1.20