内容表

上一话题

PySide2.QtPositioning

下一话题

QGeoAreaMonitorInfo

QGeoAddress

QGeoAddress class represents an address of a QGeoLocation . 更多

Inheritance diagram of PySide2.QtPositioning.QGeoAddress

概要

函数

详细描述

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:

class QGeoAddress

QGeoAddress(other)

param other

QGeoAddress

Default constructor.

构造副本为 other .

PySide2.QtPositioning.QGeoAddress. city ( )
返回类型

unicode

Returns the city.

另请参阅

setCity()

PySide2.QtPositioning.QGeoAddress. clear ( )

Clears all of the address’ data fields.

PySide2.QtPositioning.QGeoAddress. country ( )
返回类型

unicode

Returns the country name.

另请参阅

setCountry()

PySide2.QtPositioning.QGeoAddress. countryCode ( )
返回类型

unicode

Returns the country code according to ISO 3166-1 alpha-3

另请参阅

setCountryCode()

PySide2.QtPositioning.QGeoAddress. county ( )
返回类型

unicode

Returns the county. The county is considered the second subdivision below country.

另请参阅

setCounty()

PySide2.QtPositioning.QGeoAddress. district ( )
返回类型

unicode

Returns the district. The district is considered the subdivison below city.

另请参阅

setDistrict()

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.

另请参阅

setPostalCode()

PySide2.QtPositioning.QGeoAddress. setCity ( city )
参数

city – unicode

设置 city .

另请参阅

city()

PySide2.QtPositioning.QGeoAddress. setCountry ( country )
参数

country – unicode

设置 country name.

另请参阅

country()

PySide2.QtPositioning.QGeoAddress. setCountryCode ( countryCode )
参数

countryCode – unicode

设置 countryCode according to ISO 3166-1 alpha-3

另请参阅

countryCode()

PySide2.QtPositioning.QGeoAddress. setCounty ( county )
参数

county – unicode

设置 county .

另请参阅

county()

PySide2.QtPositioning.QGeoAddress. setDistrict ( district )
参数

district – unicode

设置 district .

另请参阅

district()

PySide2.QtPositioning.QGeoAddress. setPostalCode ( postalCode )
参数

postalCode – unicode

设置 postalCode .

另请参阅

postalCode()

PySide2.QtPositioning.QGeoAddress. setState ( state )
参数

state – unicode

设置 state .

另请参阅

state()

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.

另请参阅

street()

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.

另请参阅

text()

PySide2.QtPositioning.QGeoAddress. state ( )
返回类型

unicode

Returns the state. The state is considered the first subdivision below country.

另请参阅

setState()

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.

另请参阅

setStreet()

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 .

另请参阅

setText()