1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the demonstration applications of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:BSD$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** BSD License Usage |
18 | ** Alternatively, you may use this file under the terms of the BSD license |
19 | ** as follows: |
20 | ** |
21 | ** "Redistribution and use in source and binary forms, with or without |
22 | ** modification, are permitted provided that the following conditions are |
23 | ** met: |
24 | ** * Redistributions of source code must retain the above copyright |
25 | ** notice, this list of conditions and the following disclaimer. |
26 | ** * Redistributions in binary form must reproduce the above copyright |
27 | ** notice, this list of conditions and the following disclaimer in |
28 | ** the documentation and/or other materials provided with the |
29 | ** distribution. |
30 | ** * Neither the name of The Qt Company Ltd nor the names of its |
31 | ** contributors may be used to endorse or promote products derived |
32 | ** from this software without specific prior written permission. |
33 | ** |
34 | ** |
35 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
36 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
37 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
38 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
39 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
40 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
41 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
42 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
43 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
44 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
45 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." |
46 | ** |
47 | ** $QT_END_LICENSE$ |
48 | ** |
49 | ****************************************************************************/ |
50 | |
51 | #include "xform.h" |
52 | #include "hoverpoints.h" |
53 | |
54 | #include <QLayout> |
55 | #include <QPainter> |
56 | #include <QPainterPath> |
57 | |
58 | const int alpha = 155; |
59 | |
60 | XFormView::XFormView(QWidget *parent) |
61 | : ArthurFrame(parent) |
62 | { |
63 | setAttribute(Qt::WA_MouseTracking); |
64 | m_type = VectorType; |
65 | m_rotation = 0.0; |
66 | m_scale = 1.0; |
67 | m_shear = 0.0; |
68 | |
69 | m_pixmap = QPixmap(":res/affine/bg1.jpg" ); |
70 | pts = new HoverPoints(this, HoverPoints::CircleShape); |
71 | pts->setConnectionType(HoverPoints::LineConnection); |
72 | pts->setEditable(false); |
73 | pts->setPointSize(QSize(15, 15)); |
74 | pts->setShapeBrush(QBrush(QColor(151, 0, 0, alpha))); |
75 | pts->setShapePen(QPen(QColor(255, 100, 50, alpha))); |
76 | pts->setConnectionPen(QPen(QColor(151, 0, 0, 50))); |
77 | pts->setBoundingRect(QRectF(0, 0, 500, 500)); |
78 | ctrlPoints << QPointF(250, 250) << QPointF(350, 250); |
79 | pts->setPoints(ctrlPoints); |
80 | connect(sender: pts, signal: &HoverPoints::pointsChanged, |
81 | receiver: this,slot: &XFormView::updateCtrlPoints); |
82 | setSizePolicy(hor: QSizePolicy::Expanding, ver: QSizePolicy::Expanding); |
83 | } |
84 | |
85 | XFormView::XFormType XFormView::type() const |
86 | { |
87 | return m_type; |
88 | } |
89 | |
90 | QPixmap XFormView::pixmap() const |
91 | { |
92 | return m_pixmap; |
93 | } |
94 | |
95 | QString XFormView::text() const |
96 | { |
97 | return m_text; |
98 | } |
99 | |
100 | void XFormView::setText(const QString &t) |
101 | { |
102 | m_text = t; |
103 | update(); |
104 | } |
105 | |
106 | void XFormView::setPixmap(const QPixmap &p) |
107 | { |
108 | m_pixmap = p; |
109 | update(); |
110 | } |
111 | |
112 | void XFormView::setType(XFormType t) |
113 | { |
114 | m_type = t; |
115 | update(); |
116 | } |
117 | |
118 | void XFormView::mousePressEvent(QMouseEvent *) |
119 | { |
120 | setDescriptionEnabled(false); |
121 | } |
122 | |
123 | void XFormView::resizeEvent(QResizeEvent *e) |
124 | { |
125 | pts->setBoundingRect(rect()); |
126 | ArthurFrame::resizeEvent(e); |
127 | } |
128 | |
129 | void XFormView::paint(QPainter *p) |
130 | { |
131 | p->save(); |
132 | p->setRenderHint(hint: QPainter::Antialiasing); |
133 | p->setRenderHint(hint: QPainter::SmoothPixmapTransform); |
134 | switch (m_type) { |
135 | case VectorType: |
136 | drawVectorType(painter: p); |
137 | break; |
138 | case PixmapType: |
139 | drawPixmapType(painter: p); |
140 | break; |
141 | case TextType: |
142 | drawTextType(painter: p); |
143 | break; |
144 | } |
145 | p->restore(); |
146 | } |
147 | |
148 | void XFormView::updateCtrlPoints(const QPolygonF &points) |
149 | { |
150 | QPointF trans = points.at(i: 0) - ctrlPoints.at(i: 0); |
151 | |
152 | if (qAbs(t: points.at(i: 0).x() - points.at(i: 1).x()) < 10 |
153 | && qAbs(t: points.at(i: 0).y() - points.at(i: 1).y()) < 10) |
154 | pts->setPoints(ctrlPoints); |
155 | if (!trans.isNull()) { |
156 | ctrlPoints[0] = points.at(i: 0); |
157 | ctrlPoints[1] += trans; |
158 | pts->setPoints(ctrlPoints); |
159 | } |
160 | ctrlPoints = points; |
161 | |
162 | QLineF line(ctrlPoints.at(i: 0), ctrlPoints.at(i: 1)); |
163 | m_rotation = 360 - QLineF(0, 0, 1, 0).angleTo(l: line); |
164 | if (trans.isNull()) |
165 | emit rotationChanged(rotation: int(m_rotation*10)); |
166 | } |
167 | |
168 | void XFormView::setVectorType() |
169 | { |
170 | m_type = VectorType; |
171 | update(); |
172 | } |
173 | |
174 | void XFormView::setPixmapType() |
175 | { |
176 | m_type = PixmapType; |
177 | update(); |
178 | } |
179 | |
180 | void XFormView::setTextType() |
181 | { |
182 | m_type = TextType; |
183 | update(); |
184 | } |
185 | |
186 | void XFormView::setAnimation(bool animate) |
187 | { |
188 | timer.stop(); |
189 | if (animate) |
190 | timer.start(msec: 25, obj: this); |
191 | } |
192 | |
193 | void XFormView::changeRotation(int r) |
194 | { |
195 | setRotation(qreal(r) / 10); |
196 | } |
197 | |
198 | void XFormView::changeScale(int s) |
199 | { |
200 | setScale(qreal(s) / 1000); |
201 | } |
202 | |
203 | void XFormView::changeShear(int s) |
204 | { |
205 | setShear(qreal(s) / 1000); |
206 | } |
207 | |
208 | void XFormView::setShear(qreal s) |
209 | { |
210 | m_shear = s; |
211 | update(); |
212 | } |
213 | |
214 | void XFormView::setScale(qreal s) |
215 | { |
216 | m_scale = s; |
217 | update(); |
218 | } |
219 | |
220 | void XFormView::setRotation(qreal r) |
221 | { |
222 | qreal old_rot = m_rotation; |
223 | m_rotation = r; |
224 | |
225 | QPointF center(pts->points().at(i: 0)); |
226 | QTransform m; |
227 | m.translate(dx: center.x(), dy: center.y()); |
228 | m.rotate(a: m_rotation - old_rot); |
229 | m.translate(dx: -center.x(), dy: -center.y()); |
230 | pts->setPoints(pts->points() * m); |
231 | |
232 | update(); |
233 | } |
234 | |
235 | void XFormView::timerEvent(QTimerEvent *e) |
236 | { |
237 | if (e->timerId() == timer.timerId()) { |
238 | QPointF center(pts->points().at(i: 0)); |
239 | QTransform m; |
240 | m.translate(dx: center.x(), dy: center.y()); |
241 | m.rotate(a: 0.2); |
242 | m.translate(dx: -center.x(), dy: -center.y()); |
243 | pts->setPoints(pts->points() * m); |
244 | |
245 | setUpdatesEnabled(false); |
246 | static qreal scale_inc = 0.003; |
247 | static qreal shear_inc = -0.001; |
248 | emit scaleChanged(scale: int((m_scale + scale_inc) * 1000)); |
249 | emit shearChanged(shear: int((m_shear + shear_inc) * 1000)); |
250 | if (m_scale >= 4.0 || m_scale <= 0.1) |
251 | scale_inc = -scale_inc; |
252 | if (m_shear >= 1.0 || m_shear <= -1.0) |
253 | shear_inc = -shear_inc; |
254 | setUpdatesEnabled(true); |
255 | |
256 | pts->firePointChange(); |
257 | } |
258 | } |
259 | |
260 | #if QT_CONFIG(wheelevent) |
261 | void XFormView::wheelEvent(QWheelEvent *e) |
262 | { |
263 | m_scale += e->angleDelta().y() / qreal(600); |
264 | m_scale = qMax(a: qreal(0.1), b: qMin(a: qreal(4), b: m_scale)); |
265 | emit scaleChanged(scale: int(m_scale*1000)); |
266 | } |
267 | #endif |
268 | |
269 | void XFormView::reset() |
270 | { |
271 | emit rotationChanged(rotation: 0); |
272 | emit scaleChanged(scale: 1000); |
273 | emit shearChanged(shear: 0); |
274 | ctrlPoints = QPolygonF(); |
275 | ctrlPoints << QPointF(250, 250) << QPointF(350, 250); |
276 | pts->setPoints(ctrlPoints); |
277 | pts->firePointChange(); |
278 | } |
279 | |
280 | void XFormView::drawPixmapType(QPainter *painter) |
281 | { |
282 | QPointF center(m_pixmap.width() / qreal(2), m_pixmap.height() / qreal(2)); |
283 | painter->translate(offset: ctrlPoints.at(i: 0) - center); |
284 | |
285 | painter->translate(offset: center); |
286 | painter->rotate(a: m_rotation); |
287 | painter->scale(sx: m_scale, sy: m_scale); |
288 | painter->shear(sh: 0, sv: m_shear); |
289 | painter->translate(offset: -center); |
290 | |
291 | painter->drawPixmap(p: QPointF(0, 0), pm: m_pixmap); |
292 | painter->setPen(QPen(QColor(255, 0, 0, alpha), 0.25, Qt::SolidLine, Qt::FlatCap, Qt::BevelJoin)); |
293 | painter->setBrush(Qt::NoBrush); |
294 | painter->drawRect(rect: QRectF(0, 0, m_pixmap.width(), m_pixmap.height()).adjusted(xp1: -2, yp1: -2, xp2: 2, yp2: 2)); |
295 | } |
296 | |
297 | void XFormView::drawTextType(QPainter *painter) |
298 | { |
299 | QPainterPath path; |
300 | QFont f("times new roman,utopia" ); |
301 | f.setStyleStrategy(QFont::ForceOutline); |
302 | f.setPointSize(72); |
303 | f.setStyleHint(QFont::Times); |
304 | path.addText(x: 0, y: 0, f, text: m_text); |
305 | |
306 | QFontMetrics fm(f); |
307 | QRectF br(fm.boundingRect(text: m_text)); |
308 | QPointF center(br.center()); |
309 | painter->translate(offset: ctrlPoints.at(i: 0) - center); |
310 | |
311 | painter->translate(offset: center); |
312 | painter->rotate(a: m_rotation); |
313 | painter->scale(sx: m_scale, sy: m_scale); |
314 | painter->shear(sh: 0, sv: m_shear); |
315 | painter->translate(offset: -center); |
316 | |
317 | painter->fillPath(path, brush: Qt::black); |
318 | |
319 | painter->setPen(QPen(QColor(255, 0, 0, alpha), 0.25, Qt::SolidLine, Qt::FlatCap, Qt::BevelJoin)); |
320 | painter->setBrush(Qt::NoBrush); |
321 | painter->drawRect(rect: br.adjusted(xp1: -1, yp1: -1, xp2: 1, yp2: 1)); |
322 | } |
323 | |
324 | void XFormView::drawVectorType(QPainter *painter) |
325 | { |
326 | QPainterPath path; |
327 | painter->translate(offset: ctrlPoints.at(i: 0) - QPointF(250,250)); |
328 | |
329 | painter->scale(sx: 0.77, sy: 0.77); |
330 | painter->translate(dx: 98.9154 + 30 , dy: -217.691 - 20); |
331 | |
332 | QRect br(-55, 275, 500, 590); |
333 | QPoint center = br.center(); |
334 | painter->translate(dx: center.x(), dy: center.y()); |
335 | painter->rotate(a: m_rotation); |
336 | painter->scale(sx: m_scale, sy: m_scale); |
337 | painter->shear(sh: 0, sv: m_shear); |
338 | painter->translate(dx: -center.x(), dy: -center.y()); |
339 | |
340 | painter->setPen(Qt::NoPen); |
341 | path.moveTo(x: 120, y: 470); |
342 | path.lineTo(x: 60+245, y: 470); |
343 | path.lineTo(x: 60+245, y: 470+350); |
344 | path.lineTo(x: 60, y: 470+350); |
345 | path.lineTo(x: 60, y: 470+80); |
346 | |
347 | painter->setBrush(Qt::white); |
348 | painter->drawPath(path); |
349 | path = QPainterPath(); |
350 | |
351 | painter->setBrush(QColor( 193, 193, 191, 255)); |
352 | path.moveTo(x: 329.336, y: 727.552); |
353 | path.cubicTo(ctrlPt1: QPointF(315.224, 726.328), ctrlPt2: QPointF(304.136, 715.816), endPt: QPointF(303.128, 694.936)); |
354 | path.cubicTo(ctrlPt1: QPointF(306.368, 639.496), ctrlPt2: QPointF(309.608, 582.112), endPt: QPointF(271.232, 545.104)); |
355 | path.cubicTo(ctrlPt1: QPointF(265.256, 499.024), ctrlPt2: QPointF(244.016, 482.104), endPt: QPointF(234.008, 452.512)); |
356 | path.lineTo(x: 218.24, y: 441.208); |
357 | path.lineTo(x: 237.104, y: 411.688); |
358 | path.lineTo(x: 245.168, y: 411.904); |
359 | path.lineTo(x: 323.936, y: 571.168); |
360 | path.lineTo(x: 340.424, y: 651.448); |
361 | path.closeSubpath(); |
362 | painter->drawPath(path); |
363 | path = QPainterPath(); |
364 | |
365 | painter->setBrush(QColor(193, 193, 191, 255)); |
366 | path.moveTo(x: 136.232, y: 439.696); |
367 | path.cubicTo(ctrlPt1: QPointF(133.856, 455.248), ctrlPt2: QPointF(132.56, 470.512), endPt: QPointF(134.792, 485.272)); |
368 | path.cubicTo(ctrlPt1: QPointF(118.376, 507.592), ctrlPt2: QPointF(105.92, 530.128), endPt: QPointF(104.48, 553.312)); |
369 | path.cubicTo(ctrlPt1: QPointF(92.024, 586.504), ctrlPt2: QPointF(62.432, 614.584), endPt: QPointF(67.544, 680.104)); |
370 | path.cubicTo(ctrlPt1: QPointF(84.176, 697.456), ctrlPt2: QPointF(107.432, 713.584), endPt: QPointF(127.376, 730.36)); |
371 | path.cubicTo(ctrlPt1: QPointF(152.432, 751.312), ctrlPt2: QPointF(137.528, 778.96), endPt: QPointF(102.248, 772.408)); |
372 | path.cubicTo(ctrlPt1: QPointF(94.4, 763.768), ctrlPt2: QPointF(76.616, 709.624), endPt: QPointF(42.92, 676.288)); |
373 | path.lineTo(x: 49.544, y: 632.584); |
374 | path.lineTo(x: 81.368, y: 547.408); |
375 | path.lineTo(x: 120.968, y: 484.048); |
376 | path.lineTo(x: 125.36, y: 456.688); |
377 | path.lineTo(x: 119.816, y: 386.776); |
378 | path.lineTo(x: 124.424, y: 361.216); |
379 | path.lineTo(x: 136.232, y: 439.696); |
380 | path.closeSubpath(); |
381 | painter->drawPath(path); |
382 | path = QPainterPath(); |
383 | |
384 | painter->setBrush(QColor(193, 193, 191, 255)); |
385 | path.moveTo(x: 115.64, y: 341.416); |
386 | path.cubicTo(ctrlPt1: QPointF(116.576, 336.376), ctrlPt2: QPointF(117.8, 331.624), endPt: QPointF(119.312, 327.16)); |
387 | path.lineTo(x: 121.688, y: 342.784); |
388 | path.closeSubpath(); |
389 | painter->drawPath(path); |
390 | path = QPainterPath(); |
391 | |
392 | painter->setBrush(QColor(193, 193, 191, 255)); |
393 | path.moveTo(x: 120.968, y: 500.464); |
394 | path.cubicTo(ctrlPt1: QPointF(108.368, 523.792), ctrlPt2: QPointF(103.976, 546.256), endPt: QPointF(132.92, 550.216)); |
395 | path.cubicTo(ctrlPt1: QPointF(117.008, 553.888), ctrlPt2: QPointF(97.208, 568.648), endPt: QPointF(77.192, 593.488)); |
396 | path.lineTo(x: 77.624, y: 543.016); |
397 | path.lineTo(x: 101.456, y: 503.272); |
398 | path.closeSubpath(); |
399 | painter->drawPath(path); |
400 | path = QPainterPath(); |
401 | |
402 | painter->setBrush(QColor(193, 193, 191, 255)); |
403 | path.moveTo(x: -33.256, y: 818.488); |
404 | path.cubicTo(ctrlPt1: QPointF(10.52, 838.144), ctrlPt2: QPointF(41.408, 837.064), endPt: QPointF(69.272, 850.96)); |
405 | path.cubicTo(ctrlPt1: QPointF(91.304, 862.552), ctrlPt2: QPointF(113.552, 861.184), endPt: QPointF(126.944, 847.144)); |
406 | path.cubicTo(ctrlPt1: QPointF(138.32, 832.456), ctrlPt2: QPointF(146.744, 831.736), endPt: QPointF(163.52, 830.224)); |
407 | path.cubicTo(ctrlPt1: QPointF(190.952, 828.568), ctrlPt2: QPointF(217.736, 828.28), endPt: QPointF(241.928, 830.8)); |
408 | path.lineTo(x: 269.576, y: 833.032); |
409 | path.cubicTo(ctrlPt1: QPointF(269.072, 864.064), ctrlPt2: QPointF(328.04, 867.88), endPt: QPointF(345.392, 844.336)); |
410 | path.cubicTo(ctrlPt1: QPointF(366.344, 819.424), ctrlPt2: QPointF(395.144, 808.264), endPt: QPointF(419.84, 790.192)); |
411 | path.lineTo(x: 289.304, y: 725.536); |
412 | path.cubicTo(ctrlPt1: QPointF(255.824, 806.464), ctrlPt2: QPointF(131.048, 827.632), endPt: QPointF(113.768, 763.264)); |
413 | path.closeSubpath(); |
414 | painter->drawPath(path); |
415 | path = QPainterPath(); |
416 | |
417 | painter->setBrush(QColor(193, 193, 191, 255)); |
418 | path.moveTo(x: 286.424, y: 711.568); |
419 | path.cubicTo(ctrlPt1: QPointF(273.824, 711.496), ctrlPt2: QPointF(260.936, 715.6), endPt: QPointF(261.944, 732.16)); |
420 | path.lineTo(x: 266.192, y: 776.44); |
421 | path.lineTo(x: 304.424, y: 756.64); |
422 | path.closeSubpath(); |
423 | painter->drawPath(path); |
424 | path = QPainterPath(); |
425 | |
426 | painter->setBrush(QColor(0, 0, 0, 255)); |
427 | path.moveTo(x: -37.36, y: 821.224); |
428 | path.cubicTo(ctrlPt1: QPointF(7.136, 840.88), ctrlPt2: QPointF(38.6, 839.728), endPt: QPointF(66.968, 853.696)); |
429 | path.cubicTo(ctrlPt1: QPointF(89.36, 865.216), ctrlPt2: QPointF(111.968, 863.92), endPt: QPointF(125.648, 849.808)); |
430 | path.cubicTo(ctrlPt1: QPointF(137.24, 835.192), ctrlPt2: QPointF(145.808, 834.472), endPt: QPointF(162.872, 832.96)); |
431 | path.cubicTo(ctrlPt1: QPointF(190.736, 831.232), ctrlPt2: QPointF(218.024, 831.016), endPt: QPointF(242.648, 833.464)); |
432 | path.lineTo(x: 270.728, y: 835.768); |
433 | path.cubicTo(ctrlPt1: QPointF(270.224, 866.8), ctrlPt2: QPointF(330.272, 870.544), endPt: QPointF(347.912, 847)); |
434 | path.cubicTo(ctrlPt1: QPointF(369.224, 822.088), ctrlPt2: QPointF(398.528, 811), endPt: QPointF(423.656, 792.856)); |
435 | path.lineTo(x: 290.816, y: 728.272); |
436 | path.cubicTo(ctrlPt1: QPointF(256.76, 809.128), ctrlPt2: QPointF(129.824, 830.296), endPt: QPointF(112.256, 766)); |
437 | path.closeSubpath(); |
438 | painter->drawPath(path); |
439 | path = QPainterPath(); |
440 | |
441 | painter->setBrush(QColor(183, 114, 0, 255)); |
442 | path.moveTo(x: 382.328, y: 691.984); |
443 | path.cubicTo(ctrlPt1: QPointF(403.64, 698.968), ctrlPt2: QPointF(389.888, 720.28), endPt: QPointF(400.76, 732.52)); |
444 | path.cubicTo(ctrlPt1: QPointF(405.44, 742.888), ctrlPt2: QPointF(415.304, 752.032), endPt: QPointF(431.792, 760.528)); |
445 | path.cubicTo(ctrlPt1: QPointF(459.368, 774.424), ctrlPt2: QPointF(426.248, 799.336), endPt: QPointF(392.768, 812.08)); |
446 | path.cubicTo(ctrlPt1: QPointF(351.944, 825.616), ctrlPt2: QPointF(344.024, 862.912), endPt: QPointF(299.312, 851.896)); |
447 | path.cubicTo(ctrlPt1: QPointF(283.112, 846.496), ctrlPt2: QPointF(278.36, 831.808), endPt: QPointF(278.864, 809.128)); |
448 | path.cubicTo(ctrlPt1: QPointF(284.264, 762.76), ctrlPt2: QPointF(277.784, 730.432), endPt: QPointF(278.792, 698.824)); |
449 | path.cubicTo(ctrlPt1: QPointF(278.72, 686.152), ctrlPt2: QPointF(283.544, 684.64), endPt: QPointF(307.232, 687.952)); |
450 | path.cubicTo(ctrlPt1: QPointF(310.04, 726.328), ctrlPt2: QPointF(352.376, 727.336), endPt: QPointF(382.328, 691.984)); |
451 | path.closeSubpath(); |
452 | painter->drawPath(path); |
453 | path = QPainterPath(); |
454 | |
455 | painter->setBrush(QColor(242, 183, 0, 255)); |
456 | path.moveTo(x: 339.632, y: 826.624); |
457 | path.cubicTo(ctrlPt1: QPointF(371.6, 814.312), ctrlPt2: QPointF(403.856, 798.112), endPt: QPointF(429.848, 782.128)); |
458 | path.cubicTo(ctrlPt1: QPointF(437.84, 777.448), ctrlPt2: QPointF(438.92, 765.928), endPt: QPointF(427.688, 762.328)); |
459 | path.cubicTo(ctrlPt1: QPointF(403.352, 748.504), ctrlPt2: QPointF(390.104, 731.224), endPt: QPointF(392.912, 708.76)); |
460 | path.cubicTo(ctrlPt1: QPointF(393.344, 700.912), ctrlPt2: QPointF(383.696, 692.56), endPt: QPointF(381.104, 700.048)); |
461 | path.cubicTo(ctrlPt1: QPointF(359.864, 771.472), ctrlPt2: QPointF(291.32, 767.656), endPt: QPointF(300.752, 696.952)); |
462 | path.cubicTo(ctrlPt1: QPointF(301.256, 694.864), ctrlPt2: QPointF(301.76, 692.776), endPt: QPointF(302.264, 690.76)); |
463 | path.cubicTo(ctrlPt1: QPointF(289.952, 688.24), ctrlPt2: QPointF(285.2, 690.976), endPt: QPointF(285.776, 700.408)); |
464 | path.lineTo(x: 295.28, y: 806.608); |
465 | path.cubicTo(ctrlPt1: QPointF(297.656, 830.8), ctrlPt2: QPointF(317.312, 836.128), endPt: QPointF(339.632, 826.624)); |
466 | path.closeSubpath(); |
467 | painter->drawPath(path); |
468 | path = QPainterPath(); |
469 | |
470 | painter->setBrush(QColor(0, 0, 0, 255)); |
471 | path.moveTo(x: 354.464, y: 537.544); |
472 | path.cubicTo(ctrlPt1: QPointF(379.16, 569.8), ctrlPt2: QPointF(404.432, 651.088), endPt: QPointF(384.416, 691.552)); |
473 | path.cubicTo(ctrlPt1: QPointF(360.944, 737.776), ctrlPt2: QPointF(307.808, 743.248), endPt: QPointF(305.504, 695.8)); |
474 | path.cubicTo(ctrlPt1: QPointF(308.816, 639.64), ctrlPt2: QPointF(311.984, 581.536), endPt: QPointF(273.68, 544.096)); |
475 | path.cubicTo(ctrlPt1: QPointF(267.704, 497.368), ctrlPt2: QPointF(246.392, 480.232), endPt: QPointF(236.384, 450.28)); |
476 | path.lineTo(x: 203.12, y: 426.088); |
477 | path.lineTo(x: 133.568, y: 435.088); |
478 | path.cubicTo(ctrlPt1: QPointF(130.76, 452.152), ctrlPt2: QPointF(129.104, 468.784), endPt: QPointF(131.552, 484.912)); |
479 | path.cubicTo(ctrlPt1: QPointF(115.064, 507.376), ctrlPt2: QPointF(102.608, 530.056), endPt: QPointF(101.168, 553.312)); |
480 | path.cubicTo(ctrlPt1: QPointF(88.712, 586.648), ctrlPt2: QPointF(59.12, 614.944), endPt: QPointF(64.232, 680.752)); |
481 | path.cubicTo(ctrlPt1: QPointF(80.864, 698.248), ctrlPt2: QPointF(104.12, 714.448), endPt: QPointF(124.064, 731.296)); |
482 | path.cubicTo(ctrlPt1: QPointF(149.12, 752.392), ctrlPt2: QPointF(135.512, 776.296), endPt: QPointF(100.232, 769.672)); |
483 | path.cubicTo(ctrlPt1: QPointF(78.848, 746.056), ctrlPt2: QPointF(56.744, 722.872), endPt: QPointF(35.288, 699.328)); |
484 | path.cubicTo(ctrlPt1: QPointF(12.392, 683.056), ctrlPt2: QPointF(3.896, 662.176), endPt: QPointF(27.368, 630.496)); |
485 | path.cubicTo(ctrlPt1: QPointF(43.424, 609.04), ctrlPt2: QPointF(47.96, 562.456), endPt: QPointF(62, 543.664)); |
486 | path.cubicTo(ctrlPt1: QPointF(74.312, 525.16), ctrlPt2: QPointF(92.24, 508.6), endPt: QPointF(105.272, 490.096)); |
487 | path.cubicTo(ctrlPt1: QPointF(112.184, 477.928), ctrlPt2: QPointF(114.344, 468.568), endPt: QPointF(113.264, 454.456)); |
488 | path.lineTo(x: 110.312, y: 369.136); |
489 | path.cubicTo(ctrlPt1: QPointF(108.368, 307.216), ctrlPt2: QPointF(142.424, 274.24), endPt: QPointF(189.8, 275.248)); |
490 | path.cubicTo(ctrlPt1: QPointF(243.512, 275.752), ctrlPt2: QPointF(287.576, 312.472), endPt: QPointF(288.152, 378.28)); |
491 | path.cubicTo(ctrlPt1: QPointF(292.688, 410.32), ctrlPt2: QPointF(283.256, 428.68), endPt: QPointF(308.672, 474.472)); |
492 | path.cubicTo(ctrlPt1: QPointF(334.52, 522.712), ctrlPt2: QPointF(338.552, 520.12), endPt: QPointF(354.464, 537.544)); |
493 | path.closeSubpath(); |
494 | painter->drawPath(path); |
495 | path = QPainterPath(); |
496 | |
497 | painter->setBrush(QColor(193, 193, 191, 255)); |
498 | path.moveTo(x: 261.296, y: 503.632); |
499 | path.lineTo(x: 263.528, y: 512.2); |
500 | path.cubicTo(ctrlPt1: QPointF(257.696, 501.688), ctrlPt2: QPointF(250.712, 483.616), endPt: QPointF(241.928, 475.696)); |
501 | path.cubicTo(ctrlPt1: QPointF(239.264, 473.536), ctrlPt2: QPointF(235.808, 473.608), endPt: QPointF(233.72, 475.624)); |
502 | path.cubicTo(ctrlPt1: QPointF(222.056, 486.928), ctrlPt2: QPointF(193.112, 510.112), endPt: QPointF(169.928, 507.088)); |
503 | path.cubicTo(ctrlPt1: QPointF(152.072, 505.288), ctrlPt2: QPointF(134.648, 493.264), endPt: QPointF(130.832, 480.232)); |
504 | path.cubicTo(ctrlPt1: QPointF(128.816, 470.872), ctrlPt2: QPointF(129.752, 463.168), endPt: QPointF(130.976, 455.32)); |
505 | path.lineTo(x: 240.704, y: 453.52); |
506 | path.cubicTo(ctrlPt1: QPointF(238.472, 463.168), ctrlPt2: QPointF(253.088, 487), endPt: QPointF(261.296, 503.632)); |
507 | path.closeSubpath(); |
508 | painter->drawPath(path); |
509 | path = QPainterPath(); |
510 | |
511 | painter->setBrush(QColor(193, 193, 191, 255)); |
512 | path.moveTo(x: 143.144, y: 363.232); |
513 | path.cubicTo(ctrlPt1: QPointF(154.088, 363.232), ctrlPt2: QPointF(163.88, 376.84), endPt: QPointF(163.808, 395.632)); |
514 | path.cubicTo(ctrlPt1: QPointF(163.736, 408.232), ctrlPt2: QPointF(155.528, 411.472), endPt: QPointF(149.336, 417.016)); |
515 | path.cubicTo(ctrlPt1: QPointF(146.6, 419.536), ctrlPt2: QPointF(145.952, 433.144), endPt: QPointF(142.568, 433.144)); |
516 | path.cubicTo(ctrlPt1: QPointF(131.696, 433.144), ctrlPt2: QPointF(123.488, 413.776), endPt: QPointF(123.488, 395.632)); |
517 | path.cubicTo(ctrlPt1: QPointF(123.488, 377.56), ctrlPt2: QPointF(132.272, 363.232), endPt: QPointF(143.144, 363.232)); |
518 | path.closeSubpath(); |
519 | painter->drawPath(path); |
520 | path = QPainterPath(); |
521 | |
522 | painter->setBrush(QColor(255, 255, 255, 255)); |
523 | path.moveTo(x: 144.368, y: 375.04); |
524 | path.cubicTo(ctrlPt1: QPointF(154.088, 375.04), ctrlPt2: QPointF(160.856, 379.936), endPt: QPointF(161.648, 391.312)); |
525 | path.cubicTo(ctrlPt1: QPointF(162.224, 399.16), ctrlPt2: QPointF(160.136, 411.76), endPt: QPointF(154.664, 414.424)); |
526 | path.cubicTo(ctrlPt1: QPointF(152.144, 415.648), ctrlPt2: QPointF(143.432, 426.664), endPt: QPointF(140.408, 426.52)); |
527 | path.cubicTo(ctrlPt1: QPointF(128.096, 425.944), ctrlPt2: QPointF(125, 402.112), endPt: QPointF(125.936, 390.736)); |
528 | path.cubicTo(ctrlPt1: QPointF(126.8, 379.36), ctrlPt2: QPointF(134.72, 375.04), endPt: QPointF(144.368, 375.04)); |
529 | path.closeSubpath(); |
530 | painter->drawPath(path); |
531 | path = QPainterPath(); |
532 | |
533 | painter->setBrush(QColor(0, 0, 0, 255)); |
534 | path.moveTo(x: 141.848, y: 382.672); |
535 | path.cubicTo(ctrlPt1: QPointF(148.544, 382.096), ctrlPt2: QPointF(154.736, 389.728), endPt: QPointF(155.6, 399.664)); |
536 | path.cubicTo(ctrlPt1: QPointF(156.464, 409.6), ctrlPt2: QPointF(151.64, 418.24), endPt: QPointF(144.944, 418.816)); |
537 | path.cubicTo(ctrlPt1: QPointF(138.248, 419.392), ctrlPt2: QPointF(132.056, 411.76), endPt: QPointF(131.192, 401.752)); |
538 | path.cubicTo(ctrlPt1: QPointF(130.328, 391.816), ctrlPt2: QPointF(135.152, 383.248), endPt: QPointF(141.848, 382.672)); |
539 | path.closeSubpath(); |
540 | painter->drawPath(path); |
541 | path = QPainterPath(); |
542 | |
543 | painter->setBrush(QColor(193, 193, 191, 255)); |
544 | path.moveTo(x: 151.064, y: 397.288); |
545 | path.cubicTo(ctrlPt1: QPointF(151.424, 399.088), ctrlPt2: QPointF(149.408, 400.024), endPt: QPointF(148.832, 398.224)); |
546 | path.cubicTo(ctrlPt1: QPointF(148.256, 395.992), ctrlPt2: QPointF(146.888, 393.328), endPt: QPointF(145.088, 391.168)); |
547 | path.cubicTo(ctrlPt1: QPointF(143.936, 389.872), ctrlPt2: QPointF(145.088, 388.432), endPt: QPointF(146.528, 389.44)); |
548 | path.cubicTo(ctrlPt1: QPointF(149.048, 391.528), ctrlPt2: QPointF(150.488, 394.12), endPt: QPointF(151.064, 397.288)); |
549 | path.closeSubpath(); |
550 | painter->drawPath(path); |
551 | path = QPainterPath(); |
552 | |
553 | painter->setBrush(QColor(193, 193, 191, 255)); |
554 | path.moveTo(x: 216.944, y: 360.712); |
555 | path.cubicTo(ctrlPt1: QPointF(232.712, 360.712), ctrlPt2: QPointF(245.6, 377.416), endPt: QPointF(245.6, 397.792)); |
556 | path.cubicTo(ctrlPt1: QPointF(245.6, 418.24), ctrlPt2: QPointF(232.712, 434.872), endPt: QPointF(216.944, 434.872)); |
557 | path.cubicTo(ctrlPt1: QPointF(201.176, 434.872), ctrlPt2: QPointF(188.432, 418.24), endPt: QPointF(188.432, 397.792)); |
558 | path.cubicTo(ctrlPt1: QPointF(188.432, 377.416), ctrlPt2: QPointF(201.176, 360.712), endPt: QPointF(216.944, 360.712)); |
559 | path.closeSubpath(); |
560 | painter->drawPath(path); |
561 | path = QPainterPath(); |
562 | |
563 | painter->setBrush(QColor(255, 255, 255, 255)); |
564 | path.moveTo(x: 224.792, y: 374.968); |
565 | path.cubicTo(ctrlPt1: QPointF(235.664, 378.856), ctrlPt2: QPointF(241.928, 387.424), endPt: QPointF(242.72, 396.568)); |
566 | path.cubicTo(ctrlPt1: QPointF(243.656, 407.08), ctrlPt2: QPointF(239.408, 418.96), endPt: QPointF(230.264, 425.944)); |
567 | path.cubicTo(ctrlPt1: QPointF(227.672, 427.888), ctrlPt2: QPointF(197.72, 416.08), endPt: QPointF(195.992, 411.616)); |
568 | path.cubicTo(ctrlPt1: QPointF(193.4, 405.208), ctrlPt2: QPointF(191.816, 392.896), endPt: QPointF(193.76, 385.624)); |
569 | path.cubicTo(ctrlPt1: QPointF(194.552, 382.744), ctrlPt2: QPointF(197.216, 378.568), endPt: QPointF(201.176, 376.336)); |
570 | path.cubicTo(ctrlPt1: QPointF(207.44, 372.808), ctrlPt2: QPointF(216.656, 372.088), endPt: QPointF(224.792, 374.968)); |
571 | path.closeSubpath(); |
572 | painter->drawPath(path); |
573 | path = QPainterPath(); |
574 | |
575 | painter->setBrush(QColor(0, 0, 0, 255)); |
576 | path.moveTo(x: 216.872, y: 380.944); |
577 | path.cubicTo(ctrlPt1: QPointF(225.584, 380.944), ctrlPt2: QPointF(232.712, 389.296), endPt: QPointF(232.712, 399.448)); |
578 | path.cubicTo(ctrlPt1: QPointF(232.712, 409.672), ctrlPt2: QPointF(225.584, 418.024), endPt: QPointF(216.872, 418.024)); |
579 | path.cubicTo(ctrlPt1: QPointF(208.16, 418.024), ctrlPt2: QPointF(201.032, 409.672), endPt: QPointF(201.032, 399.448)); |
580 | path.cubicTo(ctrlPt1: QPointF(201.032, 389.296), ctrlPt2: QPointF(208.16, 380.944), endPt: QPointF(216.872, 380.944)); |
581 | path.closeSubpath(); |
582 | painter->drawPath(path); |
583 | path = QPainterPath(); |
584 | |
585 | painter->setBrush(QColor(193, 193, 191, 255)); |
586 | path.moveTo(x: 227.096, y: 392.392); |
587 | path.cubicTo(ctrlPt1: QPointF(228.104, 394.048), ctrlPt2: QPointF(226.448, 395.776), endPt: QPointF(225.224, 394.12)); |
588 | path.cubicTo(ctrlPt1: QPointF(223.784, 392.104), ctrlPt2: QPointF(221.408, 389.944), endPt: QPointF(218.888, 388.432)); |
589 | path.cubicTo(ctrlPt1: QPointF(217.232, 387.568), ctrlPt2: QPointF(217.808, 385.624), endPt: QPointF(219.68, 386.2)); |
590 | path.cubicTo(ctrlPt1: QPointF(222.92, 387.28), ctrlPt2: QPointF(225.368, 389.368), endPt: QPointF(227.096, 392.392)); |
591 | path.closeSubpath(); |
592 | painter->drawPath(path); |
593 | path = QPainterPath(); |
594 | |
595 | painter->setBrush(QColor(183, 114, 0, 255)); |
596 | path.moveTo(x: 164.96, y: 404.488); |
597 | path.cubicTo(ctrlPt1: QPointF(172.376, 402.328), ctrlPt2: QPointF(184.112, 403.048), endPt: QPointF(192.248, 404.632)); |
598 | path.cubicTo(ctrlPt1: QPointF(200.384, 406.792), ctrlPt2: QPointF(222.056, 418.24), endPt: QPointF(245.024, 430.696)); |
599 | path.cubicTo(ctrlPt1: QPointF(247.976, 432.208), ctrlPt2: QPointF(248.84, 437.104), endPt: QPointF(245.024, 438.688)); |
600 | path.cubicTo(ctrlPt1: QPointF(239.12, 439.12), ctrlPt2: QPointF(249.272, 453.664), endPt: QPointF(238.904, 458.848)); |
601 | path.cubicTo(ctrlPt1: QPointF(223.352, 462.88), ctrlPt2: QPointF(198.44, 485.992), endPt: QPointF(186.128, 487.864)); |
602 | path.cubicTo(ctrlPt1: QPointF(179.288, 489.376), ctrlPt2: QPointF(172.232, 489.592), endPt: QPointF(164.6, 487.864)); |
603 | path.cubicTo(ctrlPt1: QPointF(140.552, 482.968), ctrlPt2: QPointF(134.216, 455.608), endPt: QPointF(122.912, 450.064)); |
604 | path.cubicTo(ctrlPt1: QPointF(119.816, 446.824), ctrlPt2: QPointF(121.4, 441.208), endPt: QPointF(122.408, 440.056)); |
605 | path.cubicTo(ctrlPt1: QPointF(123.632, 434.224), ctrlPt2: QPointF(149.696, 406.216), endPt: QPointF(164.96, 404.488)); |
606 | path.closeSubpath(); |
607 | painter->drawPath(path); |
608 | path = QPainterPath(); |
609 | |
610 | painter->setBrush(QColor(242, 183, 0, 255)); |
611 | path.moveTo(x: 185.408, y: 405.856); |
612 | path.cubicTo(ctrlPt1: QPointF(198.44, 407.296), ctrlPt2: QPointF(226.088, 423.928), endPt: QPointF(239.408, 430.624)); |
613 | path.cubicTo(ctrlPt1: QPointF(242.72, 432.424), ctrlPt2: QPointF(242.504, 437.824), endPt: QPointF(239.552, 438.688)); |
614 | path.cubicTo(ctrlPt1: QPointF(236.384, 440.488), ctrlPt2: QPointF(235.448, 438.256), endPt: QPointF(232.928, 437.896)); |
615 | path.cubicTo(ctrlPt1: QPointF(228.896, 435.736), ctrlPt2: QPointF(222.272, 440.92), endPt: QPointF(217.016, 444.88)); |
616 | path.cubicTo(ctrlPt1: QPointF(186.704, 467.776), ctrlPt2: QPointF(180.656, 465.256), endPt: QPointF(156.176, 462.664)); |
617 | path.cubicTo(ctrlPt1: QPointF(147.68, 460.576), ctrlPt2: QPointF(142.136, 457.984), endPt: QPointF(139.688, 455.968)); |
618 | path.cubicTo(ctrlPt1: QPointF(141.488, 445.888), ctrlPt2: QPointF(160.496, 407.656), endPt: QPointF(166.76, 406.792)); |
619 | path.cubicTo(ctrlPt1: QPointF(168.344, 404.704), ctrlPt2: QPointF(179.936, 404.632), endPt: QPointF(185.408, 405.856)); |
620 | path.closeSubpath(); |
621 | painter->drawPath(path); |
622 | path = QPainterPath(); |
623 | |
624 | painter->setBrush(QColor(183, 114, 0, 255)); |
625 | path.moveTo(x: 190.664, y: 412.048); |
626 | path.lineTo(x: 193.76, y: 413.416); |
627 | path.cubicTo(ctrlPt1: QPointF(196.064, 414.712), ctrlPt2: QPointF(193.256, 418.168), endPt: QPointF(190.736, 417.088)); |
628 | path.lineTo(x: 186.2, y: 415.504); |
629 | path.cubicTo(ctrlPt1: QPointF(183.536, 413.272), ctrlPt2: QPointF(186.704, 410.104), endPt: QPointF(190.664, 412.048)); |
630 | path.closeSubpath(); |
631 | painter->drawPath(path); |
632 | path = QPainterPath(); |
633 | |
634 | painter->setBrush(QColor(193, 193, 191, 255)); |
635 | path.moveTo(x: 268.568, y: 452.368); |
636 | path.cubicTo(ctrlPt1: QPointF(273.032, 454.384), ctrlPt2: QPointF(279.224, 457.192), endPt: QPointF(282.536, 460.144)); |
637 | path.cubicTo(ctrlPt1: QPointF(285.488, 464.104), ctrlPt2: QPointF(286.784, 468.064), endPt: QPointF(286.424, 472.024)); |
638 | path.cubicTo(ctrlPt1: QPointF(285.776, 474.544), ctrlPt2: QPointF(284.12, 476.344), endPt: QPointF(281.24, 477.424)); |
639 | path.cubicTo(ctrlPt1: QPointF(277.856, 478.216), ctrlPt2: QPointF(273.68, 477.424), endPt: QPointF(271.376, 474.112)); |
640 | path.cubicTo(ctrlPt1: QPointF(269.864, 471.448), ctrlPt2: QPointF(265.256, 462.16), endPt: QPointF(263.96, 460.576)); |
641 | path.cubicTo(ctrlPt1: QPointF(262.232, 457.12), ctrlPt2: QPointF(261.944, 454.456), endPt: QPointF(262.88, 452.368)); |
642 | path.cubicTo(ctrlPt1: QPointF(264.032, 451.288), ctrlPt2: QPointF(266.048, 451), endPt: QPointF(268.568, 452.368)); |
643 | path.closeSubpath(); |
644 | painter->drawPath(path); |
645 | path = QPainterPath(); |
646 | |
647 | painter->setBrush(QColor(255, 255, 255, 255)); |
648 | path.moveTo(x: 273.752, y: 461.584); |
649 | path.cubicTo(ctrlPt1: QPointF(275.48, 462.376), ctrlPt2: QPointF(277.928, 463.456), endPt: QPointF(279.224, 464.68)); |
650 | path.cubicTo(ctrlPt1: QPointF(280.376, 466.264), ctrlPt2: QPointF(280.88, 467.776), endPt: QPointF(280.736, 469.36)); |
651 | path.cubicTo(ctrlPt1: QPointF(280.52, 470.296), ctrlPt2: QPointF(279.8, 471.016), endPt: QPointF(278.72, 471.448)); |
652 | path.cubicTo(ctrlPt1: QPointF(277.352, 471.808), ctrlPt2: QPointF(275.768, 471.448), endPt: QPointF(274.832, 470.152)); |
653 | path.cubicTo(ctrlPt1: QPointF(274.256, 469.144), ctrlPt2: QPointF(272.456, 465.472), endPt: QPointF(271.952, 464.824)); |
654 | path.cubicTo(ctrlPt1: QPointF(271.232, 463.456), ctrlPt2: QPointF(271.088, 462.448), endPt: QPointF(271.448, 461.584)); |
655 | path.cubicTo(ctrlPt1: QPointF(271.952, 461.152), ctrlPt2: QPointF(272.744, 461.08), endPt: QPointF(273.752, 461.584)); |
656 | path.closeSubpath(); |
657 | painter->drawPath(path); |
658 | path = QPainterPath(); |
659 | |
660 | painter->setBrush(QColor(193, 193, 191, 255)); |
661 | path.moveTo(x: 238.616, y: 358.552); |
662 | path.cubicTo(ctrlPt1: QPointF(239.048, 359.2), ctrlPt2: QPointF(238.976, 359.776), endPt: QPointF(238.4, 360.28)); |
663 | path.cubicTo(ctrlPt1: QPointF(237.896, 360.784), ctrlPt2: QPointF(237.176, 360.712), endPt: QPointF(236.24, 360.208)); |
664 | path.lineTo(x: 231.632, y: 356.248); |
665 | path.cubicTo(ctrlPt1: QPointF(231.056, 355.744), ctrlPt2: QPointF(230.912, 354.952), endPt: QPointF(231.272, 354.088)); |
666 | path.cubicTo(ctrlPt1: QPointF(232.28, 353.44), ctrlPt2: QPointF(233.144, 353.44), endPt: QPointF(233.936, 354.088)); |
667 | path.closeSubpath(); |
668 | painter->drawPath(path); |
669 | path = QPainterPath(); |
670 | |
671 | painter->setBrush(QColor(193, 193, 191, 255)); |
672 | path.moveTo(x: 235.592, y: 305.992); |
673 | path.cubicTo(ctrlPt1: QPointF(239.624, 308.224), ctrlPt2: QPointF(240.848, 313.912), endPt: QPointF(238.184, 318.592)); |
674 | path.cubicTo(ctrlPt1: QPointF(235.592, 323.2), ctrlPt2: QPointF(230.12, 325.144), endPt: QPointF(226.016, 322.84)); |
675 | path.cubicTo(ctrlPt1: QPointF(221.984, 320.536), ctrlPt2: QPointF(220.76, 314.92), endPt: QPointF(223.424, 310.24)); |
676 | path.cubicTo(ctrlPt1: QPointF(226.016, 305.56), ctrlPt2: QPointF(231.488, 303.688), endPt: QPointF(235.592, 305.992)); |
677 | path.closeSubpath(); |
678 | painter->drawPath(path); |
679 | path = QPainterPath(); |
680 | |
681 | painter->setBrush(QColor(193, 193, 191, 255)); |
682 | path.moveTo(x: 374.912, y: 680.536); |
683 | path.cubicTo(ctrlPt1: QPointF(378.296, 683.128), ctrlPt2: QPointF(373.256, 687.376), endPt: QPointF(371.024, 686.296)); |
684 | path.cubicTo(ctrlPt1: QPointF(369.152, 685.648), ctrlPt2: QPointF(367.784, 683.488), endPt: QPointF(366.92, 682.408)); |
685 | path.cubicTo(ctrlPt1: QPointF(366.128, 681.184), ctrlPt2: QPointF(366.2, 679.168), endPt: QPointF(366.92, 678.448)); |
686 | path.cubicTo(ctrlPt1: QPointF(367.712, 677.44), ctrlPt2: QPointF(369.728, 677.656), endPt: QPointF(371.024, 678.52)); |
687 | path.cubicTo(ctrlPt1: QPointF(372.32, 679.168), ctrlPt2: QPointF(373.616, 679.888), endPt: QPointF(374.912, 680.536)); |
688 | path.closeSubpath(); |
689 | painter->drawPath(path); |
690 | path = QPainterPath(); |
691 | |
692 | painter->setBrush(QColor(193, 193, 191, 255)); |
693 | path.moveTo(x: 297.44, y: 551.512); |
694 | path.cubicTo(ctrlPt1: QPointF(338.984, 572.896), ctrlPt2: QPointF(350, 611.56), endPt: QPointF(332.072, 664.192)); |
695 | path.cubicTo(ctrlPt1: QPointF(330.992, 666.64), ctrlPt2: QPointF(334.16, 668.368), endPt: QPointF(335.24, 666.064)); |
696 | path.cubicTo(ctrlPt1: QPointF(354.824, 610.336), ctrlPt2: QPointF(341.432, 571.312), endPt: QPointF(299.024, 548.56)); |
697 | path.cubicTo(ctrlPt1: QPointF(296.864, 547.552), ctrlPt2: QPointF(295.28, 550.432), endPt: QPointF(297.44, 551.512)); |
698 | path.closeSubpath(); |
699 | painter->drawPath(path); |
700 | path = QPainterPath(); |
701 | |
702 | painter->setBrush(QColor(193, 193, 191, 255)); |
703 | path.moveTo(x: 72.008, y: 569.512); |
704 | path.cubicTo(ctrlPt1: QPointF(38.312, 627.256), ctrlPt2: QPointF(38.096, 662.68), endPt: QPointF(62.504, 681.328)); |
705 | path.cubicTo(ctrlPt1: QPointF(63.728, 682.264), ctrlPt2: QPointF(64.448, 680.032), endPt: QPointF(63.296, 679.168)); |
706 | path.cubicTo(ctrlPt1: QPointF(36.296, 655.48), ctrlPt2: QPointF(48.896, 615.52), endPt: QPointF(74.168, 570.88)); |
707 | path.cubicTo(ctrlPt1: QPointF(74.888, 569.584), ctrlPt2: QPointF(72.512, 568.432), endPt: QPointF(72.008, 569.512)); |
708 | path.closeSubpath(); |
709 | painter->drawPath(path); |
710 | path = QPainterPath(); |
711 | |
712 | painter->setBrush(QColor(193, 193, 191, 255)); |
713 | path.moveTo(x: 289.376, y: 586.864); |
714 | path.cubicTo(ctrlPt1: QPointF(289.232, 589.168), ctrlPt2: QPointF(288.368, 589.528), endPt: QPointF(286.424, 587.368)); |
715 | path.cubicTo(ctrlPt1: QPointF(279.8, 575.848), ctrlPt2: QPointF(235.088, 551.44), endPt: QPointF(213.344, 548.704)); |
716 | path.cubicTo(ctrlPt1: QPointF(209.24, 547.264), ctrlPt2: QPointF(209.456, 545.392), endPt: QPointF(213.488, 544.816)); |
717 | path.cubicTo(ctrlPt1: QPointF(229.184, 544.816), ctrlPt2: QPointF(241.28, 537.904), endPt: QPointF(254.96, 537.904)); |
718 | path.cubicTo(ctrlPt1: QPointF(258.704, 538.048), ctrlPt2: QPointF(262.304, 539.488), endPt: QPointF(264.392, 541.648)); |
719 | path.cubicTo(ctrlPt1: QPointF(269.504, 544.96), ctrlPt2: QPointF(288.08, 570.592), endPt: QPointF(289.376, 586.864)); |
720 | path.closeSubpath(); |
721 | painter->drawPath(path); |
722 | path = QPainterPath(); |
723 | |
724 | painter->setBrush(QColor(193, 193, 191, 255)); |
725 | path.moveTo(x: 180.152, y: 546.832); |
726 | path.cubicTo(ctrlPt1: QPointF(180.872, 550.792), ctrlPt2: QPointF(163.808, 545.68), endPt: QPointF(164.744, 556.696)); |
727 | path.cubicTo(ctrlPt1: QPointF(165.032, 559.72), ctrlPt2: QPointF(160.496, 561.376), endPt: QPointF(160.64, 556.696)); |
728 | path.cubicTo(ctrlPt1: QPointF(160.64, 548.272), ctrlPt2: QPointF(161.072, 548.416), endPt: QPointF(152.72, 546.832)); |
729 | path.cubicTo(ctrlPt1: QPointF(151.208, 546.76), ctrlPt2: QPointF(151.352, 544.528), endPt: QPointF(152.72, 544.816)); |
730 | path.lineTo(x: 152.72, y: 544.816); |
731 | path.cubicTo(ctrlPt1: QPointF(158.696, 546.472), ctrlPt2: QPointF(166.76, 542.872), endPt: QPointF(166.4, 538.84)); |
732 | path.cubicTo(ctrlPt1: QPointF(166.256, 537.472), ctrlPt2: QPointF(168.56, 537.688), endPt: QPointF(168.488, 538.84)); |
733 | path.cubicTo(ctrlPt1: QPointF(167.984, 545.248), ctrlPt2: QPointF(181.664, 542.152), endPt: QPointF(180.152, 546.832)); |
734 | path.closeSubpath(); |
735 | painter->drawPath(path); |
736 | path = QPainterPath(); |
737 | |
738 | painter->setBrush(QColor(193, 193, 191, 255)); |
739 | path.moveTo(x: 151.568, y: 705.376); |
740 | path.cubicTo(ctrlPt1: QPointF(151.64, 708.328), ctrlPt2: QPointF(148.76, 707.68), endPt: QPointF(148.544, 705.592)); |
741 | path.cubicTo(ctrlPt1: QPointF(140.192, 680.536), ctrlPt2: QPointF(143.72, 618.832), endPt: QPointF(151.856, 598.96)); |
742 | path.cubicTo(ctrlPt1: QPointF(152.432, 596.08), ctrlPt2: QPointF(156.248, 596.944), endPt: QPointF(155.744, 598.96)); |
743 | path.cubicTo(ctrlPt1: QPointF(147.104, 635.464), ctrlPt2: QPointF(147.248, 673.048), endPt: QPointF(151.568, 705.376)); |
744 | path.closeSubpath(); |
745 | painter->drawPath(path); |
746 | path = QPainterPath(); |
747 | |
748 | painter->setBrush(QColor(183, 114, 0, 255)); |
749 | path.moveTo(x: 51.704, y: 684.424); |
750 | path.cubicTo(ctrlPt1: QPointF(75.68, 707.824), ctrlPt2: QPointF(91.376, 743.248), endPt: QPointF(114.632, 775.288)); |
751 | path.cubicTo(ctrlPt1: QPointF(148.472, 816.04), ctrlPt2: QPointF(121.472, 858.304), endPt: QPointF(66.464, 845.56)); |
752 | path.cubicTo(ctrlPt1: QPointF(38.888, 835.192), ctrlPt2: QPointF(-0.784, 836.344), endPt: QPointF(-32.68, 825.832)); |
753 | path.cubicTo(ctrlPt1: QPointF(-55.072, 820.36), ctrlPt2: QPointF(-55.864, 809.272), endPt: QPointF(-44.416, 787.6)); |
754 | path.cubicTo(ctrlPt1: QPointF(-40.384, 773.776), ctrlPt2: QPointF(-40.024, 751.312), endPt: QPointF(-43.768, 732.592)); |
755 | path.cubicTo(ctrlPt1: QPointF(-45.784, 718.408), ctrlPt2: QPointF(-39.232, 710.488), endPt: QPointF(-24.112, 708.832)); |
756 | path.lineTo(x: -24.112, y: 708.832); |
757 | path.cubicTo(ctrlPt1: QPointF(-11.296, 708.688), ctrlPt2: QPointF(6.56, 713.872), endPt: QPointF(16.28, 686.44)); |
758 | path.cubicTo(ctrlPt1: QPointF(23.552, 673.336), ctrlPt2: QPointF(40.976, 672.976), endPt: QPointF(51.704, 684.424)); |
759 | path.closeSubpath(); |
760 | painter->drawPath(path); |
761 | path = QPainterPath(); |
762 | |
763 | painter->setBrush(QColor(242, 183, 0, 255)); |
764 | path.moveTo(x: 24.632, y: 699.04); |
765 | path.cubicTo(ctrlPt1: QPointF(23.84, 680.968), ctrlPt2: QPointF(39.32, 677.296), endPt: QPointF(49.688, 688.312)); |
766 | path.cubicTo(ctrlPt1: QPointF(68.192, 710.992), ctrlPt2: QPointF(85.112, 736.048), endPt: QPointF(100.376, 764.992)); |
767 | path.cubicTo(ctrlPt1: QPointF(124.712, 804.16), ctrlPt2: QPointF(104.624, 842.68), endPt: QPointF(67.904, 828.064)); |
768 | path.cubicTo(ctrlPt1: QPointF(49.688, 817.84), ctrlPt2: QPointF(6.128, 813.304), endPt: QPointF(-17.344, 809.128)); |
769 | path.cubicTo(ctrlPt1: QPointF(-33.04, 807.832), ctrlPt2: QPointF(-35.128, 797.608), endPt: QPointF(-29.152, 791.848)); |
770 | path.cubicTo(ctrlPt1: QPointF(-20.944, 782.416), ctrlPt2: QPointF(-20.08, 759.808), endPt: QPointF(-27.856, 740.512)); |
771 | path.cubicTo(ctrlPt1: QPointF(-35.56, 728.56), ctrlPt2: QPointF(-21.088, 715.384), endPt: QPointF(-9.712, 720.856)); |
772 | path.cubicTo(ctrlPt1: QPointF(0.8, 727.048), ctrlPt2: QPointF(25.64, 713.08), endPt: QPointF(24.632, 699.04)); |
773 | path.closeSubpath(); |
774 | painter->drawPath(path); |
775 | |
776 | painter->setPen(QPen(QColor(255, 0, 0, alpha), 0.25, Qt::SolidLine, Qt::FlatCap, Qt::BevelJoin)); |
777 | painter->setBrush(Qt::NoBrush); |
778 | painter->drawRect(r: br.adjusted(xp1: -1, yp1: -1, xp2: 1, yp2: 1)); |
779 | } |
780 | |
781 | |
782 | XFormWidget::XFormWidget(QWidget *parent) |
783 | : QWidget(parent), textEditor(new QLineEdit) |
784 | { |
785 | setWindowTitle(tr(s: "Affine Transformations" )); |
786 | |
787 | view = new XFormView(this); |
788 | view->setMinimumSize(minw: 200, minh: 200); |
789 | |
790 | QWidget *mainContentWidget = new QWidget(); |
791 | QGroupBox *mainGroup = new QGroupBox(mainContentWidget); |
792 | mainGroup->setTitle(tr(s: "Affine Transformations" )); |
793 | |
794 | QGroupBox *rotateGroup = new QGroupBox(mainGroup); |
795 | rotateGroup->setTitle(tr(s: "Rotate" )); |
796 | QSlider *rotateSlider = new QSlider(Qt::Horizontal, rotateGroup); |
797 | rotateSlider->setRange(min: 0, max: 3600); |
798 | rotateSlider->setSizePolicy(hor: QSizePolicy::Preferred, ver: QSizePolicy::Fixed); |
799 | |
800 | QGroupBox *scaleGroup = new QGroupBox(mainGroup); |
801 | scaleGroup->setTitle(tr(s: "Scale" )); |
802 | QSlider *scaleSlider = new QSlider(Qt::Horizontal, scaleGroup); |
803 | scaleSlider->setRange(min: 1, max: 4000); |
804 | scaleSlider->setSizePolicy(hor: QSizePolicy::Preferred, ver: QSizePolicy::Fixed); |
805 | |
806 | QGroupBox *shearGroup = new QGroupBox(mainGroup); |
807 | shearGroup->setTitle(tr(s: "Shear" )); |
808 | QSlider *shearSlider = new QSlider(Qt::Horizontal, shearGroup); |
809 | shearSlider->setRange(min: -990, max: 990); |
810 | shearSlider->setSizePolicy(hor: QSizePolicy::Preferred, ver: QSizePolicy::Fixed); |
811 | |
812 | QGroupBox *typeGroup = new QGroupBox(mainGroup); |
813 | typeGroup->setTitle(tr(s: "Type" )); |
814 | QRadioButton *vectorType = new QRadioButton(typeGroup); |
815 | QRadioButton *pixmapType = new QRadioButton(typeGroup); |
816 | QRadioButton *textType= new QRadioButton(typeGroup); |
817 | vectorType->setText(tr(s: "Vector Image" )); |
818 | pixmapType->setText(tr(s: "Pixmap" )); |
819 | textType->setText(tr(s: "Text" )); |
820 | |
821 | QPushButton *resetButton = new QPushButton(mainGroup); |
822 | resetButton->setText(tr(s: "Reset Transform" )); |
823 | |
824 | QPushButton *animateButton = new QPushButton(mainGroup); |
825 | animateButton->setText(tr(s: "Animate" )); |
826 | animateButton->setCheckable(true); |
827 | |
828 | QPushButton *showSourceButton = new QPushButton(mainGroup); |
829 | showSourceButton->setText(tr(s: "Show Source" )); |
830 | #if QT_CONFIG(opengl) |
831 | QPushButton *enableOpenGLButton = new QPushButton(mainGroup); |
832 | enableOpenGLButton->setText(tr(s: "Use OpenGL" )); |
833 | enableOpenGLButton->setCheckable(true); |
834 | enableOpenGLButton->setChecked(view->usesOpenGL()); |
835 | #endif |
836 | QPushButton *whatsThisButton = new QPushButton(mainGroup); |
837 | whatsThisButton->setText(tr(s: "What's This?" )); |
838 | whatsThisButton->setCheckable(true); |
839 | |
840 | QVBoxLayout *rotateGroupLayout = new QVBoxLayout(rotateGroup); |
841 | rotateGroupLayout->addWidget(rotateSlider); |
842 | |
843 | QVBoxLayout *scaleGroupLayout = new QVBoxLayout(scaleGroup); |
844 | scaleGroupLayout->addWidget(scaleSlider); |
845 | |
846 | QVBoxLayout *shearGroupLayout = new QVBoxLayout(shearGroup); |
847 | shearGroupLayout->addWidget(shearSlider); |
848 | |
849 | QVBoxLayout *typeGroupLayout = new QVBoxLayout(typeGroup); |
850 | typeGroupLayout->addWidget(vectorType); |
851 | typeGroupLayout->addWidget(pixmapType); |
852 | typeGroupLayout->addWidget(textType); |
853 | typeGroupLayout->addSpacing(size: 4); |
854 | typeGroupLayout->addWidget(textEditor); |
855 | |
856 | QVBoxLayout *mainGroupLayout = new QVBoxLayout(mainGroup); |
857 | mainGroupLayout->addWidget(rotateGroup); |
858 | mainGroupLayout->addWidget(scaleGroup); |
859 | mainGroupLayout->addWidget(shearGroup); |
860 | mainGroupLayout->addWidget(typeGroup); |
861 | mainGroupLayout->addStretch(stretch: 1); |
862 | mainGroupLayout->addWidget(resetButton); |
863 | mainGroupLayout->addWidget(animateButton); |
864 | mainGroupLayout->addWidget(showSourceButton); |
865 | #if QT_CONFIG(opengl) |
866 | mainGroupLayout->addWidget(enableOpenGLButton); |
867 | #endif |
868 | mainGroupLayout->addWidget(whatsThisButton); |
869 | |
870 | mainGroup->setLayout(mainGroupLayout); |
871 | |
872 | QVBoxLayout *mainContentLayout = new QVBoxLayout(); |
873 | mainContentLayout->addWidget(mainGroup); |
874 | mainContentWidget->setLayout(mainContentLayout); |
875 | |
876 | QScrollArea *mainScrollArea = new QScrollArea(); |
877 | mainScrollArea->setWidget(mainContentWidget); |
878 | mainScrollArea->setSizePolicy(hor: QSizePolicy::Fixed, ver: QSizePolicy::Preferred); |
879 | |
880 | QHBoxLayout *viewLayout = new QHBoxLayout(this); |
881 | viewLayout->addWidget(view); |
882 | viewLayout->addWidget(mainScrollArea); |
883 | |
884 | connect(sender: rotateSlider, signal: &QSlider::valueChanged, receiver: view, slot: &XFormView::changeRotation); |
885 | connect(sender: shearSlider, signal: &QSlider::valueChanged, receiver: view, slot: &XFormView::changeShear); |
886 | connect(sender: scaleSlider, signal: &QSlider::valueChanged, receiver: view, slot: &XFormView::changeScale); |
887 | |
888 | connect(sender: vectorType, signal: &QRadioButton::clicked, receiver: view, slot: &XFormView::setVectorType); |
889 | connect(sender: pixmapType, signal: &QRadioButton::clicked, receiver: view, slot: &XFormView::setPixmapType); |
890 | connect(sender: textType, signal: &QRadioButton::clicked, receiver: view, slot: &XFormView::setTextType); |
891 | connect(sender: textType, signal: &QRadioButton::toggled, receiver: textEditor, slot: &XFormView::setEnabled); |
892 | connect(sender: textEditor, signal: &QLineEdit::textChanged, receiver: view, slot: &XFormView::setText); |
893 | |
894 | connect(sender: view, signal: &XFormView::rotationChanged, receiver: rotateSlider, slot: &QSlider::setValue); |
895 | connect(sender: view, signal: &XFormView::scaleChanged, receiver: scaleSlider, slot: &QAbstractSlider::setValue); |
896 | connect(sender: view, signal: &XFormView::shearChanged, receiver: shearSlider, slot: &QAbstractSlider::setValue); |
897 | |
898 | connect(sender: resetButton, signal: &QPushButton::clicked, receiver: view, slot: &XFormView::reset); |
899 | connect(sender: animateButton, signal: &QPushButton::clicked, receiver: view, slot: &XFormView::setAnimation); |
900 | connect(sender: whatsThisButton, signal: &QPushButton::clicked, receiver: view, slot: &ArthurFrame::setDescriptionEnabled); |
901 | connect(sender: whatsThisButton, signal: &QPushButton::clicked, receiver: view->hoverPoints(), slot: &HoverPoints::setDisabled); |
902 | connect(sender: view, signal: &XFormView::descriptionEnabledChanged, receiver: view->hoverPoints(), slot: &HoverPoints::setDisabled); |
903 | connect(sender: view, signal: &XFormView::descriptionEnabledChanged, receiver: whatsThisButton, slot: &QPushButton::setChecked); |
904 | connect(sender: showSourceButton, signal: &QPushButton::clicked, receiver: view, slot: &XFormView::showSource); |
905 | #if QT_CONFIG(opengl) |
906 | connect(sender: enableOpenGLButton, signal: &QPushButton::clicked, receiver: view, slot: &XFormView::enableOpenGL); |
907 | #endif |
908 | view->loadSourceFile(fileName: ":res/affine/xform.cpp" ); |
909 | view->loadDescription(filename: ":res/affine/xform.html" ); |
910 | |
911 | // defaults |
912 | view->reset(); |
913 | vectorType->setChecked(true); |
914 | textEditor->setText("Qt Affine Transformation Example" ); |
915 | textEditor->setEnabled(false); |
916 | |
917 | animateButton->animateClick(); |
918 | } |
919 | |