24 #include <tqspinbox.h> 29 PSpinBox::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, TQT_SIGNAL(valueChanged(
int)),
this, TQT_SLOT(updateProperty(
int)));
40 PSpinBox::PSpinBox(MultiProperty *property,
int minValue,
int maxValue,
int step, TQWidget *parent,
const char *name)
43 TQHBoxLayout *l =
new TQHBoxLayout(
this, 0, 0);
44 m_edit =
new TQSpinBox(minValue, maxValue, step,
this);
47 connect(m_edit, TQT_SIGNAL(valueChanged(
int)),
this, TQT_SLOT(updateProperty(
int)));
52 return TQVariant(m_edit->cleanText().toInt());
57 disconnect(m_edit, TQT_SIGNAL(valueChanged(
int)),
this, TQT_SLOT(updateProperty(
int)));
58 m_edit->setValue(value.toInt());
59 connect(m_edit, TQT_SIGNAL(valueChanged(
int)),
this, TQT_SLOT(updateProperty(
int)));
64 void PSpinBox::updateProperty(
int val)
72 #include "pspinbox.moc"
Namespace which contain property editing classes.
virtual TQVariant value() const
virtual void setValue(const TQVariant &value, bool emitChange=true)
Sets the value shown in the editor widget.
virtual TQVariant value() const