ORE Studio 0.0.4
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
IconUtils Class Reference

Utility class for icon manipulation operations. More...

#include <IconUtils.hpp>

Collaboration diagram for IconUtils:
Collaboration graph

Static Public Member Functions

static void setTheme (IconTheme theme)
 Sets the global icon theme.
 
static IconTheme currentTheme ()
 Gets the current global icon theme.
 
static QString iconPath (Icon icon)
 Gets the resource path for a semantic icon using the current global theme.
 
static QIcon createRecoloredIcon (Icon icon, const QColor &color)
 Creates a recolored version of a semantic icon using the current global theme.
 
static QIcon createRecoloredIcon (const QString &svgPath, const QColor &color)
 Creates a recolored version of an SVG icon.
 
static QIcon svgDataToIcon (const std::string &svg_data)
 Renders SVG data to a QIcon preserving aspect ratio.
 
static QPixmap svgDataToPixmap (const std::string &svg_data, int height)
 Renders SVG data to a QPixmap at specified height, preserving aspect ratio.
 

Static Public Attributes

static const QColor DefaultIconColor {220, 220, 220}
 
static const QColor ConnectedColor {100, 200, 100}
 
static const QColor DisconnectedColor {200, 100, 100}
 
static const QColor ReconnectingColor {230, 180, 80}
 
static const QColor RecordingOnColor {220, 80, 80}
 
static const QColor DisabledIconColor {100, 100, 100}
 

Detailed Description

Utility class for icon manipulation operations.

Member Function Documentation

◆ setTheme()

static void setTheme ( IconTheme  theme)
static

Sets the global icon theme.

Parameters
themeThe theme to use globally.

◆ currentTheme()

static IconTheme currentTheme ( )
static

Gets the current global icon theme.

Returns
The current global theme.

◆ iconPath()

QString iconPath ( Icon  icon)
static

Gets the resource path for a semantic icon using the current global theme.

Parameters
iconThe semantic icon identifier
Returns
The resource path string (e.g. ":/icons/...")
Here is the caller graph for this function:

◆ createRecoloredIcon() [1/2]

QIcon createRecoloredIcon ( Icon  icon,
const QColor &  color 
)
static

Creates a recolored version of a semantic icon using the current global theme.

Parameters
iconThe semantic icon identifier
colorColor to apply to the icon in normal state
Returns
QIcon with recolored normal and disabled states
Here is the caller graph for this function:

◆ createRecoloredIcon() [2/2]

QIcon createRecoloredIcon ( const QString &  svgPath,
const QColor &  color 
)
static

Creates a recolored version of an SVG icon.

Loads an SVG icon and creates a new QIcon with the specified color for normal state and a dark gray color for disabled state. Uses QPainter composition modes for efficient rendering.

Parameters
svgPathPath to the SVG icon resource (e.g., ":/icons/icon.svg")
colorColor to apply to the icon in normal state
Returns
QIcon with recolored normal and disabled states, or empty icon on failure

◆ svgDataToIcon()

QIcon svgDataToIcon ( const std::string &  svg_data)
static

Renders SVG data to a QIcon preserving aspect ratio.

Creates a QIcon from raw SVG data string, rendering at multiple sizes while preserving the SVG's native aspect ratio (from viewBox).

Parameters
svg_dataRaw SVG content as a string
Returns
QIcon rendered from the SVG, or empty icon on failure

◆ svgDataToPixmap()

QPixmap svgDataToPixmap ( const std::string &  svg_data,
int  height 
)
static

Renders SVG data to a QPixmap at specified height, preserving aspect ratio.

Parameters
svg_dataRaw SVG content as a string
heightTarget height in pixels (width computed from aspect ratio)
Returns
QPixmap rendered from the SVG, or null pixmap on failure