PySide6.QtLocation.QPlaceIcon

class QPlaceIcon

The QPlaceIcon class represents an icon. More

Synopsis

Properties

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

Warning

This section contains snippets that were automatically translated from C++ to Python and may contain errors.

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

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.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property managerᅟ: QPlaceManager
Access functions:
property parametersᅟ: Dictionary with keys of type .QString and values of type QVariant.
Access functions:
PySide6.QtLocation.QPlaceIcon.SingleUrl
__init__()

Constructs an icon.

__init__(other)
Parameters:

otherQPlaceIcon

Constructs a copy of other.

isEmpty()
Return type:

bool

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

manager()
Return type:

QPlaceManager

Returns the manager that this icon is associated with.

See also

setManager()

Getter of property managerᅟ .

__ne__(rhs)
Parameters:

rhsQPlaceIcon

Return type:

bool

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

__eq__(rhs)
Parameters:

rhsQPlaceIcon

Return type:

bool

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

parameters()
Return type:

Dictionary with keys of type .QString and values of type QVariant.

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.

See also

setParameters()

Getter of property parametersᅟ .

setManager(manager)
Parameters:

managerQPlaceManager

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

See also

manager()

Setter of property managerᅟ .

setParameters(parameters)
Parameters:

parameters – Dictionary with keys of type .QString and values of type QVariant.

Sets the parameters of the icon to parameters.

See also

parameters()

Setter of property parametersᅟ .

swap(other)
Parameters:

otherQPlaceIcon

url([size=QSize()])
Parameters:

sizeQSize

Return type:

QUrl

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.