[][src]Struct qt_gui::QIcon

#[repr(C)]pub struct QIcon { /* fields omitted */ }

The QIcon class provides scalable icons in different modes and states.

C++ class: QIcon.

C++ documentation:

The QIcon class provides scalable icons in different modes and states.

A QIcon can generate smaller, larger, active, and disabled pixmaps from the set of pixmaps it is given. Such pixmaps are used by Qt widgets to show an icon representing a particular action.

The simplest use of QIcon is to create one from a QPixmap file or resource, and then use it, allowing Qt to work out all the required icon styles and sizes. For example:

QToolButton *button = new QToolButton; button->setIcon(QIcon("open.xpm"));

To undo a QIcon, simply set a null icon in its place:

button->setIcon(QIcon());

Use the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions to retrieve a complete list of the supported file formats.

When you retrieve a pixmap using pixmap(QSize, Mode, State), and no pixmap for this given size, mode and state has been added with addFile() or addPixmap(), then QIcon will generate one on the fly. This pixmap generation happens in a QIconEngine. The default engine scales pixmaps down if required, but never up, and it uses the current style to calculate a disabled appearance. By using custom icon engines, you can customize every aspect of generated icons. With QIconEnginePlugin it is possible to register different icon engines for different file suffixes, making it possible for third parties to provide additional icon engines to those included with Qt.

Note: Since Qt 4.2, an icon engine that supports SVG is included.

Methods

impl QIcon[src]

pub unsafe fn actual_size_q_size_mode_state(
    &self,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode,
    state: State
) -> CppBox<QSize>
[src]

Returns the actual size of the icon for the requested size, mode, and state. The result might be smaller than requested, but never larger. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

