29PSpinBox::PSpinBox(
MultiProperty *property, TQWidget *parent,
const char *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)));
52 return TQVariant(m_edit->cleanText().toInt());
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)));
64void PSpinBox::updateProperty(
int val)
66 emit propertyChanged(m_property, TQVariant(val));
72#include "pspinbox.moc"
Holds a list of properties with the same name and type.
virtual TQVariant value() const
virtual void setValue(const TQVariant &value, bool emitChange=true)
Sets the value shown in the editor widget.
Namespace which contain property editing classes.