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
qgeorectangle.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
4#ifndef QGEORECTANGLE_H
5#define QGEORECTANGLE_H
6
7#include <QtPositioning/QGeoShape>
8
10
12
13class Q_POSITIONING_EXPORT QGeoRectangle : public QGeoShape
14{
16 Q_PROPERTY(QGeoCoordinate bottomLeft READ bottomLeft WRITE setBottomLeft)
17 Q_PROPERTY(QGeoCoordinate bottomRight READ bottomRight WRITE setBottomRight)
18 Q_PROPERTY(QGeoCoordinate topLeft READ topLeft WRITE setTopLeft)
19 Q_PROPERTY(QGeoCoordinate topRight READ topRight WRITE setTopRight)
20 Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter)
21 Q_PROPERTY(double height READ height WRITE setHeight)
22 Q_PROPERTY(double width READ width WRITE setWidth)
23
24public:
26 QGeoRectangle(const QGeoCoordinate &center, double degreesWidth, double degreesHeight);
27 QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight);
28 QGeoRectangle(const QList<QGeoCoordinate> &coordinates);
31
33
34 QGeoRectangle &operator=(const QGeoRectangle &other);
35
36 void setTopLeft(const QGeoCoordinate &topLeft);
37 QGeoCoordinate topLeft() const;
38
39 void setTopRight(const QGeoCoordinate &topRight);
40 QGeoCoordinate topRight() const;
41
42 void setBottomLeft(const QGeoCoordinate &bottomLeft);
43 QGeoCoordinate bottomLeft() const;
44
45 void setBottomRight(const QGeoCoordinate &bottomRight);
46 QGeoCoordinate bottomRight() const;
47
48 void setCenter(const QGeoCoordinate &center);
49 QGeoCoordinate center() const;
50
51 void setWidth(double degreesWidth);
52 double width() const;
53
54 void setHeight(double degreesHeight);
55 double height() const;
56
57 using QGeoShape::contains;
58 bool contains(const QGeoRectangle &rectangle) const;
59 Q_INVOKABLE bool intersects(const QGeoRectangle &rectangle) const;
60
61 Q_INVOKABLE void translate(double degreesLatitude, double degreesLongitude);
62 Q_INVOKABLE QGeoRectangle translated(double degreesLatitude, double degreesLongitude) const;
63 Q_INVOKABLE void extendRectangle(const QGeoCoordinate &coordinate);
64
65 Q_INVOKABLE QGeoRectangle united(const QGeoRectangle &rectangle) const;
66 QGeoRectangle operator|(const QGeoRectangle &rectangle) const;
67 QGeoRectangle &operator|=(const QGeoRectangle &rectangle);
68
70
72 inline QGeoRectanglePrivate *d_func();
73 inline const QGeoRectanglePrivate *d_func() const;
74
75#ifndef QT_NO_DATASTREAM
77 {
78 return stream << static_cast<const QGeoShape &>(rectangle);
79 }
81 {
82 return stream >> static_cast<QGeoShape &>(rectangle);
83 }
84#endif
85};
86
88
90{
91 return united(rectangle);
92}
93
95
96QT_DECL_METATYPE_EXTERN(QGeoRectangle, Q_POSITIONING_EXPORT)
97
98#endif
\inmodule QtCore\reentrant
Definition qdatastream.h:46
\inmodule QtPositioning
\inmodule QtPositioning
friend QDataStream & operator<<(QDataStream &stream, const QGeoRectangle &rectangle)
QGeoRectangle operator|(const QGeoRectangle &rectangle) const
Returns the smallest geo rectangle which contains both this geo rectangle and rectangle.
Q_INVOKABLE QGeoRectangle united(const QGeoRectangle &rectangle) const
Returns the smallest geo rectangle which contains both this geo rectangle and rectangle.
friend QDataStream & operator>>(QDataStream &stream, QGeoRectangle &rectangle)
\inmodule QtPositioning
Definition qgeoshape.h:17
Definition qlist.h:75
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
EGLStreamKHR stream
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLint GLsizei GLsizei height
GLint GLsizei width
#define Q_PROPERTY(...)
#define Q_INVOKABLE
#define Q_GADGET
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:158
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
static bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent, int *x, int *y)
QSharedPointer< T > other(t)
[5]
char * toString(const MyType &t)
[31]