29PSpinBox::PSpinBox(MultiProperty *property, TQWidget *parent,
const char *name)
30 :PropertyWidget(property, parent, name)
32 TQHBoxLayout *l =
new TQHBoxLayout(
this, 0, 0);
33 m_edit =
new TQSpinBox(INT_MIN, INT_MAX, 1,
this);
34 m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding);
37 connect(m_edit, TQ_SIGNAL(valueChanged(
int)),
this, TQ_SLOT(updateProperty(
int)));
40PSpinBox::PSpinBox(MultiProperty *property,
int minValue,
int maxValue,
int step, TQWidget *parent,
const char *name)
41 :PropertyWidget(property, parent, name)
43 TQHBoxLayout *l =
new TQHBoxLayout(
this, 0, 0);
44 m_edit =
new TQSpinBox(minValue, maxValue, step,
this);
47 connect(m_edit, TQ_SIGNAL(valueChanged(
int)),
this, TQ_SLOT(updateProperty(
int)));
50TQVariant PSpinBox::value()
const
52 return TQVariant(m_edit->cleanText().toInt());
55void PSpinBox::setValue(
const TQVariant &value,
bool emitChange)
57 disconnect(m_edit, TQ_SIGNAL(valueChanged(
int)),
this, TQ_SLOT(updateProperty(
int)));
58 m_edit->setValue(value.toInt());
59 connect(m_edit, TQ_SIGNAL(valueChanged(
int)),
this, TQ_SLOT(updateProperty(
int)));
61 emit propertyChanged(m_property, value);
64void PSpinBox::updateProperty(
int val)
66 emit propertyChanged(m_property, TQVariant(val));
72#include "pspinbox.moc"
Namespace which contain property editing classes.