Mercurial > projects > qtd
comparison examples/opengl/hellogl/glwidget.d @ 323:7a3c43424dca signals
make all examples compile with new signals/slots
author | eldar_ins@eldar-laptop |
---|---|
date | Mon, 28 Dec 2009 16:28:55 +0500 |
parents | 1f6923c8cba0 |
children |
comparison
equal
deleted
inserted
replaced
322:7c2cf27391c4 | 323:7a3c43424dca |
---|---|
67 { | 67 { |
68 makeCurrent(); | 68 makeCurrent(); |
69 glDeleteLists(object, 1); | 69 glDeleteLists(object, 1); |
70 } | 70 } |
71 | 71 |
72 QSize minimumSizeHint() | 72 QSize minimumSizeHint() const |
73 { | 73 { |
74 return QSize(50, 50); | 74 return QSize(50, 50); |
75 } | 75 } |
76 | 76 |
77 QSize sizeHint() | 77 QSize sizeHint() const |
78 { | 78 { |
79 return QSize(400, 400); | 79 return QSize(400, 400); |
80 } | 80 } |
81 | 81 |
82 | 82 |
83 public: // slots: | 83 public: // slots: |
84 void setXRotation(int angle) | 84 void slot_setXRotation(int angle) |
85 { | 85 { |
86 normalizeAngle(&angle); | 86 normalizeAngle(&angle); |
87 if (angle != xRot) { | 87 if (angle != xRot) { |
88 xRot = angle; | 88 xRot = angle; |
89 xRotationChanged(angle); | 89 xRotationChanged(angle); |
90 updateGL(); | 90 updateGL(); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 void setYRotation(int angle) | 94 void slot_setYRotation(int angle) |
95 { | 95 { |
96 normalizeAngle(&angle); | 96 normalizeAngle(&angle); |
97 if (angle != yRot) { | 97 if (angle != yRot) { |
98 yRot = angle; | 98 yRot = angle; |
99 yRotationChanged(angle); | 99 yRotationChanged(angle); |
100 updateGL(); | 100 updateGL(); |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 void setZRotation(int angle) | 104 void slot_setZRotation(int angle) |
105 { | 105 { |
106 normalizeAngle(&angle); | 106 normalizeAngle(&angle); |
107 if (angle != zRot) { | 107 if (angle != zRot) { |
108 zRot = angle; | 108 zRot = angle; |
109 zRotationChanged(angle); | 109 zRotationChanged(angle); |
110 updateGL(); | 110 updateGL(); |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 mixin Signal!("xRotationChanged", int); | 114 final // signals |
115 mixin Signal!("yRotationChanged", int); | 115 { |
116 mixin Signal!("zRotationChanged", int); | 116 void signal_xRotationChanged(int); |
117 | 117 void signal_yRotationChanged(int); |
118 void signal_zRotationChanged(int); | |
119 } | |
118 | 120 |
119 protected: | 121 protected: |
120 void initializeGL() | 122 void initializeGL() |
121 { | 123 { |
122 qglClearColor(trolltechPurple.darker()); | 124 qglClearColor(trolltechPurple.darker()); |
262 int yRot; | 264 int yRot; |
263 int zRot; | 265 int zRot; |
264 QPoint lastPos; | 266 QPoint lastPos; |
265 QColor trolltechGreen; | 267 QColor trolltechGreen; |
266 QColor trolltechPurple; | 268 QColor trolltechPurple; |
269 | |
270 mixin Q_OBJECT; | |
267 } | 271 } |