19 #include <QColorDialog> 21 #include <ui_CurveColorConfigWidget.h> 37 ui_->labelColor->setAutoFillBackground(
true);
39 connect(
ui_->checkBoxAuto, SIGNAL(stateChanged(
int)),
this,
42 ui_->labelColor->installEventFilter(
this);
56 disconnect(
config_, SIGNAL(typeChanged(
int)),
this,
57 SLOT(colorTypeChanged(
int)));
59 SLOT(colorCurrentColorChanged(
const QColor&)));
65 connect(config, SIGNAL(typeChanged(
int)),
this,
81 if ((
object ==
ui_->labelColor) && (
ui_->labelColor->isEnabled()) &&
82 config_ && (event->type() == QEvent::MouseButtonPress)) {
83 QColorDialog dialog(
this);
87 if (dialog.exec() == QDialog::Accepted)
100 Qt::Checked : Qt::Unchecked);
104 QPalette palette =
ui_->labelColor->palette();
105 palette.setColor(QPalette::Window, color);
106 palette.setColor(QPalette::WindowText, (color.lightnessF() > 0.5) ?
107 Qt::black : Qt::white);
109 ui_->labelColor->setPalette(palette);
110 ui_->labelColor->setText(color.name().toUpper());
114 ui_->labelColor->setEnabled(state != Qt::Checked);
const QColor & getCustomColor() const
void setCustomColor(const QColor &color)
QColor getCurrentColor() const