Version: 9.16.0
Style_PrefDlg::PaletteEditor Class Reference

SALOME style palette editor widget. More...

#include <Style_PrefDlg.h>

Inheritance diagram for Style_PrefDlg::PaletteEditor:
Inheritance graph

Signals

void changed ()
 

Public Member Functions

 PaletteEditor (QWidget *=0)
 Constructor. More...
 
 ~PaletteEditor ()
 Destructor. More...
 
void addColumn (const QString &)
 Add new color properties column to the widget. More...
 
void addItem (int)
 Add color item to the widget (to the current column) More...
 
QList< int > items () const
 Get list of currently available color items. More...
 
void setColor (int, QPalette::ColorGroup, const QColor &)
 Set color value to the item. More...
 
void setColor (int, const QColor &, const QColor &=QColor(), const QColor &=QColor())
 Set color value to the item. More...
 
QColor color (int, QPalette::ColorGroup) const
 Get color value assigned to the item. More...
 
bool isAuto () const
 Get 'auto-palette' flag value. More...
 
void setAuto (bool)
 Set/clear 'auto-palette' flag value. More...
 
void fromColor (const QColor &)
 Initialize all palette colors from color c. More...
 

Private Types

typedef QMap< QPalette::ColorGroup, QtxColorButton * > Btns
 

Private Slots

void onQuick ()
 Called when "Quick" button is clicked. More...
 
void onAuto ()
 Called when "Auto" check box is clicked. More...
 

Private Member Functions

QWidget * line ()
 Create horizontal line widget. More...
 

Static Private Member Functions

static QString idToName (int)
 Get title of the item. More...
 

Private Attributes

QFrame * myContainer
 
QPushButton * myQuickButton
 
QCheckBox * myAutoCheck
 
QLabel * myActiveLab
 
QLabel * myInactiveLab
 
QLabel * myDisabledLab
 
QMap< int, Btns > myButtons
 
int myCurrentRow
 
int myCurrentColumn
 

Friends

class Style_PrefDlg
 

Detailed Description

SALOME style palette editor widget.

Member Typedef Documentation

◆ Btns

typedef QMap<QPalette::ColorGroup, QtxColorButton*> Style_PrefDlg::PaletteEditor::Btns
private

Constructor & Destructor Documentation

◆ PaletteEditor()

Style_PrefDlg::PaletteEditor::PaletteEditor ( QWidget *  parent = 0)

◆ ~PaletteEditor()

Style_PrefDlg::PaletteEditor::~PaletteEditor ( )

Destructor.

Member Function Documentation

◆ addColumn()

void Style_PrefDlg::PaletteEditor::addColumn ( const QString &  title)

Add new color properties column to the widget.

Parameters
titlecolumn title
See also
addItem()

References SPACING.

◆ addItem()

void Style_PrefDlg::PaletteEditor::addItem ( int  id)

Add color item to the widget (to the current column)

Parameters
idcolor palette identifier (Style_Model::ColorRole)
See also
addColumn(), items()

◆ changed

void Style_PrefDlg::PaletteEditor::changed ( )
signal

◆ color()

QColor Style_PrefDlg::PaletteEditor::color ( int  id,
QPalette::ColorGroup  cg 
) const

Get color value assigned to the item.

Parameters
iditem identifier (Style_Model::ColorRole)
cgcolor group
Returns
color value
See also
setColor()

◆ fromColor()

◆ idToName()

◆ isAuto()

bool Style_PrefDlg::PaletteEditor::isAuto ( ) const

Get 'auto-palette' flag value.

Returns
true if inactive/disabled palette colors should be calculated from active one
See also
setAuto()

◆ items()

QList< int > Style_PrefDlg::PaletteEditor::items ( ) const

Get list of currently available color items.

Returns
list of items identifiers (Style_Model::ColorRole)
See also
addColumn(), addItem()

◆ line()

QWidget * Style_PrefDlg::PaletteEditor::line ( )
private

Create horizontal line widget.

Returns
new line widget

◆ onAuto

void Style_PrefDlg::PaletteEditor::onAuto ( )
privateslot

Called when "Auto" check box is clicked.

◆ onQuick

void Style_PrefDlg::PaletteEditor::onQuick ( )
privateslot

Called when "Quick" button is clicked.

◆ setAuto()

void Style_PrefDlg::PaletteEditor::setAuto ( bool  on)

Set/clear 'auto-palette' flag value.

Parameters
onif true, inactive/disabled palette colors should be calculated from active one
See also
isAuto()

◆ setColor() [1/2]

void Style_PrefDlg::PaletteEditor::setColor ( int  id,
const QColor &  active,
const QColor &  inactive = QColor(),
const QColor &  disabled = QColor() 
)

Set color value to the item.

Parameters
iditem identifier (Style_Model::ColorRole)
activecolor to be used with active color group (QPalette::Active)
inactivecolor to be used with inactive color group (QPalette::Inactive)
disabledcolor to be used with disabled color group (QPalette::Disabled)
See also
color()

◆ setColor() [2/2]

void Style_PrefDlg::PaletteEditor::setColor ( int  id,
QPalette::ColorGroup  cg,
const QColor &  c 
)

Set color value to the item.

Parameters
iditem identifier (Style_Model::ColorRole)
cgcolor group
ccolor value
See also
color()

Friends And Related Function Documentation

◆ Style_PrefDlg

friend class Style_PrefDlg
friend

Member Data Documentation

◆ myActiveLab

QLabel* Style_PrefDlg::PaletteEditor::myActiveLab
private

◆ myAutoCheck

QCheckBox* Style_PrefDlg::PaletteEditor::myAutoCheck
private

◆ myButtons

QMap<int, Btns> Style_PrefDlg::PaletteEditor::myButtons
private

◆ myContainer

QFrame* Style_PrefDlg::PaletteEditor::myContainer
private

◆ myCurrentColumn

int Style_PrefDlg::PaletteEditor::myCurrentColumn
private

◆ myCurrentRow

int Style_PrefDlg::PaletteEditor::myCurrentRow
private

◆ myDisabledLab

QLabel* Style_PrefDlg::PaletteEditor::myDisabledLab
private

◆ myInactiveLab

QLabel* Style_PrefDlg::PaletteEditor::myInactiveLab
private

◆ myQuickButton

QPushButton* Style_PrefDlg::PaletteEditor::myQuickButton
private

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