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 QString &iconName, const QStringList &overlays)
 

Detailed Description

Provides utility functions for icons.

Function Documentation

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 141 of file kiconutils.cpp.

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 146 of file kiconutils.cpp.

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 151 of file kiconutils.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 18 2021 23:00:35 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.