12
12
** $QT_BEGIN_LICENSE:LGPL$
13
13
** Commercial Usage
14
** Licensees holding valid Qt Commercial licenses may use this file in
15
** accordance with the Qt Solutions Commercial License Agreement provided
16
** with the Software or, alternatively, in accordance with the terms
14
** Licensees holding valid Qt Commercial licenses may use this file in
15
** accordance with the Qt Commercial License Agreement provided with
16
** the Software or, alternatively, in accordance with the terms
17
17
** contained in a written agreement between you and Nokia.
19
19
** GNU Lesser General Public License Usage
36
36
** ensure the GNU General Public License version 3.0 requirements will be
37
37
** met: http://www.gnu.org/copyleft/gpl.html.
39
** Please note Third Party Software included with Qt Solutions may impose
40
** additional restrictions and it is the user's responsibility to ensure
41
** that they have met the licensing requirements of the GPL, LGPL, or Qt
42
** Solutions Commercial license and the relevant license of the Third
43
** Party Software they are using.
45
39
** If you are unsure which license is appropriate for your use, please
46
40
** contact the sales department at qt-sales@nokia.com.
47
41
** $QT_END_LICENSE$
56
50
QTM_BEGIN_NAMESPACE
53
\qmlclass MapRectangle
55
\brief The MapRectangle element displays a rectangle on a map.
56
\inherits QGeoMapRectangleObject
58
\ingroup qml-location-maps
60
The rectangle is specified in terms of the top left and bottom
63
If \l topLeft and \l bottomRight are not specified and valid the
64
rectangle will not be displayed.
66
The MapRectangle element is part of the \bold{QtMobility.location 1.1} module.
58
69
QDeclarativeGeoMapRectangleObject::QDeclarativeGeoMapRectangleObject()
60
71
m_topLeft = new QDeclarativeCoordinate(this);
74
SIGNAL(latitudeChanged(double)),
76
SLOT(topLeftLatitudeChanged(double)));
78
SIGNAL(longitudeChanged(double)),
80
SLOT(topLeftLongitudeChanged(double)));
82
SIGNAL(altitudeChanged(double)),
84
SLOT(topLeftAltitudeChanged(double)));
61
86
m_bottomRight = new QDeclarativeCoordinate(this);
88
connect(m_bottomRight,
89
SIGNAL(latitudeChanged(double)),
91
SLOT(bottomRightLatitudeChanged(double)));
92
connect(m_bottomRight,
93
SIGNAL(longitudeChanged(double)),
95
SLOT(bottomRightLongitudeChanged(double)));
96
connect(m_bottomRight,
97
SIGNAL(altitudeChanged(double)),
99
SLOT(bottomRightAltitudeChanged(double)));
102
SIGNAL(colorChanged(QColor)),
104
SLOT(borderColorChanged(QColor)));
106
SIGNAL(widthChanged(int)),
108
SLOT(borderWidthChanged(int)));
64
111
QDeclarativeGeoMapRectangleObject::~QDeclarativeGeoMapRectangleObject()
116
\qmlproperty Coordinate MapRectangle::topLeft
118
This property holds the coordinate corresponding to the top left
119
corner of the rectangle.
121
The default value is an invalid coordinate.
68
124
void QDeclarativeGeoMapRectangleObject::setDeclarativeTopLeft(const QDeclarativeCoordinate *topLeft)
70
126
if (m_topLeft->coordinate() == topLeft->coordinate())
76
132
emit declarativeTopLeftChanged(m_topLeft);
79
QDeclarativeCoordinate* QDeclarativeGeoMapRectangleObject::declarativeTopLeft() const
135
QDeclarativeCoordinate* QDeclarativeGeoMapRectangleObject::declarativeTopLeft()
140
void QDeclarativeGeoMapRectangleObject::topLeftLatitudeChanged(double /*latitude*/)
142
setTopLeft(m_topLeft->coordinate());
145
void QDeclarativeGeoMapRectangleObject::topLeftLongitudeChanged(double /*longitude*/)
147
setTopLeft(m_topLeft->coordinate());
150
void QDeclarativeGeoMapRectangleObject::topLeftAltitudeChanged(double /*altitude*/)
152
setTopLeft(m_topLeft->coordinate());
156
\qmlproperty Coordinate MapRectangle::bottomRight
158
This property holds the coordinate corresponding to the bottom right
159
corner of the rectangle.
161
The default value is an invalid coordinate.
84
164
void QDeclarativeGeoMapRectangleObject::setDeclarativeBottomRight(const QDeclarativeCoordinate *bottomRight)
86
166
if (m_bottomRight->coordinate() == bottomRight->coordinate())
92
172
emit declarativeBottomRightChanged(m_bottomRight);
95
QDeclarativeCoordinate* QDeclarativeGeoMapRectangleObject::declarativeBottomRight() const
175
QDeclarativeCoordinate* QDeclarativeGeoMapRectangleObject::declarativeBottomRight()
97
177
return m_bottomRight;
180
void QDeclarativeGeoMapRectangleObject::bottomRightLatitudeChanged(double /*latitude*/)
182
setBottomRight(m_bottomRight->coordinate());
185
void QDeclarativeGeoMapRectangleObject::bottomRightLongitudeChanged(double /*longitude*/)
187
setBottomRight(m_bottomRight->coordinate());
190
void QDeclarativeGeoMapRectangleObject::bottomRightAltitudeChanged(double /*altitude*/)
192
setBottomRight(m_bottomRight->coordinate());
196
\qmlproperty color MapRectangle::color
198
This property holds the color used to fill the circle.
200
The default value corresponds to a transparent color.
100
203
void QDeclarativeGeoMapRectangleObject::setColor(const QColor &color)
102
205
if (m_color == color)
220
\qmlproperty int MapRectangle::border.width
221
\qmlproperty color MapRectangle::border.color
223
These properties hold the width and color used to draw the border of the circle.
225
The width is in pixels and is independent of the zoom level of the map.
227
The default values correspond to a black border with a width of 1 pixel.
229
For no line, use a width of 0 or a transparent color.
232
QDeclarativeGeoMapObjectBorder* QDeclarativeGeoMapRectangleObject::border()
237
void QDeclarativeGeoMapRectangleObject::borderColorChanged(const QColor &color)
244
void QDeclarativeGeoMapRectangleObject::borderWidthChanged(int width)
249
p.setStyle(Qt::NoPen);
251
p.setStyle(Qt::SolidLine);
256
\qmlproperty int MapRectangle::zValue
258
This property holds the z-value of the rectangle.
260
Map objects are drawn in z-value order, and objects with the
261
same z-value will be drawn in insertion order.
265
\qmlproperty bool MapRectangle::visible
267
This property holds a boolean corresponding to whether or not the
268
rectangle is visible.
272
\qmlproperty bool MapRectangle::selected
274
This property holds a boolean corresponding to whether or not the
275
rectangle is selected.
116
278
#include "moc_qdeclarativegeomaprectangleobject_p.cpp"
118
280
QTM_END_NAMESPACE