Calls C++ function: QSize QIcon::actualSize(const QSize& size, QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

Returns the actual size of the icon for the requested size, mode, and state. The result might be smaller than requested, but never larger. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

See also pixmap() and paint().

pub unsafe fn actual_size_q_window_q_size_mode_state(
    &self,
    window: impl CastInto<Ptr<QWindow>>,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode,
    state: State
) -> CppBox<QSize>
[src]

Returns the actual size of the icon for the requested window size, mode, and state.

Calls C++ function: QSize QIcon::actualSize(QWindow* window, const QSize& size, QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

Returns the actual size of the icon for the requested window size, mode, and state.

The pixmap can be smaller than the requested size. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

This function was introduced in Qt 5.1.

See also actualSize(), pixmap(), and paint().

pub unsafe fn actual_size_q_size_mode(
    &self,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode
) -> CppBox<QSize>
[src]

Returns the actual size of the icon for the requested size, mode, and state. The result might be smaller than requested, but never larger. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

Calls C++ function: QSize QIcon::actualSize(const QSize& size, QIcon::Mode mode = …) const.

C++ documentation:

Returns the actual size of the icon for the requested size, mode, and state. The result might be smaller than requested, but never larger. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

See also pixmap() and paint().

pub unsafe fn actual_size_q_size(
    &self,
    size: impl CastInto<Ref<QSize>>
) -> CppBox<QSize>
[src]

Returns the actual size of the icon for the requested size, mode, and state. The result might be smaller than requested, but never larger. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

Calls C++ function: QSize QIcon::actualSize(const QSize& size) const.

C++ documentation:

Returns the actual size of the icon for the requested size, mode, and state. The result might be smaller than requested, but never larger. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

See also pixmap() and paint().

pub unsafe fn actual_size_q_window_q_size_mode(
    &self,
    window: impl CastInto<Ptr<QWindow>>,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode
) -> CppBox<QSize>
[src]

Returns the actual size of the icon for the requested window size, mode, and state.

Calls C++ function: QSize QIcon::actualSize(QWindow* window, const QSize& size, QIcon::Mode mode = …) const.

C++ documentation:

Returns the actual size of the icon for the requested window size, mode, and state.

The pixmap can be smaller than the requested size. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

This function was introduced in Qt 5.1.

See also actualSize(), pixmap(), and paint().

pub unsafe fn actual_size_q_window_q_size(
    &self,
    window: impl CastInto<Ptr<QWindow>>,
    size: impl CastInto<Ref<QSize>>
) -> CppBox<QSize>
[src]

Returns the actual size of the icon for the requested window size, mode, and state.

Calls C++ function: QSize QIcon::actualSize(QWindow* window, const QSize& size) const.

C++ documentation:

Returns the actual size of the icon for the requested window size, mode, and state.

The pixmap can be smaller than the requested size. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

This function was introduced in Qt 5.1.

See also actualSize(), pixmap(), and paint().

pub unsafe fn add_file_4a(
    &self,
    file_name: impl CastInto<Ref<QString>>,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode,
    state: State
)
[src]

Adds an image from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.

Calls C++ function: void QIcon::addFile(const QString& fileName, const QSize& size = …, QIcon::Mode mode = …, QIcon::State state = …).

C++ documentation:

Adds an image from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.

If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

The file name can refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed images and other resource files in the application's executable.

Use the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions to retrieve a complete list of the supported file formats.

If a high resolution version of the image exists (identified by the suffix @2x on the base name), it is automatically loaded and added with the device pixel ratio set to a value of 2. This can be disabled by setting the environment variable QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING (see QImageReader).

Note: When you add a non-empty filename to a QIcon, the icon becomes non-null, even if the file doesn't exist or points to a corrupt file.

See also addPixmap() and QPixmap::devicePixelRatio().

pub unsafe fn add_file_3a(
    &self,
    file_name: impl CastInto<Ref<QString>>,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode
)
[src]

Adds an image from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.

Calls C++ function: void QIcon::addFile(const QString& fileName, const QSize& size = …, QIcon::Mode mode = …).

C++ documentation:

Adds an image from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.

If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

The file name can refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed images and other resource files in the application's executable.

Use the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions to retrieve a complete list of the supported file formats.

If a high resolution version of the image exists (identified by the suffix @2x on the base name), it is automatically loaded and added with the device pixel ratio set to a value of 2. This can be disabled by setting the environment variable QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING (see QImageReader).

Note: When you add a non-empty filename to a QIcon, the icon becomes non-null, even if the file doesn't exist or points to a corrupt file.

See also addPixmap() and QPixmap::devicePixelRatio().

pub unsafe fn add_file_2a(
    &self,
    file_name: impl CastInto<Ref<QString>>,
    size: impl CastInto<Ref<QSize>>
)
[src]

Adds an image from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.

Calls C++ function: void QIcon::addFile(const QString& fileName, const QSize& size = …).

C++ documentation:

Adds an image from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.

If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

The file name can refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed images and other resource files in the application's executable.

Use the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions to retrieve a complete list of the supported file formats.

If a high resolution version of the image exists (identified by the suffix @2x on the base name), it is automatically loaded and added with the device pixel ratio set to a value of 2. This can be disabled by setting the environment variable QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING (see QImageReader).

Note: When you add a non-empty filename to a QIcon, the icon becomes non-null, even if the file doesn't exist or points to a corrupt file.

See also addPixmap() and QPixmap::devicePixelRatio().

pub unsafe fn add_file_1a(&self, file_name: impl CastInto<Ref<QString>>)[src]

Adds an image from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.

Calls C++ function: void QIcon::addFile(const QString& fileName).

C++ documentation:

Adds an image from the file with the given fileName to the icon, as a specialization for size, mode and state. The file will be loaded on demand. Note: custom icon engines are free to ignore additionally added pixmaps.

If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

The file name can refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed images and other resource files in the application's executable.

Use the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions to retrieve a complete list of the supported file formats.

If a high resolution version of the image exists (identified by the suffix @2x on the base name), it is automatically loaded and added with the device pixel ratio set to a value of 2. This can be disabled by setting the environment variable QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING (see QImageReader).

Note: When you add a non-empty filename to a QIcon, the icon becomes non-null, even if the file doesn't exist or points to a corrupt file.

See also addPixmap() and QPixmap::devicePixelRatio().

pub unsafe fn add_pixmap_3a(
    &self,
    pixmap: impl CastInto<Ref<QPixmap>>,
    mode: Mode,
    state: State
)
[src]

Adds pixmap to the icon, as a specialization for mode and state.

Calls C++ function: void QIcon::addPixmap(const QPixmap& pixmap, QIcon::Mode mode = …, QIcon::State state = …).

C++ documentation:

Adds pixmap to the icon, as a specialization for mode and state.

Custom icon engines are free to ignore additionally added pixmaps.

See also addFile().

pub unsafe fn add_pixmap_2a(
    &self,
    pixmap: impl CastInto<Ref<QPixmap>>,
    mode: Mode
)
[src]

Adds pixmap to the icon, as a specialization for mode and state.

Calls C++ function: void QIcon::addPixmap(const QPixmap& pixmap, QIcon::Mode mode = …).

C++ documentation:

Adds pixmap to the icon, as a specialization for mode and state.

Custom icon engines are free to ignore additionally added pixmaps.

See also addFile().

pub unsafe fn add_pixmap_1a(&self, pixmap: impl CastInto<Ref<QPixmap>>)[src]

Adds pixmap to the icon, as a specialization for mode and state.

Calls C++ function: void QIcon::addPixmap(const QPixmap& pixmap).

C++ documentation:

Adds pixmap to the icon, as a specialization for mode and state.

Custom icon engines are free to ignore additionally added pixmaps.

See also addFile().

pub unsafe fn available_sizes_2a(
    &self,
    mode: Mode,
    state: State
) -> CppBox<QListOfQSize>
[src]

Returns a list of available icon sizes for the specified mode and state.

Calls C++ function: QList<QSize> QIcon::availableSizes(QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

Returns a list of available icon sizes for the specified mode and state.

This function was introduced in Qt 4.5.

pub unsafe fn available_sizes_1a(&self, mode: Mode) -> CppBox<QListOfQSize>[src]

Returns a list of available icon sizes for the specified mode and state.

Calls C++ function: QList<QSize> QIcon::availableSizes(QIcon::Mode mode = …) const.

C++ documentation:

Returns a list of available icon sizes for the specified mode and state.

This function was introduced in Qt 4.5.

pub unsafe fn available_sizes_0a(&self) -> CppBox<QListOfQSize>[src]

Returns a list of available icon sizes for the specified mode and state.

Calls C++ function: QList<QSize> QIcon::availableSizes() const.

C++ documentation:

Returns a list of available icon sizes for the specified mode and state.

This function was introduced in Qt 4.5.

pub unsafe fn cache_key(&self) -> i64[src]

Returns a number that identifies the contents of this QIcon object. Distinct QIcon objects can have the same key if they refer to the same contents.

Calls C++ function: qint64 QIcon::cacheKey() const.

C++ documentation:

Returns a number that identifies the contents of this QIcon object. Distinct QIcon objects can have the same key if they refer to the same contents.

The cacheKey() will change when the icon is altered via addPixmap() or addFile().

Cache keys are mostly useful in conjunction with caching.

This function was introduced in Qt 4.3.

See also QPixmap::cacheKey().

pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QIcon>>) -> Ref<QIcon>[src]

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

Calls C++ function: QIcon& QIcon::operator=(const QIcon& other).

C++ documentation:

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

pub unsafe fn detach(&self)[src]

Calls C++ function: void QIcon::detach().

pub unsafe fn fallback_search_paths() -> CppBox<QStringList>[src]

This is supported on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the fallback search paths for icons.

Calls C++ function: static QStringList QIcon::fallbackSearchPaths().

C++ documentation:

Returns the fallback search paths for icons.

The default value will depend on the platform.

This function was introduced in Qt 5.11.

See also setFallbackSearchPaths() and themeSearchPaths().

pub unsafe fn fallback_theme_name() -> CppBox<QString>[src]

This is supported on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the name of the fallback icon theme.

Calls C++ function: static QString QIcon::fallbackThemeName().

C++ documentation:

Returns the name of the fallback icon theme.

On X11, if not set, the fallback icon theme depends on your desktop settings. On other platforms it is not set by default.

This function was introduced in Qt 5.12.

See also setFallbackThemeName() and themeName().

pub unsafe fn from_theme_1a(name: impl CastInto<Ref<QString>>) -> CppBox<QIcon>[src]

Returns the QIcon corresponding to name in the current icon theme.

Calls C++ function: static QIcon QIcon::fromTheme(const QString& name).

C++ documentation:

Returns the QIcon corresponding to name in the current icon theme.

The latest version of the freedesktop icon specification and naming specification can be obtained here:

To fetch an icon from the current icon theme:

QIcon undoicon = QIcon::fromTheme("edit-undo");

Note: By default, only X11 will support themed icons. In order to use themed icons on Mac and Windows, you will have to bundle a compliant theme in one of your themeSearchPaths() and set the appropriate themeName().

Note: Qt will make use of GTK's icon-theme.cache if present to speed up the lookup. These caches can be generated using gtk-update-icon-cache: https://developer.gnome.org/gtk3/stable/gtk-update-icon-cache.html.

This function was introduced in Qt 4.6.

See also themeName(), setThemeName(), and themeSearchPaths().

pub unsafe fn from_theme_2a(
    name: impl CastInto<Ref<QString>>,
    fallback: impl CastInto<Ref<QIcon>>
) -> CppBox<QIcon>
[src]

This is an overloaded function.

Calls C++ function: static QIcon QIcon::fromTheme(const QString& name, const QIcon& fallback).

C++ documentation:

This is an overloaded function.

Returns the QIcon corresponding to name in the current icon theme. If no such icon is found in the current theme fallback is returned instead.

If you want to provide a guaranteed fallback for platforms that do not support theme icons, you can use the second argument:

QIcon undoicon = QIcon::fromTheme("edit-undo", QIcon(":/undo.png"));

pub unsafe fn has_theme_icon(name: impl CastInto<Ref<QString>>) -> bool[src]

Returns true if there is an icon available for name in the current icon theme, otherwise returns false.

Calls C++ function: static bool QIcon::hasThemeIcon(const QString& name).

C++ documentation:

Returns true if there is an icon available for name in the current icon theme, otherwise returns false.

This function was introduced in Qt 4.6.

See also themeSearchPaths(), fromTheme(), and setThemeName().

pub unsafe fn is_detached(&self) -> bool[src]

Calls C++ function: bool QIcon::isDetached() const.

pub unsafe fn is_mask(&self) -> bool[src]

Returns true if this icon has been marked as a mask image. Certain platforms render mask icons differently (for example, menu icons on macOS).

Calls C++ function: bool QIcon::isMask() const.

C++ documentation:

Returns true if this icon has been marked as a mask image. Certain platforms render mask icons differently (for example, menu icons on macOS).

This function was introduced in Qt 5.6.

See also setIsMask().

pub unsafe fn is_null(&self) -> bool[src]

Returns true if the icon is empty; otherwise returns false.

Calls C++ function: bool QIcon::isNull() const.

C++ documentation:

Returns true if the icon is empty; otherwise returns false.

An icon is empty if it has neither a pixmap nor a filename.

Note: Even a non-null icon might not be able to create valid pixmaps, eg. if the file does not exist or cannot be read.

pub unsafe fn name(&self) -> CppBox<QString>[src]

Returns the name used to create the icon, if available.

Calls C++ function: QString QIcon::name() const.

C++ documentation:

Returns the name used to create the icon, if available.

Depending on the way the icon was created, it may have an associated name. This is the case for icons created with fromTheme() or icons using a QIconEngine which supports the QIconEngine::IconNameHook.

This function was introduced in Qt 4.7.

See also fromTheme() and QIconEngine.

pub unsafe fn new() -> CppBox<QIcon>[src]

Constructs a null icon.

Calls C++ function: [constructor] void QIcon::QIcon().

C++ documentation:

Constructs a null icon.

pub unsafe fn from_q_pixmap(
    pixmap: impl CastInto<Ref<QPixmap>>
) -> CppBox<QIcon>
[src]

Constructs an icon from a pixmap.

Calls C++ function: [constructor] void QIcon::QIcon(const QPixmap& pixmap).

C++ documentation:

Constructs an icon from a pixmap.

pub unsafe fn from_q_string(
    file_name: impl CastInto<Ref<QString>>
) -> CppBox<QIcon>
[src]

Constructs an icon from the file with the given fileName. The file will be loaded on demand.

Calls C++ function: [constructor] void QIcon::QIcon(const QString& fileName).

C++ documentation:

Constructs an icon from the file with the given fileName. The file will be loaded on demand.

If fileName contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory.

The file name can refer to an actual file on disk or to one of the application's embedded resources. See the Resource System overview for details on how to embed images and other resource files in the application's executable.

Use the QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats() functions to retrieve a complete list of the supported file formats.

pub unsafe fn from_q_icon_engine(
    engine: impl CastInto<Ptr<QIconEngine>>
) -> CppBox<QIcon>
[src]

Creates an icon with a specific icon engine. The icon takes ownership of the engine.

Calls C++ function: [constructor] void QIcon::QIcon(QIconEngine* engine).

C++ documentation:

Creates an icon with a specific icon engine. The icon takes ownership of the engine.

pub unsafe fn new_copy(other: impl CastInto<Ref<QIcon>>) -> CppBox<QIcon>[src]

Constructs a copy of other. This is very fast.

Calls C++ function: [constructor] void QIcon::QIcon(const QIcon& other).

C++ documentation:

Constructs a copy of other. This is very fast.

pub unsafe fn paint_q_painter_q_rect_q_flags_alignment_flag_mode_state(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    rect: impl CastInto<Ref<QRect>>,
    alignment: QFlags<AlignmentFlag>,
    mode: Mode,
    state: State
)
[src]

Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.

Calls C++ function: void QIcon::paint(QPainter* painter, const QRect& rect, QFlags<Qt::AlignmentFlag> alignment = …, QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.

See also actualSize() and pixmap().

pub unsafe fn paint_q_painter4_int_q_flags_alignment_flag_mode_state(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    x: c_int,
    y: c_int,
    w: c_int,
    h: c_int,
    alignment: QFlags<AlignmentFlag>,
    mode: Mode,
    state: State
)
[src]

This is an overloaded function.

Calls C++ function: void QIcon::paint(QPainter* painter, int x, int y, int w, int h, QFlags<Qt::AlignmentFlag> alignment = …, QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

This is an overloaded function.

Paints the icon into the rectangle QRect(x, y, w, h).

pub unsafe fn paint_q_painter_q_rect_q_flags_alignment_flag_mode(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    rect: impl CastInto<Ref<QRect>>,
    alignment: QFlags<AlignmentFlag>,
    mode: Mode
)
[src]

Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.

Calls C++ function: void QIcon::paint(QPainter* painter, const QRect& rect, QFlags<Qt::AlignmentFlag> alignment = …, QIcon::Mode mode = …) const.

C++ documentation:

Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.

See also actualSize() and pixmap().

pub unsafe fn paint_q_painter_q_rect_q_flags_alignment_flag(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    rect: impl CastInto<Ref<QRect>>,
    alignment: QFlags<AlignmentFlag>
)
[src]

Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.

Calls C++ function: void QIcon::paint(QPainter* painter, const QRect& rect, QFlags<Qt::AlignmentFlag> alignment = …) const.

C++ documentation:

Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.

See also actualSize() and pixmap().

pub unsafe fn paint_q_painter_q_rect(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    rect: impl CastInto<Ref<QRect>>
)
[src]

Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.

Calls C++ function: void QIcon::paint(QPainter* painter, const QRect& rect) const.

C++ documentation:

Uses the painter to paint the icon with specified alignment, required mode, and state into the rectangle rect.

See also actualSize() and pixmap().

pub unsafe fn paint_q_painter4_int_q_flags_alignment_flag_mode(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    x: c_int,
    y: c_int,
    w: c_int,
    h: c_int,
    alignment: QFlags<AlignmentFlag>,
    mode: Mode
)
[src]

This is an overloaded function.

Calls C++ function: void QIcon::paint(QPainter* painter, int x, int y, int w, int h, QFlags<Qt::AlignmentFlag> alignment = …, QIcon::Mode mode = …) const.

C++ documentation:

This is an overloaded function.

Paints the icon into the rectangle QRect(x, y, w, h).

pub unsafe fn paint_q_painter4_int_q_flags_alignment_flag(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    x: c_int,
    y: c_int,
    w: c_int,
    h: c_int,
    alignment: QFlags<AlignmentFlag>
)
[src]

This is an overloaded function.

Calls C++ function: void QIcon::paint(QPainter* painter, int x, int y, int w, int h, QFlags<Qt::AlignmentFlag> alignment = …) const.

C++ documentation:

This is an overloaded function.

Paints the icon into the rectangle QRect(x, y, w, h).

pub unsafe fn paint_q_painter4_int(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    x: c_int,
    y: c_int,
    w: c_int,
    h: c_int
)
[src]

This is an overloaded function.

Calls C++ function: void QIcon::paint(QPainter* painter, int x, int y, int w, int h) const.

C++ documentation:

This is an overloaded function.

Paints the icon into the rectangle QRect(x, y, w, h).

pub unsafe fn pixmap_q_size_mode_state(
    &self,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode,
    state: State
) -> CppBox<QPixmap>
[src]

Returns a pixmap with the requested size, mode, and state, generating one if necessary. The pixmap might be smaller than requested, but never larger.

Calls C++ function: QPixmap QIcon::pixmap(const QSize& size, QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

Returns a pixmap with the requested size, mode, and state, generating one if necessary. The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

See also actualSize() and paint().

pub unsafe fn pixmap_2_int_mode_state(
    &self,
    w: c_int,
    h: c_int,
    mode: Mode,
    state: State
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QIcon::pixmap(int w, int h, QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

This is an overloaded function.

Returns a pixmap of size QSize(w, h). The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

pub unsafe fn pixmap_int_mode_state(
    &self,
    extent: c_int,
    mode: Mode,
    state: State
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QIcon::pixmap(int extent, QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

This is an overloaded function.

Returns a pixmap of size QSize(extent, extent). The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

pub unsafe fn pixmap_q_window_q_size_mode_state(
    &self,
    window: impl CastInto<Ptr<QWindow>>,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode,
    state: State
) -> CppBox<QPixmap>
[src]

Returns a pixmap with the requested window size, mode, and state, generating one if necessary.

Calls C++ function: QPixmap QIcon::pixmap(QWindow* window, const QSize& size, QIcon::Mode mode = …, QIcon::State state = …) const.

C++ documentation:

Returns a pixmap with the requested window size, mode, and state, generating one if necessary.

The pixmap can be smaller than the requested size. If window is on a high-dpi display the pixmap can be larger. In that case it will have a devicePixelRatio larger than 1.

This function was introduced in Qt 5.1.

See also actualSize() and paint().

pub unsafe fn pixmap_q_size_mode(
    &self,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode
) -> CppBox<QPixmap>
[src]

Returns a pixmap with the requested size, mode, and state, generating one if necessary. The pixmap might be smaller than requested, but never larger.

Calls C++ function: QPixmap QIcon::pixmap(const QSize& size, QIcon::Mode mode = …) const.

C++ documentation:

Returns a pixmap with the requested size, mode, and state, generating one if necessary. The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

See also actualSize() and paint().

pub unsafe fn pixmap_q_size(
    &self,
    size: impl CastInto<Ref<QSize>>
) -> CppBox<QPixmap>
[src]

Returns a pixmap with the requested size, mode, and state, generating one if necessary. The pixmap might be smaller than requested, but never larger.

Calls C++ function: QPixmap QIcon::pixmap(const QSize& size) const.

C++ documentation:

Returns a pixmap with the requested size, mode, and state, generating one if necessary. The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

See also actualSize() and paint().

pub unsafe fn pixmap_2_int_mode(
    &self,
    w: c_int,
    h: c_int,
    mode: Mode
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QIcon::pixmap(int w, int h, QIcon::Mode mode = …) const.

C++ documentation:

This is an overloaded function.

Returns a pixmap of size QSize(w, h). The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

pub unsafe fn pixmap_2_int(&self, w: c_int, h: c_int) -> CppBox<QPixmap>[src]

This is an overloaded function.

Calls C++ function: QPixmap QIcon::pixmap(int w, int h) const.

C++ documentation:

This is an overloaded function.

Returns a pixmap of size QSize(w, h). The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

pub unsafe fn pixmap_int_mode(
    &self,
    extent: c_int,
    mode: Mode
) -> CppBox<QPixmap>
[src]

This is an overloaded function.

Calls C++ function: QPixmap QIcon::pixmap(int extent, QIcon::Mode mode = …) const.

C++ documentation:

This is an overloaded function.

Returns a pixmap of size QSize(extent, extent). The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

pub unsafe fn pixmap_int(&self, extent: c_int) -> CppBox<QPixmap>[src]

This is an overloaded function.

Calls C++ function: QPixmap QIcon::pixmap(int extent) const.

C++ documentation:

This is an overloaded function.

Returns a pixmap of size QSize(extent, extent). The pixmap might be smaller than requested, but never larger.

Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this function to return pixmaps that are larger than the requested size. Such images will have a devicePixelRatio larger than 1.

pub unsafe fn pixmap_q_window_q_size_mode(
    &self,
    window: impl CastInto<Ptr<QWindow>>,
    size: impl CastInto<Ref<QSize>>,
    mode: Mode
) -> CppBox<QPixmap>
[src]

Returns a pixmap with the requested window size, mode, and state, generating one if necessary.

Calls C++ function: QPixmap QIcon::pixmap(QWindow* window, const QSize& size, QIcon::Mode mode = …) const.

C++ documentation:

Returns a pixmap with the requested window size, mode, and state, generating one if necessary.

The pixmap can be smaller than the requested size. If window is on a high-dpi display the pixmap can be larger. In that case it will have a devicePixelRatio larger than 1.

This function was introduced in Qt 5.1.

See also actualSize() and paint().

pub unsafe fn pixmap_q_window_q_size(
    &self,
    window: impl CastInto<Ptr<QWindow>>,
    size: impl CastInto<Ref<QSize>>
) -> CppBox<QPixmap>
[src]

Returns a pixmap with the requested window size, mode, and state, generating one if necessary.

Calls C++ function: QPixmap QIcon::pixmap(QWindow* window, const QSize& size) const.

C++ documentation:

Returns a pixmap with the requested window size, mode, and state, generating one if necessary.

The pixmap can be smaller than the requested size. If window is on a high-dpi display the pixmap can be larger. In that case it will have a devicePixelRatio larger than 1.

This function was introduced in Qt 5.1.

See also actualSize() and paint().

pub unsafe fn set_fallback_search_paths(paths: impl CastInto<Ref<QStringList>>)[src]

This is supported on cpp_lib_version="5.11.3" or cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Sets the fallback search paths for icons to paths.

Calls C++ function: static void QIcon::setFallbackSearchPaths(const QStringList& paths).

C++ documentation:

Sets the fallback search paths for icons to paths.

Note: To add some path without replacing existing ones:

QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << "my/search/path");

This function was introduced in Qt 5.11.

See also fallbackSearchPaths() and setThemeSearchPaths().

pub unsafe fn set_fallback_theme_name(name: impl CastInto<Ref<QString>>)[src]

This is supported on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Sets the fallback icon theme to name.

Calls C++ function: static void QIcon::setFallbackThemeName(const QString& name).

C++ documentation:

Sets the fallback icon theme to name.

The name should correspond to a directory name in the themeSearchPath() containing an index.theme file describing its contents.

This function was introduced in Qt 5.12.

See also fallbackThemeName(), themeSearchPaths(), and themeName().

pub unsafe fn set_is_mask(&self, is_mask: bool)[src]

Indicate that this icon is a mask image(boolean isMask), and hence can potentially be modified based on where it's displayed.

Calls C++ function: void QIcon::setIsMask(bool isMask).

C++ documentation:

Indicate that this icon is a mask image(boolean isMask), and hence can potentially be modified based on where it's displayed.

This function was introduced in Qt 5.6.

See also isMask().

pub unsafe fn set_theme_name(path: impl CastInto<Ref<QString>>)[src]

Sets the current icon theme to name.

Calls C++ function: static void QIcon::setThemeName(const QString& path).

C++ documentation:

Sets the current icon theme to name.

The name should correspond to a directory name in the themeSearchPath() containing an index.theme file describing it's contents.

This function was introduced in Qt 4.6.

See also themeSearchPaths() and themeName().

pub unsafe fn set_theme_search_paths(
    searchpath: impl CastInto<Ref<QStringList>>
)
[src]

Sets the search paths for icon themes to paths.

Calls C++ function: static void QIcon::setThemeSearchPaths(const QStringList& searchpath).

C++ documentation:

Sets the search paths for icon themes to paths.

This function was introduced in Qt 4.6.

See also themeSearchPaths(), fromTheme(), and setThemeName().

pub unsafe fn swap(&self, other: impl CastInto<Ref<QIcon>>)[src]

Swaps icon other with this icon. This operation is very fast and never fails.

Calls C++ function: void QIcon::swap(QIcon& other).

C++ documentation:

Swaps icon other with this icon. This operation is very fast and never fails.

This function was introduced in Qt 4.8.

pub unsafe fn theme_name() -> CppBox<QString>[src]

Returns the name of the current icon theme.

Calls C++ function: static QString QIcon::themeName().

C++ documentation:

Returns the name of the current icon theme.

On X11, the current icon theme depends on your desktop settings. On other platforms it is not set by default.

This function was introduced in Qt 4.6.

See also setThemeName(), themeSearchPaths(), fromTheme(), and hasThemeIcon().

pub unsafe fn theme_search_paths() -> CppBox<QStringList>[src]

Returns the search paths for icon themes.

Calls C++ function: static QStringList QIcon::themeSearchPaths().

C++ documentation:

Returns the search paths for icon themes.

The default value will depend on the platform:

On X11, the search path will use the XDG_DATA_DIRS environment variable if available.

By default all platforms will have the resource directory :\icons as a fallback. You can use "rcc -project" to generate a resource file from your icon theme.

This function was introduced in Qt 4.6.

See also setThemeSearchPaths(), fromTheme(), and setThemeName().

pub unsafe fn to_q_variant(&self) -> CppBox<QVariant>[src]

Returns the icon as a QVariant.

Calls C++ function: QVariant QIcon::operator QVariant() const.

C++ documentation:

Returns the icon as a QVariant.

Trait Implementations

impl CppDeletable for QIcon[src]

unsafe fn delete(&self)[src]

Destroys the icon.

Calls C++ function: [destructor] void QIcon::~QIcon().

C++ documentation:

Destroys the icon.

Auto Trait Implementations

impl RefUnwindSafe for QIcon

impl Send for QIcon

impl Sync for QIcon

impl Unpin for QIcon

impl UnwindSafe for QIcon

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.