Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkNumberPropertySlider Class Reference

A QSlider that edits numeric MITK properties (int, float, double). More...

#include <QmitkNumberPropertySlider.h>

Inheritance diagram for QmitkNumberPropertySlider:
Collaboration diagram for QmitkNumberPropertySlider:

Public Member Functions

 QmitkNumberPropertySlider (QWidget *parent=nullptr)
 Construct the slider without an associated property. More...
 
 ~QmitkNumberPropertySlider () override
 Destructor. More...
 
void SetProperty (mitk::IntProperty *property)
 Bind this slider to an integer property. More...
 
void SetProperty (mitk::FloatProperty *property)
 Bind this slider to a float property. More...
 
void SetProperty (mitk::DoubleProperty *property)
 Bind this slider to a double property. More...
 
short getDecimalPlaces () const
 Get the number of decimal places used for conversion. More...
 
void setDecimalPlaces (short places)
 Set the number of decimal places (only effective for float/double properties). More...
 
bool getShowPercent () const
 Check whether values are interpreted as percentages. More...
 
void setShowPercent (bool showPercent)
 Enable or disable percentage mode. More...
 
int minValue () const
 Get the minimum allowed value. More...
 
void setMinValue (int value)
 Set the minimum allowed value. More...
 
int maxValue () const
 Get the maximum allowed value. More...
 
void setMaxValue (int value)
 Set the maximum allowed value. More...
 
double doubleValue () const
 Get the current value as a double. More...
 
void setDoubleValue (double value)
 Set the current value from a double. More...
 

Protected Slots

void onValueChanged (int)
 

Properties

short decimalPlaces
 
bool showPercent
 
int minValue
 
int maxValue
 

Detailed Description

A QSlider that edits numeric MITK properties (int, float, double).

Provides a slider editor that bidirectionally synchronizes with an mitk::IntProperty, mitk::FloatProperty, or mitk::DoubleProperty. Supports configurable decimal places, percentage display mode, and min/max ranges. The property is bound via SetProperty(). Pass nullptr to unbind.

See also
QmitkNumberPropertyEditor, QmitkNumberPropertyView, QmitkPropertyViewFactory

Definition at line 38 of file QmitkNumberPropertySlider.h.

Constructor & Destructor Documentation

◆ QmitkNumberPropertySlider()

QmitkNumberPropertySlider::QmitkNumberPropertySlider ( QWidget *  parent = nullptr)

Construct the slider without an associated property.

Parameters
[in]parentThe parent widget.

◆ ~QmitkNumberPropertySlider()

QmitkNumberPropertySlider::~QmitkNumberPropertySlider ( )
override

Destructor.

Member Function Documentation

◆ doubleValue()

double QmitkNumberPropertySlider::doubleValue ( ) const

Get the current value as a double.

Returns
The property value.

◆ getDecimalPlaces()

short QmitkNumberPropertySlider::getDecimalPlaces ( ) const

Get the number of decimal places used for conversion.

Returns
The decimal places count.

◆ getShowPercent()

bool QmitkNumberPropertySlider::getShowPercent ( ) const

Check whether values are interpreted as percentages.

Returns
True if percentage mode is active.

◆ maxValue()

int QmitkNumberPropertySlider::maxValue ( ) const

Get the maximum allowed value.

Returns
The maximum value.

◆ minValue()

int QmitkNumberPropertySlider::minValue ( ) const

Get the minimum allowed value.

Returns
The minimum value.

◆ onValueChanged

void QmitkNumberPropertySlider::onValueChanged ( int  )
protectedslot

◆ setDecimalPlaces()

void QmitkNumberPropertySlider::setDecimalPlaces ( short  places)

Set the number of decimal places (only effective for float/double properties).

Parameters
[in]placesThe number of decimal places.

◆ setDoubleValue()

void QmitkNumberPropertySlider::setDoubleValue ( double  value)

Set the current value from a double.

Parameters
[in]valueThe value to set.

◆ setMaxValue()

void QmitkNumberPropertySlider::setMaxValue ( int  value)

Set the maximum allowed value.

Parameters
[in]valueThe maximum value.

◆ setMinValue()

void QmitkNumberPropertySlider::setMinValue ( int  value)

Set the minimum allowed value.

Parameters
[in]valueThe minimum value.

◆ SetProperty() [1/3]

void QmitkNumberPropertySlider::SetProperty ( mitk::DoubleProperty *  property)

Bind this slider to a double property.

Parameters
[in]propertyThe double property to edit. Pass nullptr to unbind.

◆ SetProperty() [2/3]

void QmitkNumberPropertySlider::SetProperty ( mitk::FloatProperty *  property)

Bind this slider to a float property.

Parameters
[in]propertyThe float property to edit. Pass nullptr to unbind.

◆ SetProperty() [3/3]

void QmitkNumberPropertySlider::SetProperty ( mitk::IntProperty *  property)

Bind this slider to an integer property.

Parameters
[in]propertyThe int property to edit. Pass nullptr to unbind.

◆ setShowPercent()

void QmitkNumberPropertySlider::setShowPercent ( bool  showPercent)

Enable or disable percentage mode.

Parameters
[in]showPercentTrue to enable percentage mode.

Property Documentation

◆ decimalPlaces

short QmitkNumberPropertySlider::decimalPlaces
readwrite

Definition at line 1 of file QmitkNumberPropertySlider.h.

◆ maxValue

int QmitkNumberPropertySlider::maxValue
readwrite

Definition at line 1 of file QmitkNumberPropertySlider.h.

◆ minValue

int QmitkNumberPropertySlider::minValue
readwrite

Definition at line 1 of file QmitkNumberPropertySlider.h.

◆ showPercent

bool QmitkNumberPropertySlider::showPercent
readwrite

Definition at line 1 of file QmitkNumberPropertySlider.h.


The documentation for this class was generated from the following file: