20#include "pcolorcombo.h"
25#include <kcolorcombo.h>
29PColorCombo::PColorCombo(MultiProperty *property, TQWidget *parent,
const char *name)
30 :PropertyWidget(property, parent, name)
32 TQHBoxLayout *l =
new TQHBoxLayout(
this, 0, 0);
33 m_edit =
new KColorCombo(
this);
34 m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding);
37 connect(m_edit, TQ_SIGNAL(activated(
int)),
this, TQ_SLOT(updateProperty(
int)));
40TQVariant PColorCombo::value()
const
42 return TQVariant(m_edit->color());
45void PColorCombo::setValue(
const TQVariant &value,
bool emitChange)
47 disconnect(m_edit, TQ_SIGNAL(activated(
int)),
this, TQ_SLOT(updateProperty(
int)));
48 m_edit->setColor(value.toColor());
49 connect(m_edit, TQ_SIGNAL(activated(
int)),
this, TQ_SLOT(updateProperty(
int)));
51 emit propertyChanged(m_property, value);
54void PColorCombo::updateProperty(
int )
56 emit propertyChanged(m_property, value());
59void PColorCombo::drawViewer(TQPainter *p,
const TQColorGroup &cg,
const TQRect &r,
const TQVariant &value)
61 p->setPen(TQt::NoPen);
62 p->setBrush(cg.background());
65 p->setBrush(value.toColor());
66 p->setPen(TQt::SolidLine);
68 r2.setTopLeft(r.topLeft() + TQPoint(5,5));
69 r2.setBottomRight(r.bottomRight() - TQPoint(5,5));
76#include "pcolorcombo.moc"
Namespace which contain property editing classes.