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
 Returns the current color of the button. More...
 
 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
 
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, draftgeoutils.intersections::connect(), and onChooseColor().

◆ ~ColorButton()

ColorButton::~ColorButton ( )

Destroys the button.

Member Function Documentation

◆ allowChangeColor()

bool 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()

◆ drawFrame()

bool ColorButton::drawFrame ( ) const

◆ isModal()

bool ColorButton::isModal ( ) const

◆ onChooseColor

◆ 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 Gui::ColorButton::allowChangeColor
readwrite

◆ color

◆ drawFrame

bool Gui::ColorButton::drawFrame
readwrite

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