summaryrefslogtreecommitdiff
path: root/noncore/tools/clock/analogclock.cpp
Unidiff
Diffstat (limited to 'noncore/tools/clock/analogclock.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/analogclock.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/tools/clock/analogclock.cpp b/noncore/tools/clock/analogclock.cpp
index bf358e2..c5f0155 100644
--- a/noncore/tools/clock/analogclock.cpp
+++ b/noncore/tools/clock/analogclock.cpp
@@ -23,49 +23,49 @@
23#include <qlayout.h> 23#include <qlayout.h>
24#include <qpainter.h> 24#include <qpainter.h>
25#include <qtopia/global.h> 25#include <qtopia/global.h>
26 26
27#include <math.h> 27#include <math.h>
28 28
29 const double deg2rad = 0.017453292519943295769;// pi/180 29 const double deg2rad = 0.017453292519943295769;// pi/180
30 30
31AnalogClock::AnalogClock( QWidget *parent, const char *name ) 31AnalogClock::AnalogClock( QWidget *parent, const char *name )
32 : QFrame( parent, name ), clear(false) 32 : QFrame( parent, name ), clear(false)
33{ 33{
34 setMinimumSize(50,50); 34 setMinimumSize(50,50);
35} 35}
36 36
37QSizePolicy AnalogClock::sizePolicy() const 37QSizePolicy AnalogClock::sizePolicy() const
38{ 38{
39 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); 39 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
40} 40}
41 41
42void AnalogClock::drawContents( QPainter *p ) 42void AnalogClock::drawContents( QPainter *p )
43{ 43{
44#if !defined(NO_DEBUG) 44#if !defined(NO_DEBUG)
45 static bool first = true; 45 static bool first = true;
46 if ( first ) { 46 if ( first ) {
47 QTOPIA_PROFILE("first paint event"); 47 //QTOPIA_PROFILE("first paint event");
48 first = false; 48 first = false;
49 } 49 }
50#endif 50#endif
51 51
52 QRect r = contentsRect(); 52 QRect r = contentsRect();
53 53
54 if ( r.width() < r.height() ) { 54 if ( r.width() < r.height() ) {
55 r.setY( (r.height() - r.width())/2 ); 55 r.setY( (r.height() - r.width())/2 );
56 r.setHeight( r.width() ); 56 r.setHeight( r.width() );
57 } 57 }
58 58
59 QPoint center( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 59 QPoint center( r.x() + r.width() / 2, r.y() + r.height() / 2 );
60 60
61 const int w_tick = r.width()/300+1; 61 const int w_tick = r.width()/300+1;
62 const int w_sec = r.width()/400+1; 62 const int w_sec = r.width()/400+1;
63 const int w_hour = r.width()/80+1; 63 const int w_hour = r.width()/80+1;
64 64
65 QPoint l1( r.x() + r.width() / 2, r.y() + 2 ); 65 QPoint l1( r.x() + r.width() / 2, r.y() + 2 );
66 QPoint l2( r.x() + r.width() / 2, r.y() + 8 ); 66 QPoint l2( r.x() + r.width() / 2, r.y() + 8 );
67 67
68 QPoint h1( r.x() + r.width() / 2, r.y() + r.height() / 4 ); 68 QPoint h1( r.x() + r.width() / 2, r.y() + r.height() / 4 );
69 QPoint h2( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 69 QPoint h2( r.x() + r.width() / 2, r.y() + r.height() / 2 );
70 70
71 QPoint m1( r.x() + r.width() / 2, r.y() + r.height() / 9 ); 71 QPoint m1( r.x() + r.width() / 2, r.y() + r.height() / 9 );