QGeoAddressclass represents an address of aQGeoLocation. 更多 …
def
__eq__
(other)
def
__ne__
(other)
def
city
()
def
clear
()
def
country
()
def
countryCode
()
def
county
()
def
district
()
def
isEmpty
()
def
isTextGenerated
()
def
postalCode
()
def
setCity
(city)
def
setCountry
(country)
def
setCountryCode
(countryCode)
def
setCounty
(county)
def
setDistrict
(district)
def
setPostalCode
(postalCode)
def
setState
(state)
def
setStreet
(street)
def
setText
(text)
def
state
()
def
street
()
def
text
()
The address’ attributes are normalized to US feature names and can be mapped to the local feature levels (for example State matches “Bundesland” in Germany).
The address contains a
text()for displaying purposes and additional properties to access the components of an address:
QGeoAddress
¶
QGeoAddress(other)
- param other
Default constructor.
构造副本为
other
.
PySide2.QtPositioning.QGeoAddress.
clear
(
)
¶
Clears all of the address’ data fields.
PySide2.QtPositioning.QGeoAddress.
country
(
)
¶
unicode
Returns the country name.
另请参阅
PySide2.QtPositioning.QGeoAddress.
countryCode
(
)
¶
unicode
Returns the country code according to ISO 3166-1 alpha-3
另请参阅
PySide2.QtPositioning.QGeoAddress.
county
(
)
¶
unicode
Returns the county. The county is considered the second subdivision below country.
另请参阅
PySide2.QtPositioning.QGeoAddress.
district
(
)
¶
unicode
Returns the district. The district is considered the subdivison below city.
另请参阅
PySide2.QtPositioning.QGeoAddress.
isEmpty
(
)
¶
bool
Returns whether this address is empty. An address is considered empty if all of its fields are empty.
PySide2.QtPositioning.QGeoAddress.
isTextGenerated
(
)
¶
bool
返回 true 若
text()
is automatically generated from address elements, otherwise returns false if
text()
has been explicitly assigned.
PySide2.QtPositioning.QGeoAddress.
__ne__
(
other
)
¶
other
–
QGeoAddress
bool
Returns true if this address is not equal to
other
,否则返回 false。
PySide2.QtPositioning.QGeoAddress.
__eq__
(
other
)
¶
other
–
QGeoAddress
bool
Returns true if this address is equal to
other
,否则返回 false。
PySide2.QtPositioning.QGeoAddress.
postalCode
(
)
¶
unicode
Returns the postal code.
另请参阅
PySide2.QtPositioning.QGeoAddress.
setCountry
(
country
)
¶
country – unicode
设置
country
name.
另请参阅
PySide2.QtPositioning.QGeoAddress.
setCountryCode
(
countryCode
)
¶
countryCode – unicode
设置
countryCode
according to ISO 3166-1 alpha-3
另请参阅
PySide2.QtPositioning.QGeoAddress.
setCounty
(
county
)
¶
county – unicode
设置
county
.
另请参阅
PySide2.QtPositioning.QGeoAddress.
setDistrict
(
district
)
¶
district – unicode
设置
district
.
另请参阅
PySide2.QtPositioning.QGeoAddress.
setPostalCode
(
postalCode
)
¶
postalCode – unicode
设置
postalCode
.
另请参阅
PySide2.QtPositioning.QGeoAddress.
setStreet
(
street
)
¶
street – unicode
Sets the street-level component of the address to
street
.
This typically includes a street number and street name but may also contain things like a unit number, a building name, or anything else that might be used to distinguish one address from another.
另请参阅
PySide2.QtPositioning.QGeoAddress.
setText
(
text
)
¶
text – unicode
若
text
is not empty, explicitly assigns
text
as the string to be returned by
text()
.
isTextGenerated()
will return false.
若
text
is empty, indicates that
text()
should be automatically generated from the address elements.
isTextGenerated()
will return true.
另请参阅
PySide2.QtPositioning.QGeoAddress.
state
(
)
¶
unicode
Returns the state. The state is considered the first subdivision below country.
另请参阅
PySide2.QtPositioning.QGeoAddress.
street
(
)
¶
unicode
Returns the street-level component of the address.
This typically includes a street number and street name but may also contain things like a unit number, a building name, or anything else that might be used to distinguish one address from another.
另请参阅
PySide2.QtPositioning.QGeoAddress.
text
(
)
¶
unicode
Returns the address as a single formatted string. It is the recommended string to use to display the address to the user. It typically takes the format of an address as found on an envelope, but this is not always necessarily the case.
The address text is either automatically generated or explicitly assigned. This can be determined by checking
isTextGenerated
.
If an empty string is provided to
setText()
,那么
isTextGenerated()
will be set to true and will return a string which is locally formatted according to
countryCode()
and based on the elements of the address such as street, city and so on. Because the text string is generated from the address elements, a sequence of calls such as ,
setStreet()
, may return different strings for each invocation of .
If a non-empty string is provided to
setText()
,那么
isTextGenerated()
will be set to false and will always return the explicitly assigned string. Calls to modify other elements such as
setStreet()
,
setCity()
and so on will not affect the resultant string from .
另请参阅