KIconUtils

KIconUtils Namespace Reference

Functions

QIcon addOverlay (const QIcon &icon, const QIcon &overlay, Qt::Corner position)
 
QIcon addOverlays (const QIcon &icon, const QHash< Qt::Corner, QIcon > &overlays)
 
QIcon addOverlays (const QIcon &icon, const QStringList &overlays)
 
QIcon addOverlays (const QString &iconName, const QStringList &overlays)
 

Detailed Description

Provides utility functions for icons.

Function Documentation

◆ addOverlay()

KGUIADDONS_EXPORT QIcon KIconUtils::addOverlay ( const QIcon & icon,
const QIcon & overlay,
Qt::Corner position )

Adds the overlay over the icon in the specified position.

The overlay icon is scaled down approx. to 1/3 or 1/4 (depending on the icon size) and placed in one of the corners of the base icon.

Definition at line 197 of file kiconutils.cpp.

◆ addOverlays() [1/3]

KGUIADDONS_EXPORT QIcon KIconUtils::addOverlays ( const QIcon & icon,
const QHash< Qt::Corner, QIcon > & overlays )

Adds overlays over the icon.

The overlays is a QHash of Qt::Corner and QIcon. The Qt::Corner value decides where the overlay icon will be painted, the QIcon value is the overlay icon to be painted.

The overlay icon is scaled down to 1/3 or 1/4 (depending on the icon size) and placed in one of the corners of the base icon.

Definition at line 202 of file kiconutils.cpp.

◆ addOverlays() [2/3]

KGUIADDONS_EXPORT QIcon KIconUtils::addOverlays ( const QIcon & icon,
const QStringList & overlays )

Adds up to four overlays over the icon.

The overlays is a QStringList of icon names (e.g. the emblems that are drawn on icons in Dolphin and KFileWidget, e.g. symlink, un-mounted device ...etc).

Overlays are added in this order:

  • first icon is used to paint an overlay on the bottom-right corner
  • second icon on the bottom-left corner
  • third icon on the top-left corner
  • fourth icon on the top-right corner

Each overlay icon is scaled down to 1/3 or 1/4 (depending on the icon size).

Since
5.90

Definition at line 207 of file kiconutils.cpp.

◆ addOverlays() [3/3]

KGUIADDONS_EXPORT QIcon KIconUtils::addOverlays ( const QString & iconName,
const QStringList & overlays )

Adds up to four overlays on the icon constructed from iconName.

The overlays is a QStringList of icon names (e.g. the emblems that are drawn on icons in Dolphin and KFileWidget, e.g. symlink, un-mounted device ...etc).

Overlays are added in this order:

  • first icon is used to paint an overlay on the bottom-right corner
  • second icon on the bottom-left corner
  • third icon on the top-left corner
  • fourth icon on the top-right corner

Each overlay icon is scaled down to 1/3 or 1/4 (depending on the icon size).

All QIcon objects are constructed using QIcon::fromTheme().

Since
5.82

Definition at line 216 of file kiconutils.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.