Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QDeclarativeGeoAddress Class Reference

#include <qdeclarativegeoaddress_p.h>

+ Inheritance diagram for QDeclarativeGeoAddress:
+ Collaboration diagram for QDeclarativeGeoAddress:

Signals

void textChanged ()
 
void countryChanged ()
 
void countryCodeChanged ()
 
void stateChanged ()
 
void countyChanged ()
 
void cityChanged ()
 
void districtChanged ()
 
void streetChanged ()
 
void streetNumberChanged ()
 
void postalCodeChanged ()
 
void isTextGeneratedChanged ()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.
 

Public Member Functions

 QDeclarativeGeoAddress (QObject *parent=0)
 \qmltype Address \inqmlmodule QtPositioning
 
 QDeclarativeGeoAddress (const QGeoAddress &address, QObject *parent=0)
 
QGeoAddress address () const
 \qmlproperty QGeoAddress QtPositioning::Address::address
 
void setAddress (const QGeoAddress &address)
 
QString text () const
 \qmlproperty string QtPositioning::Address::text
 
void setText (const QString &address)
 
QString country () const
 \qmlproperty string QtPositioning::Address::country
 
void setCountry (const QString &country)
 
QString countryCode () const
 \qmlproperty string QtPositioning::Address::countryCode
 
void setCountryCode (const QString &countryCode)
 
QString state () const
 \qmlproperty string QtPositioning::Address::state
 
void setState (const QString &state)
 
QString county () const
 \qmlproperty string QtPositioning::Address::county
 
void setCounty (const QString &county)
 
QString city () const
 \qmlproperty string QtPositioning::Address::city
 
void setCity (const QString &city)
 
QString district () const
 \qmlproperty string QtPositioning::Address::district
 
void setDistrict (const QString &district)
 
QString street () const
 \qmlproperty string QtPositioning::Address::street
 
void setStreet (const QString &street)
 
QString streetNumber () const
 \qmlproperty string QtPositioning::Address::streetNumber
 
void setStreetNumber (const QString &streetNumber)
 
QString postalCode () const
 \qmlproperty string QtPositioning::Address::postalCode
 
void setPostalCode (const QString &postalCode)
 
bool isTextGenerated () const
 \qmlproperty bool QtPositioning::Address::isTextGenerated
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
 
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
 
QString objectName () const
 
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
 
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
 
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
 
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
 
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
 
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
 
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
 
template<typename T >
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
 
template<typename T >
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QObjectListchildren () const
 Returns a list of child objects.
 
void setParent (QObject *parent)
 Makes the object a child of parent.
 
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
 
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
 
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
 
bool setProperty (const char *name, QVariant &&value)
 
QVariant property (const char *name) const
 Returns the value of the object's name property.
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 Returns a pointer to the parent object.
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
 

Properties

QGeoAddress address
 
QString text
 
QString country
 
QString countryCode
 
QString state
 
QString county
 
QString city
 
QString district
 
QString street
 
QString streetNumber
 
QString postalCode
 
bool isTextGenerated
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
 
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
 
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

Definition at line 25 of file qdeclarativegeoaddress_p.h.

Constructor & Destructor Documentation

◆ QDeclarativeGeoAddress() [1/2]

QT_BEGIN_NAMESPACE QDeclarativeGeoAddress::QDeclarativeGeoAddress ( QObject * parent = 0)
explicit

\qmltype Address \inqmlmodule QtPositioning

Since
5.2

The Address QML type represents a specific location as a street address.

An Address is used as a unit of data for queries such as (Reverse) Geocoding or Places searches – many of these operations either accept an Address or return one.

Not all properties of an Address are necessarily available or relevant in all parts of the world and all locales. The \l district, \l state and \l county properties are particularly area-specific for many data sources, and often only one or two of these are available or useful.

The Address has a \l text property which holds a formatted string. It is the recommended way to display an address to the user and typically takes the format of an address as found on an envelope, but this is not always the case. The \l text may be automatically generated from constituent address properties such as \l street, \l city and and so on, but can also be explicitly assigned. See \l text for details.

Definition at line 51 of file qdeclarativegeoaddress.cpp.

◆ QDeclarativeGeoAddress() [2/2]

QDeclarativeGeoAddress::QDeclarativeGeoAddress ( const QGeoAddress & address,
QObject * parent = 0 )

