IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QPlaceIcon Class

The QPlaceIcon class represents an icon.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QPlaceIcon Class

  • Header: QPlaceIcon

  • qmake: QT += location

  • Group: QPlaceIcon is part of QtLocation-places, QtLocation-places-data

I. Detailed Description

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

 
Sélectionnez
QUrl iconSourceUrl = place.icon().url(QSize(32,32));

//A default icon may also be requested like so
iconSourceUrl = place.icon().url();

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 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.

II. Member Function Documentation

 

II-1. QPlaceIcon::QPlaceIcon()

Constructs an icon.

II-2. QPlaceIcon::QPlaceIcon(const QPlaceIcon &other)

Constructs a copy of other.

II-3. QPlaceIcon::~QPlaceIcon()

Destroys the icon.

II-4. bool QPlaceIcon::isEmpty() const

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

II-5. QPlaceManager *QPlaceIcon::manager() const

Returns the manager that this icon is associated with.

Getter function for property manager.

II-5-1. See Also

See also setManager()

II-6. 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 plugin documentation for what parameters are supported and how they should be used.

Getter function for property parameters.

II-6-1. See Also

See also setParameters()

II-7. void QPlaceIcon::setManager(QPlaceManager *manager)

Sets the manager that this icon is associated with. The icon does not take ownership of the pointer.

Setter function for property manager.

II-7-1. See Also

See also manager()

II-8. void QPlaceIcon::setParameters(const QVariantMap &parameters)

Sets the parameters of the icon to parameters.

Setter function for property parameters.

II-8-1. See Also

See also parameters()

II-9. 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.

II-10. QPlaceIcon &QPlaceIcon::operator=(const QPlaceIcon &other)

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

III. Member Variable Documentation

 

III-1. const QString 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.

IV. Related Non-Members

 

IV-1. bool operator!=(const QPlaceIcon &lhs, const QPlaceIcon &rhs)

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

IV-2. bool operator==(const QPlaceIcon &lhs, const QPlaceIcon &rhs)

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

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+