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
QPlaceIcon Class Reference

\inmodule QtLocation More...

#include <qplaceicon.h>

+ Collaboration diagram for QPlaceIcon:

Public Member Functions

 QPlaceIcon ()
 Constructs an icon.
 
 QPlaceIcon (const QPlaceIcon &other) noexcept
 Constructs a copy of other.
 
 QPlaceIcon (QPlaceIcon &&other) noexcept=default
 
 ~QPlaceIcon ()
 Destroys the icon.
 
QPlaceIconoperator= (const QPlaceIcon &other) noexcept
 Assigns other to this icon and returns a reference to this icon.
 
void swap (QPlaceIcon &other) noexcept
 
Q_INVOKABLE QUrl url (const QSize &size=QSize()) const
 Returns an icon URL according to the given size.
 
QPlaceManagermanager () const
 Returns the manager that this icon is associated with.
 
void setManager (QPlaceManager *manager)
 Sets the manager that this icon is associated with.
 
QVariantMap parameters () const
 Returns a set of parameters for the icon that are manager/plugin specific.
 
void setParameters (const QVariantMap &parameters)
 Sets the parameters of the icon to parameters.
 
bool isEmpty () const
 Returns a boolean indicating whether the all the fields of the icon are empty or not.
 

Static Public Attributes

static const QString SingleUrl
 \qmlvaluetype icon \inqmlmodule QtLocation
 

Properties

QML_STRUCTURED_VALUEQVariantMap parameters
 
QPlaceManagermanager
 

Friends

bool operator== (const QPlaceIcon &lhs, const QPlaceIcon &rhs) noexcept
 Returns true if lhs is equal to rhs, otherwise returns false.
 
bool operator!= (const QPlaceIcon &lhs, const QPlaceIcon &rhs) noexcept
 Returns true if lhs is not equal to rhs, otherwise returns false.
 

Detailed Description

\inmodule QtLocation

Since
5.6

The QPlaceIcon class represents an icon.

The typical usage of an icon is to use the url() function to specify a preferred icon size.

The icons are typically backend dependent, if a manager backend does not support a given size, the URL of the icon that most closely matches those parameters is returned.

The icon class also has a key-value set of parameters. The precise key one needs to use depends on the \l {Qt Location::Plugin References and Parameters}{plugin} being used. These parameters influence which icon URL is returned by the manager and may also be used to specify icon URL locations when saving icons.

If there is only ever one image for an icon, then QPlaceIcon::SingleUrl can be used as a parameter key with a QUrl as the associated value. If this key is set, then the url() function will always return the specified URL and not defer to any manager.

Definition at line 22 of file qplaceicon.h.

Constructor & Destructor Documentation

◆ QPlaceIcon() [1/3]

QPlaceIcon::QPlaceIcon ( )

Constructs an icon.

Definition at line 88 of file qplaceicon.cpp.

◆ QPlaceIcon() [2/3]

QPlaceIcon::QPlaceIcon ( const QPlaceIcon & other)
defaultnoexcept

Constructs a copy of other.

◆ QPlaceIcon() [3/3]

QPlaceIcon::QPlaceIcon ( QPlaceIcon && other)
defaultnoexcept

◆ ~QPlaceIcon()

QPlaceIcon::~QPlaceIcon ( )
default

Destroys the icon.

Member Function Documentation

◆ isEmpty()

bool QPlaceIcon::isEmpty ( ) const

Returns a boolean indicating whether the all the fields of the icon are empty or not.

Definition at line 204 of file qplaceicon.cpp.

References QMap< Key, T >::isEmpty(), QPlaceIconPrivate::manager, and QPlaceIconPrivate::parameters.

Referenced by QPlaceSupplierPrivate::isEmpty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ manager()

QPlaceManager * QPlaceIcon::manager ( ) const

Returns the manager that this icon is associated with.

Definition at line 187 of file qplaceicon.cpp.

References QPlaceIconPrivate::manager.

◆ operator=()

QPlaceIcon & QPlaceIcon::operator= ( const QPlaceIcon & other)
noexcept

Assigns other to this icon and returns a reference to this icon.