Definition at line 56 of file qdeclarativegeoaddress.cpp.

Member Function Documentation

◆ address()

QGeoAddress QDeclarativeGeoAddress::address ( ) const

\qmlproperty QGeoAddress QtPositioning::Address::address

For details on how to use this property to interface between C++ and QML see "\l {Address - QGeoAddress} {Interfaces between C++ and QML Code}".

Definition at line 67 of file qdeclarativegeoaddress.cpp.

◆ city()

QString QDeclarativeGeoAddress::city ( ) const

\qmlproperty string QtPositioning::Address::city

This property holds the city of the address as a single formatted string.

Definition at line 218 of file qdeclarativegeoaddress.cpp.

◆ cityChanged

void QDeclarativeGeoAddress::cityChanged ( )
signal

◆ country()

QString QDeclarativeGeoAddress::country ( ) const

\qmlproperty string QtPositioning::Address::country

This property holds the country of the address as a single formatted string.

Definition at line 130 of file qdeclarativegeoaddress.cpp.

◆ countryChanged

void QDeclarativeGeoAddress::countryChanged ( )
signal

◆ countryCode()

QString QDeclarativeGeoAddress::countryCode ( ) const

\qmlproperty string QtPositioning::Address::countryCode

This property holds the country code of the address as a single formatted string.

Definition at line 152 of file qdeclarativegeoaddress.cpp.

◆ countryCodeChanged

void QDeclarativeGeoAddress::countryCodeChanged ( )
signal

◆ county()

QString QDeclarativeGeoAddress::county ( ) const

\qmlproperty string QtPositioning::Address::county

This property holds the county of the address as a single formatted string.

Definition at line 196 of file qdeclarativegeoaddress.cpp.

◆ countyChanged

void QDeclarativeGeoAddress::countyChanged ( )
signal

◆ district()

QString QDeclarativeGeoAddress::district ( ) const

\qmlproperty string QtPositioning::Address::district

This property holds the district of the address as a single formatted string.

Definition at line 240 of file qdeclarativegeoaddress.cpp.

◆ districtChanged

void QDeclarativeGeoAddress::districtChanged ( )
signal

◆ isTextGenerated()

bool QDeclarativeGeoAddress::isTextGenerated ( ) const

\qmlproperty bool QtPositioning::Address::isTextGenerated

This property holds a boolean that if true, indicates that \l text is automatically generated from address properties. If false, it indicates that the \l text has been explicitly assigned.

Definition at line 339 of file qdeclarativegeoaddress.cpp.

◆ isTextGeneratedChanged

void QDeclarativeGeoAddress::isTextGeneratedChanged ( )
signal

◆ postalCode()

QString QDeclarativeGeoAddress::postalCode ( ) const

\qmlproperty string QtPositioning::Address::postalCode

This property holds the postal code of the address as a single formatted string.

Definition at line 314 of file qdeclarativegeoaddress.cpp.

◆ postalCodeChanged

void QDeclarativeGeoAddress::postalCodeChanged ( )
signal

◆ setAddress()

void QDeclarativeGeoAddress::setAddress ( const QGeoAddress & address)

Definition at line 72 of file qdeclarativegeoaddress.cpp.

◆ setCity()

void QDeclarativeGeoAddress::setCity ( const QString & city)

Definition at line 223 of file qdeclarativegeoaddress.cpp.

◆ setCountry()

void QDeclarativeGeoAddress::setCountry ( const QString & country)

Definition at line 135 of file qdeclarativegeoaddress.cpp.

◆ setCountryCode()

void QDeclarativeGeoAddress::setCountryCode ( const QString & countryCode)

Definition at line 157 of file qdeclarativegeoaddress.cpp.

◆ setCounty()

void QDeclarativeGeoAddress::setCounty ( const QString & county)

Definition at line 201 of file qdeclarativegeoaddress.cpp.

◆ setDistrict()

void QDeclarativeGeoAddress::setDistrict ( const QString & district)

Definition at line 245 of file qdeclarativegeoaddress.cpp.

◆ setPostalCode()

void QDeclarativeGeoAddress::setPostalCode ( const QString & postalCode)

Definition at line 319 of file qdeclarativegeoaddress.cpp.

◆ setState()

void QDeclarativeGeoAddress::setState ( const QString & state)

Definition at line 179 of file qdeclarativegeoaddress.cpp.

