6 #include <QtGui/QColorDialog>
11 #if QT_VERSION < 0x040800
12 #include <QtGui/QPainter>
26 void setColor(QLabel *widget,
const QColor& color)
28 QPalette palette(color);
29 palette.setColor(QPalette::Base, color);
30 palette.setColor(QPalette::Background, color);
31 palette.setColor(QPalette::Window, color);
32 palette.setColor(QPalette::Foreground, color);
33 widget->setPalette(palette);
34 QImage image(widget->rect().size(), QImage::Format_ARGB32);
36 #if QT_VERSION >= 0x040800
39 QPainter painter(&image);
40 painter.fillRect(widget->rect(), color);
43 QPixmap pix = QPixmap::fromImage(image);
44 widget->setPixmap(pix);
53 txtObjectName->setText(
"");
55 txtObjectName->setText(other->
getCN().c_str());
57 txtScaleStart->setText(QString::number(other->
getScaleStart()));
58 txtScaleEnd->setText(QString::number(other->
getScaleEnd()));
63 radColorize->setChecked(
true);
67 radShadow->setChecked(
true);
72 radScale->setChecked(
true);
79 other->
setStartColor(txtColorStart->palette().color(QPalette::Background));
80 other->
setEndColor(txtColorEnd->palette().color(QPalette::Background));
84 if (radColorize->isChecked())
86 else if (radShadow->isChecked())
96 result->
setStartColor(txtColorStart->palette().color(QPalette::Background));
97 result->
setEndColor(txtColorEnd->palette().color(QPalette::Background));
99 result->
setScaleEnd(txtScaleEnd->text().toDouble());
101 if (radColorize->isChecked())
103 else if (radShadow->isChecked())
void saveTo(CQEffectDescription *other, bool multiple=false)
const QColor & getEndColor() const
void setScaleStart(qreal scale)
~CQEffectDescriptionEdit()
const std::string & getCN() const
void initFrom(const CQEffectDescription *other, bool multiple=false)
void slotSelectColorEnd()
void slotSelectColorStart()
void setColor(QLabel *widget, const QColor &color)
qreal getScaleEnd() const
void slotScaleStartChanged(QString)
CQEffectDescription * toDescription() const
CQEffectDescriptionEdit(QWidget *parent=0, Qt::WindowFlags f=0)
void setStartColor(const QColor &color)
QColor getColor(const CLColorDefinition *cd)
const QColor & getStartColor() const
void slotScaleEndChanged(QString)
qreal getScaleStart() const
void setScaleEnd(qreal scale)
void setEndColor(const QColor &color)