21#include <swclockcontrol.h>
30 _flipHour->setTransition( SWFlipDigit::Flip );
31 _flipMinute->setTransition( SWFlipDigit::Flip );
32 _flipSecond->setTransition( SWFlipDigit::Flip );
38 QPalette pal = palette();
39 pal.setColor( QPalette::Window, Qt::black );
42 _ticker.start( 1000,
this );
43 QTime t = QTime::currentTime();
44 _flipHour->setNumber( t.hour() );
45 _flipMinute->setNumber( t.minute() );
52SWClockControl::~SWClockControl()
69void SWClockControl::loadSettings()
75void SWClockControl::saveSettings()
81void SWClockControl::updateTime()
83 QTime now = QTime::currentTime();
84 _flipHour->flipTo( now.hour() );
85 _flipMinute->flipTo( now.minute() );
86 _flipSecond->flipTo( now.second() );
92void SWClockControl::switchTransition(
int delta )
94 int i = ( _flipHour->transition() + delta + 3) % 3;
95 _flipHour->setTransition( (SWFlipDigit::SWFlipMode) i );
96 _flipMinute->setTransition( (SWFlipDigit::SWFlipMode) i );
120void SWClockControl::timerEvent( QTimerEvent* event )
129void SWClockControl::chooseSlide()
131 _flipHour->setTransition( SWFlipDigit::Slide );
132 _flipMinute->setTransition( SWFlipDigit::Slide );
133 _flipSecond->setTransition( SWFlipDigit::Slide );
138void SWClockControl::chooseFlip()
140 _flipHour->setTransition( SWFlipDigit::Flip );
141 _flipMinute->setTransition( SWFlipDigit::Flip );
142 _flipSecond->setTransition( SWFlipDigit::Flip );
146void SWClockControl::chooseRotate()
148 _flipHour->setTransition( SWFlipDigit::Rotate );
149 _flipMinute->setTransition( SWFlipDigit::Rotate );
150 _flipSecond->setTransition( SWFlipDigit::Rotate );