Mercurial > projects > qtd
comparison d2/qt/core/QPoint.d @ 371:12f60887ed15
add elasticnodes example and necessary changes to the library.
author | Eldar Insafutdinov |
---|---|
date | Wed, 07 Jul 2010 22:54:12 +0100 |
parents | 96a75b1e5b26 |
children | 1f189d0ceab4 |
comparison
equal
deleted
inserted
replaced
370:7fd4b69378bf | 371:12f60887ed15 |
---|---|
137 public this(QPoint p) { | 137 public this(QPoint p) { |
138 xp = p.x(); | 138 xp = p.x(); |
139 yp = p.y(); | 139 yp = p.y(); |
140 } | 140 } |
141 | 141 |
142 bool isNull() //const | 142 bool isNull() const |
143 { | 143 { |
144 return qIsNull(xp) && qIsNull(yp); | 144 return qIsNull(xp) && qIsNull(yp); |
145 } | 145 } |
146 | 146 |
147 qreal x() //const | 147 qreal x() const |
148 { | 148 { |
149 return xp; | 149 return xp; |
150 } | 150 } |
151 | 151 |
152 qreal y() //const | 152 qreal y() const |
153 { | 153 { |
154 return yp; | 154 return yp; |
155 } | 155 } |
156 | 156 |
157 void x(qreal xpos) | 157 void x(qreal xpos) |
162 void y(qreal ypos) | 162 void y(qreal ypos) |
163 { | 163 { |
164 yp = ypos; | 164 yp = ypos; |
165 } | 165 } |
166 /* | 166 /* |
167 inline qreal &QPointF::rx() | 167 ref qreal rx() |
168 { | 168 { |
169 return xp; | 169 return xp; |
170 } | 170 } |
171 | 171 |
172 inline qreal &QPointF::ry() | 172 ref qreal ry() |
173 { | 173 { |
174 return yp; | 174 return yp; |
175 } | 175 } |
176 */ | 176 */ |
177 | 177 |
206 QPointF opDiv(qreal c) | 206 QPointF opDiv(qreal c) |
207 { | 207 { |
208 return QPointF(xp/c, yp/c); | 208 return QPointF(xp/c, yp/c); |
209 } | 209 } |
210 | 210 |
211 QPoint toPoint() //const | 211 QPoint toPoint() const |
212 { | 212 { |
213 return QPoint(qRound(xp), qRound(yp)); | 213 return QPoint(qRound(xp), qRound(yp)); |
214 } | 214 } |
215 | 215 |
216 public final void writeTo(QDataStream arg__1) { | 216 public final void writeTo(QDataStream arg__1) { |