comparison examples/widgets/analogclock/AnalogClock.d @ 192:1d272f0bfefa

more D2 fixed
author eldar
date Sun, 12 Jul 2009 23:00:56 +0000
parents 834feae7809b
children 256ab6cb8e85
comparison
equal deleted inserted replaced
191:a212c97edcd2 192:1d272f0bfefa
45 import qt.gui.QPolygon; 45 import qt.gui.QPolygon;
46 import qt.gui.QColor; 46 import qt.gui.QColor;
47 import qt.gui.QPaintEvent; 47 import qt.gui.QPaintEvent;
48 import qt.gui.QPainter; 48 import qt.gui.QPainter;
49 49
50 import tango.io.Stdout;
51 50
52 class AnalogClock : public QWidget 51 class AnalogClock : public QWidget
53 { 52 {
54 public: 53 public:
55 this(QWidget parent = null) 54 this(QWidget parent = null)
62 resize(200, 200); 61 resize(200, 200);
63 } 62 }
64 63
65 void paintEvent(QPaintEvent event) 64 void paintEvent(QPaintEvent event)
66 { 65 {
67 static const QPoint[3] hourHand = [ 66 const QPoint[3] hourHand = [
68 QPoint(7, 8), 67 QPoint(7, 8),
69 QPoint(-7, 8), 68 QPoint(-7, 8),
70 QPoint(0, -40) 69 QPoint(0, -40)
71 ]; 70 ];
72 static const QPoint[3] minuteHand = [ 71 const QPoint[3] minuteHand = [
73 QPoint(7, 8), 72 QPoint(7, 8),
74 QPoint(-7, 8), 73 QPoint(-7, 8),
75 QPoint(0, -70) 74 QPoint(0, -70)
76 ]; 75 ];
77 76