Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Public Member Functions | Protected Slots | Protected Attributes
qMRMLSliderWidget Class Reference

Extend the ctkSliderWidget to integrate units support. More...

#include <Libs/MRML/Widgets/qMRMLSliderWidget.h>

Inheritance diagram for qMRMLSliderWidget:
Inheritance graph
[legend]
Collaboration diagram for qMRMLSliderWidget:
Collaboration graph
[legend]

Public Types

typedef ctkSliderWidget Superclass
 
enum  UnitAwareProperty {
  None = 0x00, Prefix = 0x01, Suffix = 0x02, Precision = 0x04,
  MinimumValue = 0x08, MaximumValue = 0x10, Scaling = 0x20, All = Prefix | Suffix | Precision | MinimumValue | MaximumValue | Scaling
}
 

Properties

QString quantity
 
UnitAwareProperties unitAwareProperties
 

Public Slots

virtual void setMRMLScene (vtkMRMLScene *scene)
 
void setQuantity (const QString &baseName)
 
void setUnitAwareProperties (UnitAwareProperties flags)
 

Public Member Functions

Q_INVOKABLE vtkMRMLScenemrmlScene () const
 
 qMRMLSliderWidget (QWidget *parent=nullptr)
 Construct an empty qMRMLSliderWidget with a null scene. More...
 
QString quantity () const
 
void setMaximum (double) override
 
void setMinimum (double) override
 
void setRange (double, double) override
 
UnitAwareProperties unitAwareProperties () const
 
 ~qMRMLSliderWidget () override
 

Protected Slots

void updateWidgetFromUnitNode ()
 

Protected Attributes

QScopedPointer< qMRMLSliderWidgetPrivate > d_ptr
 

Detailed Description

Extend the ctkSliderWidget to integrate units support.

This custom widgets extends the ctkSliderWidget widget to integrate the unit support within Slicer. By default, this widget behaves just like a normal ctkSliderWidget.

To use the units, one needs to set what kind of quantity this widget should look for. For example, when dealing with world positions, the quantity is probably going to be "length". Once a scene is set to this widget, it listens to the changes made upon the selection node to extract the unit properties related to its quantity and update accordingly.

To allow even more customisation, one can set which properties of the widget are updated by units and which aren't.

See also
qMRMLCoordinatesWidget, qMRMLSpinBox

Definition at line 55 of file qMRMLSliderWidget.h.

Member Typedef Documentation

◆ Superclass

typedef ctkSliderWidget qMRMLSliderWidget::Superclass

Definition at line 77 of file qMRMLSliderWidget.h.

Member Enumeration Documentation

◆ UnitAwareProperty

Enumerator
None 
Prefix 
Suffix 
Precision 
MinimumValue 
MaximumValue 
Scaling 
All 

Definition at line 83 of file qMRMLSliderWidget.h.

Property Documentation

◆ quantity

QString qMRMLSliderWidget::quantity
readwrite

Get/Set the quantity is used to determine what unit the spinbox is in. This determines the spinbox properties like minimum, maximum, single step, prefix and suffix.

Definition at line 64 of file qMRMLSliderWidget.h.

◆ unitAwareProperties

UnitAwareProperties qMRMLSliderWidget::unitAwareProperties
readwrite

Get/Set the properties that will be determined by units. If a property is aware of units, it will update itself to the unit's property value automatically. Otherwise, this property is left to be changed by its accessors. All flags except MinimumValue and MaximumValue are on by default.

See also
setQuantity(), quantity()

Definition at line 74 of file qMRMLSliderWidget.h.

Constructor & Destructor Documentation

◆ qMRMLSliderWidget()

qMRMLSliderWidget::qMRMLSliderWidget ( QWidget *  parent = nullptr)
explicit

Construct an empty qMRMLSliderWidget with a null scene.

◆ ~qMRMLSliderWidget()

qMRMLSliderWidget::~qMRMLSliderWidget ( )
override

Member Function Documentation

◆ mrmlScene()

Q_INVOKABLE vtkMRMLScene* qMRMLSliderWidget::mrmlScene ( ) const

Get MRML scene that has been set by setMRMLScene(). Default is no scene.

See also
setMRMLScene()

◆ quantity()

QString qMRMLSliderWidget::quantity ( ) const

Get the quantity property value.

See also
quantity

◆ setMaximum()

void qMRMLSliderWidget::setMaximum ( double  )
override

◆ setMinimum()

void qMRMLSliderWidget::setMinimum ( double  )
override

Reimplemented for internal reasons.

See also
ctkSliderWidget::setMinimum(), ctkSliderWidget::setMaximum(), ctkSliderWidget::setRange()

◆ setMRMLScene

virtual void qMRMLSliderWidget::setMRMLScene ( vtkMRMLScene scene)
virtualslot

Set the scene the spinbox listens to.

See also
mrmlScene()

◆ setQuantity

void qMRMLSliderWidget::setQuantity ( const QString &  baseName)
slot

◆ setRange()

void qMRMLSliderWidget::setRange ( double  ,
double   
)
override

◆ setUnitAwareProperties

void qMRMLSliderWidget::setUnitAwareProperties ( UnitAwareProperties  flags)
slot

◆ unitAwareProperties()

UnitAwareProperties qMRMLSliderWidget::unitAwareProperties ( ) const

Get the unitAwareProperties property value.

See also
unitAwareProperties

◆ updateWidgetFromUnitNode

void qMRMLSliderWidget::updateWidgetFromUnitNode ( )
protectedslot

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLSliderWidgetPrivate> qMRMLSliderWidget::d_ptr
protected

Definition at line 128 of file qMRMLSliderWidget.h.


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