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.
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 |
References Gui::ColorButtonP::autoChange.
◆ changed
|
signal |
Emits this signal when color has changed.
Referenced by onChooseColor().
◆ color()
QColor Gui::ColorButton::color | ( | ) | const |
Referenced by ArchSite.Compass::buildCoordinates().
◆ drawFrame()
bool Gui::ColorButton::drawFrame | ( | ) | const |
◆ isModal()
bool ColorButton::isModal | ( | ) | const |
References Gui::ColorButtonP::modal.
◆ onChooseColor
|
slot |
Opens a QColorDialog to set a new color.
References Gui::ColorButtonP::allowChange, Gui::ColorButtonP::autoChange, Gui::ColorButtonP::cd, changed(), Gui::ColorButtonP::col, Gui::ColorButtonP::modal, Gui::ColorButtonP::old, and setColor().
Referenced by ColorButton().
◆ paintEvent()
|
protected |
Draws the button label.
References Gui::ColorButtonP::col, color, Gui::ColorButtonP::dirty, and Gui::ColorButtonP::drawFrame.
◆ setAllowChangeColor()
void ColorButton::setAllowChangeColor | ( | bool | ok | ) |
References Gui::ColorButtonP::allowChange.
◆ setAutoChangeColor()
void ColorButton::setAutoChangeColor | ( | bool | on | ) |
References Gui::ColorButtonP::autoChange.
◆ 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 | ) |
References Gui::ColorButtonP::drawFrame.
◆ setModal()
void ColorButton::setModal | ( | bool | b | ) |
References Gui::ColorButtonP::modal.
Property Documentation
◆ allowChangeColor
|
readwrite |
◆ color
|
readwrite |
Returns the current color of the button.
Referenced by ArchSite.Compass::buildCoordinates(), draftviewproviders.view_dimension.ViewProviderLinearDimension::draw_dim_arrows(), draftviewproviders.view_dimension.ViewProviderAngularDimension::draw_dim_arrows(), draftviewproviders.view_dimension.ViewProviderLinearDimension::draw_dim_overshoot(), draftviewproviders.view_dimension.ViewProviderLinearDimension::draw_ext_overshoot(), draftguitools.gui_trimex.Trimex::finish(), importSVG.svgHandler::format(), DraftGui.DraftToolBar::getcol(), DraftGui.DraftToolBar::getDefaultColor(), FeaturePython.ViewProviderOctahedron::onChanged(), draftviewproviders.view_dimension.ViewProviderLinearDimension::onChanged(), draftviewproviders.view_dimension.ViewProviderAngularDimension::onChanged(), ArchPanel.ViewProviderPanelCut::onChanged(), ArchPanel.ViewProviderPanelSheet::onChanged(), Mod.Test.unittestgui.ProgressBar::paint(), paintEvent(), Gui::PrefColorButton::restorePreferences(), Gui::PrefColorButton::savePreferences(), draftguitools.gui_trackers.editTracker::setColor(), and PathScripts.PathDressupTagGui.HoldingTagMarker::setEnabled().
◆ drawFrame
|
readwrite |
The documentation for this class was generated from the following files:
- src/Gui/Widgets.h
- src/Gui/Widgets.cpp