Implementation of a color button. More...

#include <Widgets.h>

Public Slots

void onChooseColor ()
 Opens a QColorDialog to set a new color. More...
 

Signals

void changed ()
 Emits this signal when color has changed. More...
 

Public Member Functions

bool allowChangeColor () const
 
bool autoChangeColor () const
 
QColor color () const
 
 ColorButton (QWidget *parent=0)
 Constructs a colored button called name with parent parent. More...
 
bool drawFrame () const
 
bool isModal () const
 
void setAllowChangeColor (bool)
 
void setAutoChangeColor (bool)
 
void setColor (const QColor &)
 Sets the color c to the button. More...
 
void setDrawFrame (bool)
 
void setModal (bool)
 
 ~ColorButton ()
 Destroys the button. More...
 

Protected Member Functions

void paintEvent (QPaintEvent *)
 Draws the button label. More...
 

Properties

bool allowChangeColor
 
QColor color
 Returns the current color of the button. More...
 
bool drawFrame
 

Detailed Description

Implementation of a color button.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ ColorButton()

ColorButton::ColorButton ( QWidget parent = 0)

Constructs a colored button called name with parent parent.

References Gui::ColorButtonP::col, and onChooseColor().

◆ ~ColorButton()

ColorButton::~ColorButton ( )

Destroys the button.

Member Function Documentation

◆ allowChangeColor()

bool Gui::ColorButton::allowChangeColor ( ) const

◆ autoChangeColor()

bool ColorButton::autoChangeColor ( ) const

◆ changed

void Gui::ColorButton::changed ( )
signal

Emits this signal when color has changed.

Referenced by onChooseColor().

◆ color()

QColor Gui::ColorButton::color ( ) const

◆ drawFrame()

bool Gui::ColorButton::drawFrame ( ) const

◆ isModal()

bool ColorButton::isModal ( ) const

◆ onChooseColor

void ColorButton::onChooseColor ( )
slot

◆ paintEvent()

void ColorButton::paintEvent ( QPaintEvent *  e)
protected

◆ setAllowChangeColor()

void ColorButton::setAllowChangeColor ( bool  ok)

◆ setAutoChangeColor()

void ColorButton::setAutoChangeColor ( bool  on)

◆ setColor()

void ColorButton::setColor ( const QColor &  c)

Sets the color c to the button.

References Gui::ColorButtonP::col, and Gui::ColorButtonP::dirty.

Referenced by onChooseColor(), and Gui::PrefColorButton::restorePreferences().

◆ setDrawFrame()

void ColorButton::setDrawFrame ( bool  ok)

◆ setModal()

void ColorButton::setModal ( bool  b)

Property Documentation

◆ allowChangeColor

bool ColorButton::allowChangeColor
readwrite

◆ color

◆ drawFrame

bool ColorButton::drawFrame
readwrite

The documentation for this class was generated from the following files:
  • src/Gui/Widgets.h
  • src/Gui/Widgets.cpp