Definition at line 106 of file qplaceicon.cpp.

References d, and other().

+ Here is the call graph for this function:

◆ parameters()

QVariantMap QPlaceIcon::parameters ( ) const

Returns a set of parameters for the icon that are manager/plugin specific.

These parameters are used by the manager to return the appropriate URL when url() is called and to specify locations to save to when saving icons.

Consult the \l {Qt Location::Plugin References and Parameters}{plugin documentation} for what parameters are supported and how they should be used.

Definition at line 171 of file qplaceicon.cpp.

References QPlaceIconPrivate::parameters.

◆ setManager()

void QPlaceIcon::setManager ( QPlaceManager * manager)

Sets the manager that this icon is associated with.

The icon does not take ownership of the pointer.

Definition at line 196 of file qplaceicon.cpp.

References manager, and QPlaceIconPrivate::manager.

◆ setParameters()

void QPlaceIcon::setParameters ( const QVariantMap & parameters)

Sets the parameters of the icon to parameters.

Definition at line 179 of file qplaceicon.cpp.

References parameters, and QPlaceIconPrivate::parameters.

◆ swap()

void QPlaceIcon::swap ( QPlaceIcon & other)
inlinenoexcept

Definition at line 42 of file qplaceicon.h.

References d, other(), and swap().

Referenced by swap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ url()

QUrl QPlaceIcon::url ( const QSize & size = QSize()) const

Returns an icon URL according to the given size.

If no manager has been assigned to the icon, and the parameters do not contain the QPlaceIcon::SingleUrl key, a default constructed QUrl is returned.

Definition at line 144 of file qplaceicon.cpp.

References QPlaceManagerEngine::constructIconUrl(), QMap< Key, T >::contains(), QUrl::fromUserInput(), QPlaceIconPrivate::manager, QPlaceIconPrivate::parameters, SingleUrl, QVariant::toUrl(), and QMap< Key, T >::value().

Referenced by RequestHandler::icon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool QPlaceIcon::operator!= ( const QPlaceIcon & lhs,
const QPlaceIcon & rhs )
friend

Returns true if lhs is not equal to rhs, otherwise returns false.

Definition at line 46 of file qplaceicon.h.

◆ operator==

bool QPlaceIcon::operator== ( const QPlaceIcon & lhs,
const QPlaceIcon & rhs )
friend

Returns true if lhs is equal to rhs, otherwise returns false.

Definition at line 44 of file qplaceicon.h.

Member Data Documentation

◆ SingleUrl

const QString QPlaceIcon::SingleUrl
static

\qmlvaluetype icon \inqmlmodule QtLocation

Since
QtLocation 5.5

The icon type represents the icon of a place.

The typical usage of an icon is to use the url() function to specify a preferred icon size.

The icons are typically backend dependent, if a manager backend does not support a given size, the URL of the icon that most closely matches those parameters is returned.

The icon class also has a key-value set of parameters. The precise key one needs to use depends on the \l {Qt Location::Plugin References and Parameters}{plugin} being used. These parameters influence which icon URL is returned by the manager and may also be used to specify icon URL locations when saving icons.

If there is only ever one image for an icon, then QPlaceIcon::SingleUrl can be used as a parameter key with a QUrl as the associated value. If this key is set, then the url() function will always return the specified URL and not defer to any manager.

\variable QPlaceIcon::SingleUrl

Parameter key for an icon that only has a single image URL.

The parameter value to be used with this key is a QUrl. An icon with this parameter set will always return the specified URL regardless of the requested size when url() is called.

Definition at line 32 of file qplaceicon.h.

Referenced by QPlaceManagerEngineNokiaV2::icon(), QT_BEGIN_NAMESPACE::parsePlaceResult(), and url().

Property Documentation

◆ manager

QPlaceManager * QPlaceIcon::manager
readwrite

Definition at line 29 of file qplaceicon.h.

Referenced by setManager().

◆ parameters

QML_STRUCTURED_VALUEQVariantMap QPlaceIcon::parameters
readwrite

Definition at line 28 of file qplaceicon.h.

Referenced by setParameters().


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