Gui::ColorButton Class Reference

Implementation of a color button. More...

#include <Widgets.h>

Inheritance diagram for Gui::ColorButton:
Gui::PrefColorButton

List of all members.

Public Slots

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

Signals

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

Public Member Functions

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

Protected Member Functions

void paintEvent (QPaintEvent *)
 Draws the button label.

Properties

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

Detailed Description

Implementation of a color button.

Author:
Werner Mayer

Definition at line 116 of file Widgets.h.


Constructor & Destructor Documentation

ColorButton::ColorButton ( QWidget *  parent = 0  ) 

Constructs a colored button called name with parent parent.

Definition at line 282 of file Widgets.cpp.

References Gui::ColorButtonP::col, draftlibs::fcgeo::connect(), and onChooseColor().

ColorButton::~ColorButton (  ) 

Destroys the button.

Definition at line 293 of file Widgets.cpp.


Member Function Documentation

bool Gui::ColorButton::allowChangeColor (  )  const
void Gui::ColorButton::changed (  )  [signal]

Emits this signal when color has changed.

Referenced by onChooseColor().

QColor Gui::ColorButton::color (  )  const
bool Gui::ColorButton::drawFrame (  )  const
bool ColorButton::isModal (  )  const

Definition at line 340 of file Widgets.cpp.

References Gui::ColorButtonP::modal.

void ColorButton::onChooseColor (  )  [slot]
void ColorButton::paintEvent ( QPaintEvent *  e  )  [protected]

Draws the button label.

Definition at line 348 of file Widgets.cpp.

References Gui::ColorButtonP::col, Gui::ColorButtonP::drawFrame, group, and draftTools::p.

void ColorButton::setAllowChangeColor ( bool  ok  ) 

Definition at line 315 of file Widgets.cpp.

References Gui::ColorButtonP::allowChange.

void ColorButton::setColor ( const QColor &  c  ) 
void ColorButton::setDrawFrame ( bool  ok  ) 

Definition at line 325 of file Widgets.cpp.

References Gui::ColorButtonP::drawFrame.

void ColorButton::setModal ( bool  b  ) 

Property Documentation

bool ColorButton::allowChangeColor [read, write]

Definition at line 121 of file Widgets.h.

QColor ColorButton::color [read, write]
bool ColorButton::drawFrame [read, write]

Definition at line 122 of file Widgets.h.


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

Generated on Wed Nov 23 19:01:58 2011 for FreeCAD by  doxygen 1.6.1