Implementation of a color button. More...
#include <Widgets.h>
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 |
Implementation of a color button.
Definition at line 116 of file Widgets.h.
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.
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 |
Referenced by Gui::PrefColorButton::restorePreferences(), and Gui::PrefColorButton::savePreferences().
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] |
Opens a QColorDialog to set a new color.
Definition at line 383 of file Widgets.cpp.
References Gui::ColorButtonP::allowChange, Gui::ColorButtonP::cd, changed(), Gui::ColorButtonP::col, draftlibs::fcgeo::connect(), Gui::ColorButtonP::modal, Gui::ColorButtonP::old, and setColor().
Referenced by ColorButton().
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 | ) |
Sets the color c to the button.
Definition at line 301 of file Widgets.cpp.
References Gui::ColorButtonP::col.
Referenced by Gui::Dialog::DlgSettingsEditorImp::on_displayItems_currentItemChanged(), onChooseColor(), PartGui::FaceColors::onSelectionChanged(), Gui::PrefColorButton::restorePreferences(), Gui::Dialog::Ui_DlgSettingsViewColor::setupUi(), MeshGui::Ui_DlgSettingsMeshView::setupUi(), Gui::Dialog::Ui_DlgSettings3DView::setupUi(), Gui::Dialog::Ui_DlgReportView::setupUi(), and Gui::Dialog::DlgMaterialPropertiesImp::setViewProviders().
void ColorButton::setDrawFrame | ( | bool | ok | ) |
Definition at line 325 of file Widgets.cpp.
References Gui::ColorButtonP::drawFrame.
void ColorButton::setModal | ( | bool | b | ) |
Definition at line 335 of file Widgets.cpp.
References Gui::ColorButtonP::modal.
Referenced by Gui::Dialog::DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(), and Gui::Dialog::DlgMaterialPropertiesImp::DlgMaterialPropertiesImp().
QColor ColorButton::color [read, write] |
Returns the current color of the button.
Definition at line 120 of file Widgets.h.
Referenced by Gui::Dialog::DlgMaterialPropertiesImp::on_ambientColor_changed(), Gui::Dialog::DlgSettingsEditorImp::on_colorButton_changed(), Gui::Dialog::DlgMaterialPropertiesImp::on_diffuseColor_changed(), Gui::Dialog::DlgMaterialPropertiesImp::on_emissiveColor_changed(), and Gui::Dialog::DlgMaterialPropertiesImp::on_specularColor_changed().