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 | allowTransparency () const |
bool | autoChangeColor () const |
QColor | color () const |
Returns the current color of the button. More... | |
ColorButton (QWidget *parent=nullptr) | |
Constructs a colored button called name with parent parent. More... | |
bool | drawFrame () const |
bool | isModal () const |
void | setAllowChangeColor (bool) |
void | setAllowTransparency (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 |
bool | allowTransparency |
QColor | color |
bool | drawFrame |
Implementation of a color button.
ColorButton::ColorButton | ( | QWidget * | parent = nullptr | ) |
Constructs a colored button called name with parent parent.
References Gui::ColorButtonP::col, draftgeoutils.intersections::connect(), and onChooseColor().
ColorButton::~ColorButton | ( | ) |
Destroys the button.
bool ColorButton::allowChangeColor | ( | ) | const |
References Gui::ColorButtonP::allowChange.
bool Gui::ColorButton::allowTransparency | ( | ) | const |
bool ColorButton::autoChangeColor | ( | ) | const |
References Gui::ColorButtonP::autoChange.
|
signal |
Emits this signal when color has changed.
Referenced by onChooseColor().
QColor ColorButton::color | ( | ) | const |
Returns the current color of the button.
References Gui::ColorButtonP::col.
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(), PathScripts.PathDressupDogbone.Marker::highlight(), PathScripts.PathDressupDogbone.Marker::lowlight(), ArchPanel.ViewProviderPanelCut::onChanged(), ArchPanel.ViewProviderPanelSheet::onChanged(), draftviewproviders.view_dimension.ViewProviderLinearDimension::onChanged(), draftviewproviders.view_dimension.ViewProviderAngularDimension::onChanged(), FeaturePython.ViewProviderOctahedron::onChanged(), Mod.Test.unittestgui.ProgressBar::paint(), draftguitools.gui_trackers.editTracker::setColor(), PathScripts.PathDressupTagGui.HoldingTagMarker::setEnabled(), and DraftGui.DraftToolBar::setStyleButton().
bool ColorButton::drawFrame | ( | ) | const |
References Gui::ColorButtonP::drawFrame.
bool ColorButton::isModal | ( | ) | const |
References Gui::ColorButtonP::modal.
|
slot |
Opens a QColorDialog to set a new color.
References Gui::ColorButtonP::allowChange, Gui::ColorButtonP::allowTransparency, Gui::ColorButtonP::autoChange, Gui::ColorButtonP::cd, changed(), Gui::ColorButtonP::col, draftgeoutils.intersections::connect(), Gui::DialogOptions::dontUseNativeColorDialog(), Gui::ColorButtonP::modal, Gui::ColorButtonP::old, and setColor().
Referenced by ColorButton().
|
protected |
Draws the button label.
References Gui::ColorButtonP::col, color, Gui::ColorButtonP::dirty, and Gui::ColorButtonP::drawFrame.
void ColorButton::setAllowChangeColor | ( | bool | ok | ) |
References Gui::ColorButtonP::allowChange.
void Gui::ColorButton::setAllowTransparency | ( | bool | allow | ) |
Referenced by PartGui::FaceColors::FaceColors().
void ColorButton::setAutoChangeColor | ( | bool | on | ) |
References Gui::ColorButtonP::autoChange.
void ColorButton::setColor | ( | const QColor & | c | ) |
Sets the color c to the button.
References Gui::ColorButtonP::col, and Gui::ColorButtonP::dirty.
Referenced by onChooseColor(), PartGui::FaceColors::onSelectionChanged(), Gui::PrefColorButton::restorePreferences(), PartGui::SectionCut::SectionCut(), Ui_DlgStartPreferences::setupUi(), Gui::Dialog::Ui_DlgReportView::setupUi(), MeshGui::Ui_DlgSettingsMeshView::setupUi(), PartGui::Ui_DlgSettingsObjectColor::setupUi(), TechDrawGui::Ui_DlgPrefsTechDrawColorsImp::setupUi(), TechDrawGui::Ui_TaskBalloon::setupUi(), TechDrawGui::Ui_TaskCenterLine::setupUi(), TechDrawGui::Ui_TaskDimension::setupUi(), TechDrawGui::Ui_TaskLeaderLine::setupUi(), TechDrawGui::Ui_TaskLineDecor::setupUi(), and TechDrawGui::Ui_TaskRichAnno::setupUi().
void ColorButton::setDrawFrame | ( | bool | ok | ) |
References Gui::ColorButtonP::drawFrame.
void ColorButton::setModal | ( | bool | b | ) |
References Gui::ColorButtonP::modal.
|
readwrite |
|
readwrite |
|
readwrite |
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(), PathScripts.PathDressupDogbone.Marker::highlight(), PathScripts.PathDressupDogbone.Marker::lowlight(), ArchPanel.ViewProviderPanelCut::onChanged(), ArchPanel.ViewProviderPanelSheet::onChanged(), draftviewproviders.view_dimension.ViewProviderLinearDimension::onChanged(), draftviewproviders.view_dimension.ViewProviderAngularDimension::onChanged(), FeaturePython.ViewProviderOctahedron::onChanged(), Mod.Test.unittestgui.ProgressBar::paint(), paintEvent(), Gui::PrefColorButton::restorePreferences(), Gui::PrefColorButton::savePreferences(), draftguitools.gui_trackers.editTracker::setColor(), PathScripts.PathDressupTagGui.HoldingTagMarker::setEnabled(), and DraftGui.DraftToolBar::setStyleButton().
|
readwrite |