17 #include <QTextStream>
25 #define ROUND(x) (((x) > 0) ? int((x) + 0.5) : int((x)-0.5))
26 #define ROUND_SHORT(x) (((x) > 0) ? short((x) + 0.5) : short((x)-0.5))
29 : QSpinBox(parent), PropertyEditor(property), m_IntProperty(property), m_DataType(
DT_INT)
35 : QSpinBox(parent), PropertyEditor(property), m_FloatProperty(property), m_DataType(
DT_FLOAT)
41 : QSpinBox(parent), PropertyEditor(property), m_DoubleProperty(property), m_DataType(
DT_DOUBLE)
63 m_SelfChangeLock =
false;
65 connect(
this, SIGNAL(valueChanged(
int)),
this, SLOT(
onValueChanged(
int)));
71 void QmitkNumberPropertyEditor::adjustFactors(
short newDecimalPlaces,
bool newShowPercents)
176 QString displayedText;
177 QTextStream stream(&displayedText);
191 return displayedText;
201 if (m_SelfChangeLock)
255 m_SelfChangeLock =
true;
261 QSpinBox::setValue(i);
279 m_SelfChangeLock =
false;
bool getShowPercent() const
virtual QString textFromValue(int) const override
virtual int valueFromText(const QString &) const override
virtual ~QmitkNumberPropertyEditor()
mitk::BaseProperty * m_Property
void setShowPercent(bool)
double doubleValue() const
static RenderingManager * GetInstance()
virtual void PropertyRemoved() override
short getDecimalPlaces() const
mitk::GenericProperty< float > * m_FloatProperty
virtual void PropertyChanged() override
void BeginModifyProperty()
mitk::GenericProperty< double > * m_DoubleProperty
QmitkNumberPropertyEditor(mitk::IntProperty *, QWidget *parent)
double m_FactorPropertyToSpinbox
mitk::GenericProperty< int > * m_IntProperty
virtual void SetValue(T _arg)
void setDecimalPlaces(short)
double m_FactorSpinboxToDisplay
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
void setDoubleValue(double)
virtual T GetValue() const