![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtLocation More...
#include <qplaceattribute.h>
Public Member Functions | |
QPlaceAttribute () | |
Constructs an attribute. | |
QPlaceAttribute (const QPlaceAttribute &other) noexcept | |
Creates a copy of other. | |
QPlaceAttribute (QPlaceAttribute &&other) noexcept=default | |
~QPlaceAttribute () | |
Destroys the attribute. | |
QPlaceAttribute & | operator= (const QPlaceAttribute &other) noexcept |
Assigns other to this attribute and returns a reference to this attribute. | |
void | swap (QPlaceAttribute &other) noexcept |
QString | label () const |
void | setLabel (const QString &label) |
QString | text () const |
void | setText (const QString &text) |
bool | isEmpty () const |
Returns a boolean indicating whether the all the fields of the place attribute are empty or not. | |
Static Public Attributes | |
static const QString | OpeningHours |
\qmltype ExtendedAttributes \nativetype QQmlPropertyMap \inqmlmodule QtLocation | |
static const QString | Payment |
\variable QPlaceAttribute::Payment The constant to specify an attribute that defines the methods of payment. | |
static const QString | Provider |
\variable QPlaceAttribute::Provider The constant to specify an attribute that defines which provider the place came from. | |
Properties | |
QML_STRUCTURED_VALUEQString | label |
\qmlproperty string placeAttribute::label | |
QString | text |
\qmlproperty string placeAttribute::text | |
Friends | |
bool | operator== (const QPlaceAttribute &lhs, const QPlaceAttribute &rhs) noexcept |
Returns true if lhs is equal to rhs, otherwise returns false. | |
bool | operator!= (const QPlaceAttribute &lhs, const QPlaceAttribute &rhs) noexcept |
Returns true if lhs is not equal to rhs, otherwise returns false. | |
\inmodule QtLocation
The QPlaceAttribute class represents generic attribute information about a place.
A QPlaceAttribute instance stores an additional piece of information about a place that is not otherwise exposed through the QPlace class. A QPlaceAttribute encapsulates a localized label which describes the attribute and rich text string representing the attribute's value. Generally, both are intended to be displayed to the end-user as is.
Some plugins may not support attributes at all, others may only support a certain set, others still may support a dynamically changing set of attributes over time or even allow attributes to be arbitrarily defined by the client application. The attributes could also vary on a place by place basis, for example one place may have opening hours while another does not. Consult the \l {Plugin References and Parameters}{plugin references} for details.
Definition at line 19 of file qplaceattribute.h.
QPlaceAttribute::QPlaceAttribute | ( | ) |
Constructs an attribute.
Definition at line 204 of file qplaceattribute.cpp.
|
defaultnoexcept |
Creates a copy of other.
|
defaultnoexcept |
|
default |
Destroys the attribute.
bool QPlaceAttribute::isEmpty | ( | ) | const |
Returns a boolean indicating whether the all the fields of the place attribute are empty or not.
Definition at line 298 of file qplaceattribute.cpp.
QString QPlaceAttribute::label | ( | ) | const |
Definition at line 264 of file qplaceattribute.cpp.
|
noexcept |
Assigns other to this attribute and returns a reference to this attribute.
Definition at line 223 of file qplaceattribute.cpp.
Definition at line 269 of file qplaceattribute.cpp.
Definition at line 289 of file qplaceattribute.cpp.
|
inlinenoexcept |
Definition at line 40 of file qplaceattribute.h.
QString QPlaceAttribute::text | ( | ) | const |
Definition at line 284 of file qplaceattribute.cpp.
|
friend |
Returns true if lhs is not equal to rhs, otherwise returns false.
Definition at line 44 of file qplaceattribute.h.
|
friend |
Returns true if lhs is equal to rhs, otherwise returns false.
Definition at line 42 of file qplaceattribute.h.
|
static |
\qmltype ExtendedAttributes \nativetype QQmlPropertyMap \inqmlmodule QtLocation
The ExtendedAttributes type holds additional data about a \l Place.
The ExtendedAttributes type is a map of \l {placeAttribute}{placeAttributes}. To access attributes in the map use the \l keys() method to get the list of keys stored in the map and use the {
[]} operator to access the \l placeAttribute items.
The following are standard keys that are defined by the API. \l Plugin implementations are free to define additional keys. Custom keys should be qualified by a unique prefix to avoid clashes. \table \header
Some plugins may not support attributes at all, others may only support a certain set, others still may support a dynamically changing set of attributes over time or even allow attributes to be arbitrarily defined by the client application. The attributes could also vary on a place by place basis, for example one place may have opening hours while another does not. Consult the \l {Plugin References and Parameters}{plugin references} for details.
Some attributes may not be intended to be readable by end users, the label field of such attributes is empty to indicate this fact.
The following example shows how to access all \l {placeAttribute}{placeAttributes} and print them to the console:
\codeline
The following example shows how to assign and modify an attribute:
\qmlmethod variant ExtendedAttributes::keys()
Returns an array of place attribute keys currently stored in the map.
\qmlsignal void ExtendedAttributes::valueChanged(string key, variant value)
This signal is emitted when the set of attributes changes. key is the key corresponding to the value that was changed.
The corresponding handler is onValueChanged
.
\qmlvaluetype placeAttribute \inqmlmodule QtLocation
The placeAttribute type holds generic place attribute information.
A place attribute stores an additional piece of information about a \l Place that is not otherwise exposed through the \l Place type. A placeAttribute is a textual piece of data, accessible through the \l {placeAttribute::}{text} property, and a \l {placeAttribute::}{label}. Both the l {placeAttribute::}{text} and \l {placeAttribute::}{label} properties are intended to be displayed to the user. placeAttributes are stored in an \l ExtendedAttributes map with a unique key.
The following example shows how to display all attributes in a list:
\codeline
The following example shows how to assign and modify an attribute:
\variable QPlaceAttribute::OpeningHours Specifies the opening hours.
Definition at line 28 of file qplaceattribute.h.
|
static |
\variable QPlaceAttribute::Payment The constant to specify an attribute that defines the methods of payment.
Definition at line 29 of file qplaceattribute.h.
|
static |
\variable QPlaceAttribute::Provider The constant to specify an attribute that defines which provider the place came from.
Definition at line 30 of file qplaceattribute.h.
|
readwrite |
\qmlproperty string placeAttribute::label
This property holds the attribute label which is a user visible string describing the attribute.
a localized label describing the attribute.
Definition at line 24 of file qplaceattribute.h.
|
readwrite |
\qmlproperty string placeAttribute::text
This property holds the attribute text which can be used to show additional information about the place.
a piece of rich text representing the attribute value.
Definition at line 25 of file qplaceattribute.h.