20 #include "pcolorcombo.h" 23 #include <tqpainter.h> 25 #include <kcolorcombo.h> 29 PColorCombo::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, TQT_SIGNAL(activated(
int)),
this, TQT_SLOT(updateProperty(
int)));
42 return TQVariant(m_edit->color());
47 disconnect(m_edit, TQT_SIGNAL(activated(
int)),
this, TQT_SLOT(updateProperty(
int)));
48 m_edit->setColor(value.toColor());
49 connect(m_edit, TQT_SIGNAL(activated(
int)),
this, TQT_SLOT(updateProperty(
int)));
54 void PColorCombo::updateProperty(
int )
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" virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value)
Function to draw a property viewer when the editor isn't shown.
Namespace which contain property editing classes.
virtual void setValue(const TQVariant &value, bool emitChange=true)
Sets the value shown in the editor widget.
virtual TQVariant value() const