◆ setStreet()

void QDeclarativeGeoAddress::setStreet ( const QString & street)

Definition at line 272 of file qdeclarativegeoaddress.cpp.

◆ setStreetNumber()

void QDeclarativeGeoAddress::setStreetNumber ( const QString & streetNumber)

Definition at line 297 of file qdeclarativegeoaddress.cpp.

◆ setText()

void QDeclarativeGeoAddress::setText ( const QString & address)

Definition at line 113 of file qdeclarativegeoaddress.cpp.

◆ state()

QString QDeclarativeGeoAddress::state ( ) const

\qmlproperty string QtPositioning::Address::state

This property holds the state of the address as a single formatted string.

Definition at line 174 of file qdeclarativegeoaddress.cpp.

◆ stateChanged

void QDeclarativeGeoAddress::stateChanged ( )
signal

◆ street()

QString QDeclarativeGeoAddress::street ( ) const

\qmlproperty string QtPositioning::Address::street

This property holds the street of the address.

Note
Before Qt6 this property could also contain things like a unit number, a building name, or anything else that might be used to distinguish one address from another. Since Qt6 use \l{QtPositioning::Address::}{streetNumber} property for such information.

Definition at line 267 of file qdeclarativegeoaddress.cpp.

◆ streetChanged

void QDeclarativeGeoAddress::streetChanged ( )
signal

◆ streetNumber()

QString QDeclarativeGeoAddress::streetNumber ( ) const

\qmlproperty string QtPositioning::Address::streetNumber

Since
QtPositioning 6.2

This property holds the street number of the address like a unit number, a building name, or anything else that might be used to distinguish one address from another.

Definition at line 292 of file qdeclarativegeoaddress.cpp.

◆ streetNumberChanged

void QDeclarativeGeoAddress::streetNumberChanged ( )
signal

◆ text()

QString QDeclarativeGeoAddress::text ( ) const

\qmlproperty string QtPositioning::Address::text

This property holds 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 \l isTextGenerated.

If an empty string is assigned to text, then \l isTextGenerated will be set to true and text will return a string which is locally formatted according to \l countryCode and based on the properties of the address. Modifying the address properties such as \l street, \l city and so on may cause the contents of text to change.

If a non-empty string is assigned to text, then \l isTextGenerated will be set to false and text will always return the explicitly assigned string. Modifying address properties will not affect the text property.

Definition at line 108 of file qdeclarativegeoaddress.cpp.

◆ textChanged

void QDeclarativeGeoAddress::textChanged ( )
signal

Property Documentation

◆ address

QGeoAddress QDeclarativeGeoAddress::address
readwrite

Definition at line 31 of file qdeclarativegeoaddress_p.h.

◆ city

QString QDeclarativeGeoAddress::city
readwrite

Definition at line 37 of file qdeclarativegeoaddress_p.h.

◆ country

QString QDeclarativeGeoAddress::country
readwrite

Definition at line 33 of file qdeclarativegeoaddress_p.h.

◆ countryCode

QString QDeclarativeGeoAddress::countryCode
readwrite

Definition at line 34 of file qdeclarativegeoaddress_p.h.

◆ county

QString QDeclarativeGeoAddress::county
readwrite

Definition at line 36 of file qdeclarativegeoaddress_p.h.

◆ district

QString QDeclarativeGeoAddress::district
readwrite

Definition at line 38 of file qdeclarativegeoaddress_p.h.

◆ isTextGenerated

bool QDeclarativeGeoAddress::isTextGenerated
read

Definition at line 43 of file qdeclarativegeoaddress_p.h.

◆ postalCode

QString QDeclarativeGeoAddress::postalCode
readwrite

Definition at line 42 of file qdeclarativegeoaddress_p.h.

◆ state

QString QDeclarativeGeoAddress::state
readwrite

Definition at line 35 of file qdeclarativegeoaddress_p.h.

◆ street

QString QDeclarativeGeoAddress::street
readwrite

Definition at line 39 of file qdeclarativegeoaddress_p.h.

◆ streetNumber

QString QDeclarativeGeoAddress::streetNumber
readwrite

Definition at line 40 of file qdeclarativegeoaddress_p.h.

◆ text

QString QDeclarativeGeoAddress::text
readwrite

Definition at line 32 of file qdeclarativegeoaddress_p.h.


The documentation for this class was generated from the following files: