Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdeclarativepolylinemapitem.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
6
7#include <QtCore/QScopedValueRollback>
8#include <qnumeric.h>
9#include <QPainterPath>
10
11#include <QtGui/private/qtriangulatingstroker_p.h>
12#include <QtPositioning/private/qlocationutils_p.h>
13#include <QtPositioning/private/qdoublevector2d_p.h>
14#include <QtPositioning/private/qwebmercator_p.h>
15#include <QtPositioning/private/qclipperutils_p.h>
16#include <QtPositioning/private/qgeopath_p.h>
17#include <QtLocation/private/qgeomap_p.h>
18
19#include <array>
20
22
23
24static bool get_line_intersection(const double p0_x,
25 const double p0_y,
26 const double p1_x,
27 const double p1_y,
28 const double p2_x,
29 const double p2_y,
30 const double p3_x,
31 const double p3_y,
32 double *i_x,
33 double *i_y,
34 double *i_t)
35{
36 const double s10_x = p1_x - p0_x;
37 const double s10_y = p1_y - p0_y;
38 const double s32_x = p3_x - p2_x;
39 const double s32_y = p3_y - p2_y;
40
41 const double denom = s10_x * s32_y - s32_x * s10_y;
42 if (denom == 0.0)
43 return false; // Collinear
44 const bool denomPositive = denom > 0;
45
46 const double s02_x = p0_x - p2_x;
47 const double s02_y = p0_y - p2_y;
48 const double s_numer = s10_x * s02_y - s10_y * s02_x;
49 if ((s_numer < 0.0) == denomPositive)
50 return false; // No collision
51
52 const double t_numer = s32_x * s02_y - s32_y * s02_x;
53 if ((t_numer < 0.0) == denomPositive)
54 return false; // No collision
55
56 if (((s_numer > denom) == denomPositive) || ((t_numer > denom) == denomPositive))
57 return false; // No collision
58 // Collision detected
59 *i_t = t_numer / denom;
60 *i_x = p0_x + (*i_t * s10_x);
61 *i_y = p0_y + (*i_t * s10_y);
62
63 return true;
64}
65
71
72static QList<QList<QDoubleVector2D> > clipLine(
73 const QList<QDoubleVector2D> &l,
74 const QList<QDoubleVector2D> &poly)
75{
76 QList<QList<QDoubleVector2D> > res;
77 if (poly.size() < 2 || l.size() < 2)
78 return res;
79
80 // Step 1: build edges
81 std::vector<std::array<double, 4> > edges;
82 for (qsizetype i = 1; i < poly.size(); i++)
83 edges.push_back({ { poly.at(i-1).x(), poly.at(i-1).y(), poly.at(i).x(), poly.at(i).y() } });
84 edges.push_back({ { poly.at(poly.size()-1).x(), poly.at(poly.size()-1).y(), poly.at(0).x(), poly.at(0).y() } });
85
86 // Step 2: check each segment against each edge
87 QList<QDoubleVector2D> subLine;
88 std::array<double, 4> intersections = { { 0.0, 0.0, 0.0, 0.0 } };
89
90 for (qsizetype i = 0; i < l.size() - 1; ++i) {
92 double t = -1; // valid values are in [0, 1]. Only written if intersects
93 double previousT = t;
94 double i_x, i_y;
95
96 const int firstContained = QClipperUtils::pointInPolygon(l.at(i), poly);
97 const int secondContained = QClipperUtils::pointInPolygon(l.at(i+1), poly);
98
99 if (firstContained && secondContained) { // Second most common condition, test early and skip inner loop if possible
100 if (!subLine.size())
101 subLine.push_back(l.at(i)); // the initial element has to be pushed now.
102 subLine.push_back(l.at(i+1));
103 continue;
104 }
105
106 for (unsigned int j = 0; j < edges.size(); ++j) {
107 const bool intersects = get_line_intersection(l.at(i).x(),
108 l.at(i).y(),
109 l.at(i+1).x(),
110 l.at(i+1).y(),
111 edges.at(j).at(0),
112 edges.at(j).at(1),
113 edges.at(j).at(2),
114 edges.at(j).at(3),
115 &i_x,
116 &i_y,
117 &t);
118 if (intersects) {
119 if (previousT >= 0.0) { //One intersection already hit
120 if (t < previousT) { // Reorder
121 intersections[2] = intersections[0];
122 intersections[3] = intersections[1];
123 intersections[0] = i_x;
124 intersections[1] = i_y;
125 } else {
126 intersections[2] = i_x;
127 intersections[3] = i_y;
128 }
129
131 break; // no need to check anything else
132 } else { // First intersection
133 intersections[0] = i_x;
134 intersections[1] = i_y;
136 }
137 previousT = t;
138 }
139 }
140
141 if (type == NoIntersection) {
142 if (!firstContained && !secondContained) { // Both outside
143 subLine.clear();
144 } else if (firstContained && secondContained) {
145 // Handled above already.
146 } else { // Mismatch between PointInPolygon and get_line_intersection. Treat it as no intersection
147 if (subLine.size())
148 res.push_back(subLine);
149 subLine.clear();
150 }
151 } else if (type == OneIntersection) { // Need to check the following cases to avoid mismatch with PointInPolygon result.
152 if (firstContained <= 0 && secondContained > 0) { // subLine MUST be empty
153 if (!subLine.size())
154 subLine.push_back(QDoubleVector2D(intersections[0], intersections[1]));
155 subLine.push_back(l.at(i+1));
156 } else if (firstContained > 0 && secondContained <= 0) { // subLine MUST NOT be empty
157 if (!subLine.size())
158 subLine.push_back(l.at(i));
159 subLine.push_back(QDoubleVector2D(intersections[0], intersections[1]));
160 res.push_back(subLine);
161 subLine.clear();
162 } else {
163 if (subLine.size())
164 res.push_back(subLine);
165 subLine.clear();
166 }
167 } else { // Two
168 // restart strip
169 subLine.clear();
170 subLine.push_back(QDoubleVector2D(intersections[0], intersections[1]));
171 subLine.push_back(QDoubleVector2D(intersections[2], intersections[3]));
172 res.push_back(subLine);
173 subLine.clear();
174 }
175 }
176
177 if (subLine.size())
178 res.push_back(subLine);
179 return res;
180}
181
260
265{
266 return color_;
267}
268
273{
274 if (color_ == color)
275 return;
276
277 color_ = color;
278 emit colorChanged(color_);
279}
280
285{
286 return width_;
287}
288
293{
294 if (width_ == width)
295 return;
296
297 width_ = width;
298 emit widthChanged(width_);
299}
300
305 const QList<QDoubleVector2D> &basePath)
306{
307 // A polygon consists of mutliple paths. This is usually a perimeter and multiple holes
308 // We move all paths into a single QPainterPath. The filling rule EvenOdd will then ensure that the paths are shown correctly
309 if (!sourceDirty_)
310 return;
311 const QGeoProjectionWebMercator &p = static_cast<const QGeoProjectionWebMercator&>(map.geoProjection());
313 srcOrigin_ = p.mapProjectionToGeo(QDoubleVector2D(0, 0)); //avoid warning of NaN values if function is returned early
314
315 //0 Wrap the points around the globe if the path makes more sense that way.
316 // Ultimately, this is done if it is closer to walk around the day-border than the other direction
317 QVarLengthArray<QList<QDoubleVector2D>, 3> wrappedPaths;
318 wrappedPaths << QList<QDoubleVector2D>({basePath[0]});
319 wrappedPaths.last().reserve(basePath.size());
320 for (int i = 1; i < basePath.size(); i++) {
321 if (basePath[i].x() > wrappedPaths.last().last().x() + 0.5)
322 wrappedPaths.last() << basePath[i] - QDoubleVector2D(1.0, 0.0);
323 else if (basePath[i].x() < wrappedPaths.last().last().x() - 0.5)
324 wrappedPaths.last() << basePath[i] + QDoubleVector2D(1.0, 0.0);
325 else
326 wrappedPaths.last() << basePath[i];
327 }
328
329 //1 The bounding rectangle of the polygon and camera view are compared to determine if the polygon is visible
330 // The viewport is periodic in x-direction in the interval [-1; 1].
331 // The polygon (maybe) has to be ploted periodically too by shifting it by -1 or +1;
332 const QRectF cameraRect = QDeclarativeGeoMapItemUtils::boundingRectangleFromList(p.visibleGeometry());
333 QRectF itemRect;
334 for (const auto &path : wrappedPaths)
335 itemRect |= QDeclarativeGeoMapItemUtils::boundingRectangleFromList(path).adjusted(-1e-6, -1e-6, 2e-6, 2e-6); //TODO: Maybe use linewidth?
336 for (double xoffset : {-1.0, 1.0}) {
337 if (!cameraRect.intersects(itemRect.translated(QPointF(xoffset,0))))
338 continue;
339 wrappedPaths.append(QList<QDoubleVector2D>());
340 QList<QDoubleVector2D> &wP = wrappedPaths.last();
341 wP.reserve(wrappedPaths.first().size());
342 for (const QDoubleVector2D &coord : wrappedPaths.first())
343 wP.append(coord + QDoubleVector2D(xoffset, 0.0));
344 }
345 if (wrappedPaths.isEmpty()) // the polygon boundary rectangle does not overlap with the viewport rectangle
346 return;
347
348 //2 The polygons that are at least partially in the viewport are cliped to reduce their size
349 QList<QList<QDoubleVector2D>> clippedPaths;
350 const QList<QDoubleVector2D> &visibleRegion = p.visibleGeometryExpanded();
351 for (const auto &path : wrappedPaths) {
352 if (visibleRegion.size()) {
353 clippedPaths << clipLine(path, visibleRegion);
354 //TODO: Replace clipping with Clipper lib, similar to QPolygonMapItem
355 } else {
356 clippedPaths.append(path); //Do we really need this if there are no visible regions??
357 }
358 }
359 if (clippedPaths.isEmpty()) //the polygon is entirely outside visibleRegion
360 return;
361
362 QRectF bb;
363 for (const auto &path: clippedPaths)
365 //Offset by origin, find the maximum coordinate
366 maxCoord_ = 0.0;
367 srcOrigin_ = p.mapProjectionToGeo(QDoubleVector2D(bb.left(), bb.top()));
368 QDoubleVector2D origin = p.wrappedMapProjectionToItemPosition(p.geoToWrappedMapProjection(srcOrigin_)); //save way: redo all projections
369 for (const auto &path: clippedPaths) {
370 QDoubleVector2D lastAddedPoint;
371 for (qsizetype i = 0; i < path.size(); ++i) {
372 QDoubleVector2D point = p.wrappedMapProjectionToItemPosition(path.at(i));
373 point = point - origin; // (0,0) if point == origin
374
375 if (qMax(point.x(), point.y()) > maxCoord_)
376 maxCoord_ = qMax(point.x(), point.y());
377
378 if (i == 0) {
379 srcPath_.moveTo(point.toPointF());
380 lastAddedPoint = point;
381 } else {
382 if ((point - lastAddedPoint).manhattanLength() > 3 ||
383 i == path.size() - 1) {
384 srcPath_.lineTo(point.toPointF());
385 lastAddedPoint = point;
386 }
387 }
388 }
389 }
390
392}
393
394/*
395 * QDeclarativePolygonMapItem Private Implementations
396 */
397
401
404{
405 m_shape = new QQuickShape(&m_poly);
406 m_shape->setObjectName("_qt_map_item_shape");
407 m_shape->setZ(-1);
409
412
413 auto pathElements = m_shapePath->pathElements();
414 pathElements.append(&pathElements, m_painterPath);
415
416 auto shapePaths = m_shape->data();
417 shapePaths.append(&shapePaths, m_shapePath);
418}
419
424
426{
428 return;
432 const QList<QGeoCoordinate> realPath = QDeclarativeGeoMapItemUtils::greaterCirclePath(m_poly.m_geopath.path());
433 m_geopathProjected.reserve(realPath.size());
434 for (const QGeoCoordinate &c : realPath)
435 m_geopathProjected << p.geoToMapProjection(c);
436 } else {
438 const QList<QGeoCoordinate> path = m_poly.m_geopath.path();
439 for (const QGeoCoordinate &c : path)
440 m_geopathProjected << p.geoToMapProjection(c);
441 }
442}
443
451
453{
454 if (m_poly.m_geopath.path().length() < 2) { // Possibly cleared
456 m_poly.setWidth(0);
457 m_poly.setHeight(0);
458 m_shape->setVisible(false);
459 return;
460 }
461 QScopedValueRollback<bool> rollback(m_poly.m_updatingGeometry);
463
464 const QGeoMap *map = m_poly.map();
465 const qreal borderWidth = m_poly.m_line.width();
466
468
470 m_poly.setSize(bb.size() + QSizeF(borderWidth, borderWidth));
471 // it has to be shifted so that the center of the line is on the correct geocoord
472 m_poly.setPositionOnMap(m_geometry.origin(), -1 * bb.topLeft() + QPointF(borderWidth, borderWidth) * 0.5);
473
474
476
478 m_shapePath->setStrokeWidth(borderWidth);
480
482 path.translate(-bb.left() + borderWidth * 0.5, -bb.top() + borderWidth * 0.5);
484
487 m_shape->setVisible(true);
488}
489
492{
493 delete oldNode;
494
495 if (m_geometry.isScreenDirty() || !oldNode) {
497 }
498 return nullptr;
499}
500
502{
503 // With Shapes, do not just call
504 // m_shape->contains(m_poly.mapToItem(m_shape, point)) because that can
505 // only do FillContains at best, whereas the polyline relies on stroking.
506
508 const double &lineWidth = m_poly.m_line.width();
509 const QPointF p = m_poly.mapToItem(m_shape, point) - QPointF(lineWidth, lineWidth) * 0.5;
510
511 for (int i = 1; i < path.elementCount(); i++) {
512 if (path.elementAt(i).type == QPainterPath::MoveToElement)
513 continue;
514 const double dsqr = QDeclarativeGeoMapItemUtils::distanceSqrPointLine(p.x(), p.y(),
515 path.elementAt(i - 1).x, path.elementAt(i - 1).y,
516 path.elementAt(i).x, path.elementAt(i).y);
517 if (dsqr < 0.25 * lineWidth * lineWidth)
518 return true;
519 }
520 return false;
521}
522
523/*
524 * QDeclarativePolygonMapItem Implementation
525 */
526
541
545
550{
551 m_d->onLinePropertiesChanged();
552}
553
563
571QList<QGeoCoordinate> QDeclarativePolylineMapItem::path() const
572{
573 return m_geopath.path();
574}
575
576void QDeclarativePolylineMapItem::setPath(const QList<QGeoCoordinate> &value)
577{
579}
580
591{
592 if (m_geopath.path() == path.path())
593 return;
594
596 m_d->onGeoGeometryChanged();
598}
599
604{
605 if (m_geopath.path() == path)
606 return;
607
609
610 m_d->onGeoGeometryChanged();
612}
613
624{
625 return m_geopath.path().length();
626}
627
636{
637 if (!coordinate.isValid())
638 return;
639
640 m_geopath.addCoordinate(coordinate);
641
642 m_d->onGeoGeometryUpdated();
644}
645
656{
657 if (index < 0 || index > m_geopath.path().length())
658 return;
659
660 m_geopath.insertCoordinate(index, coordinate);
661
662 m_d->onGeoGeometryChanged();
664}
665
677{
678 if (index < 0 || index >= m_geopath.path().length())
679 return;
680
681 m_geopath.replaceCoordinate(index, coordinate);
682
683 m_d->onGeoGeometryChanged();
685}
686
697{
698 if (index < 0 || index >= m_geopath.path().length())
699 return QGeoCoordinate();
700
702}
703
712{
713 return m_geopath.containsCoordinate(coordinate);
714}
715
727{
728 int length = m_geopath.path().length();
729 m_geopath.removeCoordinate(coordinate);
730 if (m_geopath.path().length() == length)
731 return;
732
733 m_d->onGeoGeometryChanged();
735}
736
749{
750 if (index < 0 || index >= m_geopath.path().length())
751 return;
752
754
755 m_d->onGeoGeometryChanged();
757}
758
774{
775 return &m_line;
776}
777
781void QDeclarativePolylineMapItem::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
782{
783 if (newGeometry.topLeft() == oldGeometry.topLeft() || !map() || !m_geopath.isValid() || m_updatingGeometry) {
784 QDeclarativeGeoMapItemBase::geometryChange(newGeometry, oldGeometry);
785 return;
786 }
787 // TODO: change the algorithm to preserve the distances and size!
788 QGeoCoordinate newCenter = map()->geoProjection().itemPositionToCoordinate(QDoubleVector2D(newGeometry.center()), false);
789 QGeoCoordinate oldCenter = map()->geoProjection().itemPositionToCoordinate(QDoubleVector2D(oldGeometry.center()), false);
790 if (!newCenter.isValid() || !oldCenter.isValid())
791 return;
792 double offsetLongi = newCenter.longitude() - oldCenter.longitude();
793 double offsetLati = newCenter.latitude() - oldCenter.latitude();
794 if (offsetLati == 0.0 && offsetLongi == 0.0)
795 return;
796
797 m_geopath.translate(offsetLati, offsetLongi);
798 m_d->onGeoGeometryChanged();
800
801 // Not calling QDeclarativeGeoMapItemBase::geometryChange() as it will be called from a nested
802 // call to this function.
803}
804
809{
810 if (event.mapSize.isEmpty())
811 return;
812
813 m_d->afterViewportChanged();
814}
815
820{
821 if (!map() || map()->geoProjection().projectionType() != QGeoProjection::ProjectionWebMercator)
822 return;
823 m_d->updatePolish();
824}
825
830{
831 return m_d->updateMapItemPaintNode(oldNode, data);
832}
833
835{
836 return m_d->contains(point);
837}
838
840{
841 return m_geopath;
842}
843
845{
846 const QGeoPath geopath(shape); // if shape isn't a path, path will be created as a default-constructed path
847 setPath(geopath);
848}
849
851
static int pointInPolygon(const QDoubleVector2D &point, const QList< QDoubleVector2D > &polygon)
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
virtual void setPositionOnMap(const QGeoCoordinate &coordinate, const QPointF &offset)
void setShapeTriangulationScale(QQuickShape *shape, qreal maxCoord) const
virtual void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map)
QLocation::ReferenceSurface referenceSurface
QDeclarativeGeoMap * quickMap() const
void setPath(const QPainterPath &path)
void widthChanged(qreal width)
QDeclarativeMapLineProperties(QObject *parent=nullptr)
\qmltype MapPolyline \instantiates QDeclarativePolylineMapItem \inqmlmodule QtLocation
void colorChanged(const QColor &color)
QDeclarativePolylineMapItemPrivateCPU(QDeclarativePolylineMapItem &poly)
QSGNode * updateMapItemPaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) override
bool contains(const QPointF &point) const override
QDeclarativeMapLineProperties * line
\qmlpropertygroup Location::MapPolyline::line \qmlproperty int MapPolyline::line.width \qmlproperty c...
Q_INVOKABLE void replaceCoordinate(int index, const QGeoCoordinate &coordinate)
\qmlmethod void MapPolyline::replaceCoordinate(index, coordinate)
Q_INVOKABLE bool containsCoordinate(const QGeoCoordinate &coordinate)
\qmlmethod coordinate MapPolyline::containsCoordinate(coordinate)
Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate)
\qmlmethod void MapPolyline::removeCoordinate(coordinate)
virtual void setPath(const QList< QGeoCoordinate > &value)
QDeclarativeMapLineProperties m_line
QSGNode * updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override
bool contains(const QPointF &point) const override
\qmlmethod bool QtQuick::Item::contains(point point)
Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate)
\qmlmethod void MapPolyline::addCoordinate(coordinate)
void afterViewportChanged(const QGeoMapViewportChangeEvent &event) override
Q_INVOKABLE int pathLength() const
\qmlmethod int MapPolyline::pathLength()
Q_INVOKABLE void insertCoordinate(int index, const QGeoCoordinate &coordinate)
\qmlmethod void MapPolyline::insertCoordinate(index, coordinate)
const QGeoShape & geoShape() const override
void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override
QDeclarativePolylineMapItem(QQuickItem *parent=nullptr)
void setGeoShape(const QGeoShape &shape) override
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setPathFromGeoList(const QList< QGeoCoordinate > &path)
Q_INVOKABLE QGeoCoordinate coordinateAt(int index) const
\qmlmethod coordinate MapPolyline::coordinateAt(index)
std::unique_ptr< QDeclarativePolylineMapItemPrivate > m_d
Q_DECL_CONSTEXPR QPointF toPointF() const
Q_DECL_CONSTEXPR double x() const
Q_DECL_CONSTEXPR double y() const
\inmodule QtPositioning
bool isValid
This property holds the validity of this geo coordinate.
QRectF sourceBoundingBox() const
const QGeoCoordinate & origin() const
const QGeoProjection & geoProjection() const
Definition qgeomap.cpp:164
@ MapPolyline
Definition qgeomap_p.h:50
\inmodule QtPositioning
Definition qgeopath.h:16
Q_INVOKABLE QGeoCoordinate coordinateAt(qsizetype index) const
Returns the coordinate at index .
Definition qgeopath.cpp:288
Q_INVOKABLE void insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
Inserts coordinate at the specified index.
Definition qgeopath.cpp:270
void setPath(const QList< QGeoCoordinate > &path)
Sets all the elements of the path.
Definition qgeopath.cpp:123
Q_INVOKABLE void translate(double degreesLatitude, double degreesLongitude)
Translates this geo path by degreesLatitude northwards and degreesLongitude eastwards.
Definition qgeopath.cpp:206
Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate)
Removes the last occurrence of coordinate from the path.
Definition qgeopath.cpp:306
Q_INVOKABLE bool containsCoordinate(const QGeoCoordinate &coordinate) const
Returns true if the path contains coordinate as one of the elements.
Definition qgeopath.cpp:297
Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate)
Appends coordinate to the path.
Definition qgeopath.cpp:259
QVariantList path
This property holds the list of coordinates for the geo path.
Definition qgeopath.h:18
Q_INVOKABLE void replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
Replaces the path element at the specified index with coordinate.
Definition qgeopath.cpp:279
virtual ProjectionType projectionType() const =0
virtual QGeoCoordinate itemPositionToCoordinate(const QDoubleVector2D &pos, bool clipToViewport=true) const =0
\inmodule QtPositioning
Definition qgeoshape.h:17
bool isValid
This property holds the validity of the geo shape.
Definition qgeoshape.h:20
qsizetype size() const noexcept
Definition qlist.h:397
T & last()
Definition qlist.h:648
qsizetype length() const noexcept
Definition qlist.h:399
void reserve(qsizetype size)
Definition qlist.h:753
void clear()
Definition qlist.h:434
\inmodule QtCore
Definition qobject.h:103
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
Definition qobject.h:127
\inmodule QtGui
void translate(qreal dx, qreal dy)
Translates all elements in the path by ({dx}, {dy}).
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
QRectF boundingRect() const
Returns the bounding rectangle of this painter path as a rectangle with floating point precision.
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
\inmodule QtCore\reentrant
Definition qpoint.h:217
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
void setOpacity(qreal)
void setSize(const QSizeF &size)
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
Q_INVOKABLE QPointF mapToItem(const QQuickItem *item, const QPointF &point) const
Maps the given point in this item's coordinate system to the equivalent point within item's coordinat...
void setHeight(qreal)
QSizeF size() const
void setVisible(bool)
void setZ(qreal)
void setWidth(qreal)
QQmlListProperty< QQuickPathElement > pathElements
\qmlproperty list<PathElement> QtQuick::Path::pathElements This property holds the objects composing ...
void setStrokeColor(const QColor &color)
void setStrokeWidth(qreal w)
void setFillColor(const QColor &color)
void setContainsMode(ContainsMode containsMode)
FINALQQmlListProperty< QObject > data
\qmlproperty list<Object> QtQuick.Shapes::Shape::data
\inmodule QtCore\reentrant
Definition qrect.h:484
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
Definition qrect.h:762
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition qrect.h:813
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
Definition qrect.h:511
constexpr QPointF center() const noexcept
Returns the center point of the rectangle.
Definition qrect.h:699
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
\inmodule QtCore
Definition qsize.h:208
#define this
Definition dialogs.cpp:9
QMap< QString, QString > map
[6]
void colorChanged()
QList< QGeoCoordinate > greaterCirclePath(const QList< QGeoCoordinate > &cornerPoints, greaterCirclePathForm form, int N)
QRectF boundingRectangleFromList(const QList< QDoubleVector2D > &list)
double distanceSqrPointLine(double p0_x, double p0_y, double p1_x, double p1_y, double p2_x, double p2_y)
Combined button and popup list for selecting options.
@ transparent
Definition qnamespace.h:47
static QT_BEGIN_NAMESPACE bool get_line_intersection(const double p0_x, const double p0_y, const double p1_x, const double p1_y, const double p2_x, const double p2_y, const double p3_x, const double p3_y, double *i_x, double *i_y, double *i_t)
static QList< QList< QDoubleVector2D > > clipLine(const QList< QDoubleVector2D > &l, const QList< QDoubleVector2D > &poly)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLint GLint GLint GLint GLint x
[0]
GLuint index
[2]
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei width
GLuint color
[2]
GLenum type
GLint GLint xoffset
struct _cl_event * event
GLuint res
const GLubyte * c
GLuint coord
GLdouble GLdouble t
Definition qopenglext.h:243
GLsizei const GLchar *const * path
GLfloat GLfloat p
[1]
static bool clipLine(QLineF *line, const QRect &rect)
#define emit
ptrdiff_t qsizetype
Definition qtypes.h:165
double qreal
Definition qtypes.h:187
void updateSourcePoints(const QGeoMap &map, const QList< QDoubleVector2D > &basePath)