28#include <kcolorcombo.h>
32ColorButton::ColorButton(
Property *property, TQWidget *parent,
const char *name)
35 TQHBoxLayout *l =
new TQHBoxLayout(
this, 0, 0);
37 m_edit->setFocusPolicy(TQWidget::NoFocus);
38 connect(m_edit, TQ_SIGNAL(activated(
int)),
this, TQ_SLOT(slotValueChanged(
int)));
39 m_edit->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
40 m_edit->setMinimumHeight(5);
42 setFocusWidget(m_edit);
45ColorButton::~ColorButton()
51 return m_edit->color();
55ColorButton::setValue(
const TQVariant &value,
bool emitChange)
57 m_edit->blockSignals(
true);
58 m_edit->setColor(value.toColor());
59 m_edit->blockSignals(
false);
61 emit valueChanged(
this);
65ColorButton::drawViewer(TQPainter *p,
const TQColorGroup &,
const TQRect &r,
const TQVariant &value)
69 p->setBrush(value.toColor());
70 p->setPen(TQt::SolidLine);
72 r2.setTopLeft(r.topLeft() + TQPoint(5,5));
73 r2.setBottomRight(r.bottomRight() - TQPoint(5,5));
78ColorButton::slotValueChanged(
int)
80 emit valueChanged(
this);
85ColorButton::eventFilter(TQObject* watched, TQEvent* e)
91ColorButton::setReadOnlyInternal(
bool readOnly)
96#include "coloredit.moc"
The base class representing a single property.
const char * name(StdAction id)
Namespace for a set of classes implementing generic properties framework.