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
qdeclarativegeoaddress.cpp
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
5
7
55
60
68{
69 return m_address;
70}
71
73{
74 // Elaborate but takes care of emiting needed signals
75 setText(address.text());
76 setCountry(address.country());
77 setCountryCode(address.countryCode());
78 setState(address.state());
79 setCounty(address.county());
80 setCity(address.city());
81 setDistrict(address.district());
82 setStreet(address.street());
83 setStreetNumber(address.streetNumber());
84 setPostalCode(address.postalCode());
85 m_address = address;
86}
87
109{
110 return m_address.text();
111}
112
114{
115 QString oldText = m_address.text();
116 bool oldIsTextGenerated = m_address.isTextGenerated();
117 m_address.setText(address);
118
119 if (oldText != m_address.text())
121 if (oldIsTextGenerated != m_address.isTextGenerated())
123}
124
131{
132 return m_address.country();
133}
134
136{
137 if (m_address.country() == country)
138 return;
139 QString oldText = m_address.text();
140 m_address.setCountry(country);
142
143 if (m_address.isTextGenerated() && oldText != m_address.text())
145}
146
153{
154 return m_address.countryCode();
155}
156
158{
159 if (m_address.countryCode() == countryCode)
160 return;
161 QString oldText = m_address.text();
162 m_address.setCountryCode(countryCode);
164
165 if (m_address.isTextGenerated() && oldText != m_address.text())
167}
168
175{
176 return m_address.state();
177}
178
180{
181 if (m_address.state() == state)
182 return;
183 QString oldText = m_address.text();
184 m_address.setState(state);
186
187 if (m_address.isTextGenerated() && oldText != m_address.text())
189}
190
197{
198 return m_address.county();
199}
200
202{
203 if (m_address.county() == county)
204 return;
205 QString oldText = m_address.text();
206 m_address.setCounty(county);
208
209 if (m_address.isTextGenerated() && oldText != m_address.text())
211}
212
219{
220 return m_address.city();
221}
222
224{
225 if (m_address.city() == city)
226 return;
227 QString oldText = m_address.text();
228 m_address.setCity(city);
230
231 if (m_address.isTextGenerated() && oldText != m_address.text())
233}
234
241{
242 return m_address.district();
243}
244
246{
247 if (m_address.district() == district)
248 return;
249 QString oldText = m_address.text();
250 m_address.setDistrict(district);
252
253 if (m_address.isTextGenerated() && oldText != m_address.text())
255}
256
268{
269 return m_address.street();
270}
271
273{
274 if (m_address.street() == street)
275 return;
276 QString oldText = m_address.text();
277 m_address.setStreet(street);
279
280 if (m_address.isTextGenerated() && oldText != m_address.text())
282}
283
293{
294 return m_address.streetNumber();
295}
296
298{
299 if (m_address.streetNumber() == streetNumber)
300 return;
301 QString oldText = m_address.text();
302 m_address.setStreetNumber(streetNumber);
304
305 if (m_address.isTextGenerated() && oldText != m_address.text())
307}
308
315{
316 return m_address.postalCode();
317}
318
320{
321 if (m_address.postalCode() == postalCode)
322 return;
323 QString oldText = m_address.text();
324 m_address.setPostalCode(postalCode);
326
327 if (m_address.isTextGenerated() && oldText != m_address.text())
329}
330
340{
341 return m_address.isTextGenerated();
342}
343
345
346#include "moc_qdeclarativegeoaddress_p.cpp"
void setCountry(const QString &country)
void setDistrict(const QString &district)
void setCountryCode(const QString &countryCode)
void setState(const QString &state)
void setText(const QString &address)
void setCity(const QString &city)
QDeclarativeGeoAddress(QObject *parent=0)
\qmltype Address \inqmlmodule QtPositioning
void setCounty(const QString &county)
void setPostalCode(const QString &postalCode)
void setStreetNumber(const QString &streetNumber)
void setAddress(const QGeoAddress &address)
void setStreet(const QString &street)
\inmodule QtPositioning
Definition qgeoaddress.h:18
bool isTextGenerated() const
Returns true if QGeoAddress::text() is automatically generated from address elements,...
QString district() const
Returns the district.
QString state() const
Returns the state.
void setCountryCode(const QString &countryCode)
Sets the countryCode according to ISO 3166-1 alpha-3.
void setCountry(const QString &country)
Sets the country name.
void setStreet(const QString &street)
Sets the street name to street.
QString street() const
Returns the street name.
void setCounty(const QString &county)
Sets the county.
void setText(const QString &text)
If text is not empty, explicitly assigns text as the string to be returned by text().
QString streetNumber() const
QString city() const
Returns the city.
void setStreetNumber(const QString &streetNumber)
void setPostalCode(const QString &postalCode)
Sets the postalCode.
QString countryCode() const
Returns the country code according to ISO 3166-1 alpha-3.
QString county() const
Returns the county.
QString postalCode() const
Returns the postal code.
QString country() const
Returns the country name.
QString text() const
Returns the address as a single formatted string.
void setDistrict(const QString &district)
Sets the district.
void setCity(const QString &city)
Sets the city.
void setState(const QString &state)
Sets the state.
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
else opt state
[0]
Combined button and popup list for selecting options.
GLuint GLuint64EXT address
#define emit