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

QPalette subclass adding named presets, string lookups, and QVariant serialization. More...

#include <palette.h>

+ Inheritance diagram for Palette:
+ Collaboration diagram for Palette:

Classes

class  List
 A list of Palette objects. More...
 

Public Member Functions

 Palette ()
 Default constructor.
 
 Palette (const QColor &button)
 Construct from a button colour.
 
 Palette (Qt::GlobalColor button)
 Construct from a global colour for the button role.
 
 Palette (const QColor &button, const QColor &window)
 Construct from button and window colours.
 
 Palette (const QBrush &windowText, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &window)
 Construct from individual brush values for each role.
 
 Palette (const QColor &windowText, const QColor &window, const QColor &light, const QColor &dark, const QColor &mid, const QColor &text, const QColor &base)
 Construct from individual colour values for each role.
 
 Palette (const QPalette &palette)
 Copy-construct from a QPalette.
 
QVariant toVariant () const
 Wrap this palette in a QVariant.
 

Static Public Member Functions

static Palette fromVariant (const QVariant &value)
 Unwrap a Palette from a QVariant.
 
static Palette fusionLight ()
 Return a light Fusion-style palette.
 
static Palette fusionDark ()
 Return a dark Fusion-style palette.
 
static void debugDumpPalette (const Palette &palette)
 Print all colour roles and their values to debug output.
 
static QString getColorRoleString (ColorRole role)
 Return the string name for a colour role.
 
static QStringList getColorRoleStrings ()
 Return all registered colour role name strings.
 
static ColorRole getColorRole (const QString &value)
 Look up a colour role by its string name.
 

Detailed Description

QPalette subclass adding named presets, string lookups, and QVariant serialization.

Palette forwards all QPalette constructors and adds:

Definition at line 17 of file palette.h.

Constructor & Destructor Documentation

◆ Palette() [1/7]

Palette::Palette ( )
inline

Default constructor.

Definition at line 21 of file palette.h.

◆ Palette() [2/7]

Palette::Palette ( const QColor &  button)
inline

Construct from a button colour.

Parameters
buttonButton role colour

Definition at line 27 of file palette.h.

◆ Palette() [3/7]

Palette::Palette ( Qt::GlobalColor  button)
inline

Construct from a global colour for the button role.

Parameters
buttonGlobal colour constant

Definition at line 33 of file palette.h.

◆ Palette() [4/7]

Palette::Palette ( const QColor &  button,
const QColor &  window 
)
inline

Construct from button and window colours.

Parameters
buttonButton role colour
windowWindow role colour

Definition at line 40 of file palette.h.

◆ Palette() [5/7]

Palette::Palette ( const QBrush &  windowText,
const QBrush &  button,
const QBrush &  light,
const QBrush &  dark,
const QBrush &  mid,
const QBrush &  text,
const QBrush &  bright_text,
const QBrush &  base,
const QBrush &  window 
)
inline

Construct from individual brush values for each role.

Parameters
windowTextWindowText brush
buttonButton brush
lightLight brush
darkDark brush
midMid brush
textText brush
bright_textBrightText brush
baseBase brush
windowWindow brush

Definition at line 54 of file palette.h.

◆ Palette() [6/7]

Palette::Palette ( const QColor &  windowText,
const QColor &  window,
const QColor &  light,
const QColor &  dark,
const QColor &  mid,
const QColor &  text,
const QColor &  base 
)
inline

Construct from individual colour values for each role.

Parameters
windowTextWindowText colour
windowWindow colour
lightLight colour
darkDark colour
midMid colour
textText colour
baseBase colour

Definition at line 68 of file palette.h.

◆ Palette() [7/7]

Palette::Palette ( const QPalette &  palette)
inline

Copy-construct from a QPalette.

Parameters
paletteSource palette

Definition at line 75 of file palette.h.

Member Function Documentation

◆ debugDumpPalette()

static void Palette::debugDumpPalette ( const Palette palette)
static

Print all colour roles and their values to debug output.

Parameters
palettePalette to dump

◆ fromVariant()

static Palette Palette::fromVariant ( const QVariant &  value)
inlinestatic

Unwrap a Palette from a QVariant.

Parameters
valueVariant previously created by toVariant()
Returns
Extracted Palette

Definition at line 89 of file palette.h.

◆ fusionDark()

static Palette Palette::fusionDark ( )
static

Return a dark Fusion-style palette.

Returns
Fusion dark palette

◆ fusionLight()

static Palette Palette::fusionLight ( )
static

Return a light Fusion-style palette.

Returns
Fusion light palette

◆ getColorRole()

static ColorRole Palette::getColorRole ( const QString &  value)
inlinestatic

Look up a colour role by its string name.

Parameters
valueColour role name string
Returns
Matching QPalette::ColorRole, or NoRole if not found

Definition at line 130 of file palette.h.

◆ getColorRoleString()

static QString Palette::getColorRoleString ( ColorRole  role)
inlinestatic

Return the string name for a colour role.

Parameters
roleQPalette colour role
Returns
String name, or empty string if unknown

Definition at line 117 of file palette.h.

◆ getColorRoleStrings()

static QStringList Palette::getColorRoleStrings ( )
inlinestatic

Return all registered colour role name strings.

Returns
List of colour role names

Definition at line 123 of file palette.h.

◆ toVariant()

QVariant Palette::toVariant ( ) const
inline

Wrap this palette in a QVariant.

Returns
QVariant containing a copy of this Palette

Definition at line 82 of file palette.h.


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