KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
StyleSheets Class Reference

Static helpers for generating common Qt stylesheet fragments. More...

#include <stylesheets.h>

Static Public Member Functions

static QString backgroundColor (const QColor &color)
 Build a background-color stylesheet fragment.
 
static QString foregroundColor (const QColor &color)
 Build a color (foreground) stylesheet fragment.
 
static QString borderRadius (int radius)
 Build a border-radius stylesheet fragment.
 

Detailed Description

Static helpers for generating common Qt stylesheet fragments.

Each method returns a stylesheet snippet string that can be concatenated or passed directly to QWidget::setStyleSheet().

Definition at line 24 of file stylesheets.h.

Member Function Documentation

◆ backgroundColor()

static QString StyleSheets::backgroundColor ( const QColor &  color)
static

Build a background-color stylesheet fragment.

Parameters
colorBackground colour
Returns
Stylesheet string, e.g. "background-color: #rrggbb;"

◆ borderRadius()

static QString StyleSheets::borderRadius ( int  radius)
static

Build a border-radius stylesheet fragment.

Parameters
radiusBorder radius in pixels
Returns
Stylesheet string, e.g. "border-radius: 4px;"

◆ foregroundColor()

static QString StyleSheets::foregroundColor ( const QColor &  color)
static

Build a color (foreground) stylesheet fragment.

Parameters
colorForeground colour
Returns
Stylesheet string, e.g. "color: #rrggbb;"

The documentation for this class was generated from the following file: