MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkZoneProgressBar Class Reference

QProgressBar for displaying distances to zones. Colors are changed according to the distance to the zone and and the progress will be filled more the smaller the distance to the zone becomes. More...

#include <QmitkZoneProgressBar.h>

Inheritance diagram for QmitkZoneProgressBar:

Public Member Functions

 QmitkZoneProgressBar (QString name, int maxRange, int warnRange, QWidget *parent=nullptr)
 Initializes the progress bar with the given name, max range and warn range. The colors are set to default values (color: red, warn color: red, border color: gray).
 
void setValue (int value)
 
void setValueInvalid ()
 Can be called to indicate that there is currently no valid distance value available. E.g. if tracking data is not available at the moment. If there is a valid value again, the method setValue() can be called.
 
void SetTextFormatValid (QString format)
 Setter for the text on the progress bar. Defaults to the string given as name to the constructor. The format string can contain '%1' which will be replaced by the current distance value.
 
void SetTextFormatInvalid (QString format)
 
void SetColor (float color[3])
 
void SetWarnColor (float color[3])
 
void SetBorderColor (float color[3])
 

Protected Member Functions

void UpdateStyleSheet (QString startColor, QString stopColor)
 
QString ColorToString (float color[3])
 

Protected Attributes

QString m_TextFormatValid
 
QString m_TextFormatInvalid
 
int m_MaxRange
 
int m_WarnRange
 
QString m_ColorString
 
QString m_WarnColorString
 
QString m_BorderColorString
 
QString m_StyleSheet
 

Detailed Description

QProgressBar for displaying distances to zones. Colors are changed according to the distance to the zone and and the progress will be filled more the smaller the distance to the zone becomes.

Definition at line 24 of file QmitkZoneProgressBar.h.

Constructor & Destructor Documentation

◆ QmitkZoneProgressBar()

QmitkZoneProgressBar::QmitkZoneProgressBar ( QString name,
int maxRange,
int warnRange,
QWidget * parent = nullptr )
explicit

Initializes the progress bar with the given name, max range and warn range. The colors are set to default values (color: red, warn color: red, border color: gray).

Parameters
namewill be shown on the progress bar
maxRangethe progress bar will be empty for distances greater or equal to this distance
warnRangethe progress bar will change its color for distances smaller than this distance

Definition at line 15 of file QmitkZoneProgressBar.cpp.

Member Function Documentation

◆ ColorToString()

QString QmitkZoneProgressBar::ColorToString ( float color[3])
protected

Definition at line 109 of file QmitkZoneProgressBar.cpp.

◆ SetBorderColor()

void QmitkZoneProgressBar::SetBorderColor ( float color[3])
Parameters
colorthe color for the border of the progress bar

Definition at line 99 of file QmitkZoneProgressBar.cpp.

◆ SetColor()

void QmitkZoneProgressBar::SetColor ( float color[3])
Parameters
colorthe color for the progress bar fill

Definition at line 89 of file QmitkZoneProgressBar.cpp.

◆ SetTextFormatInvalid()

void QmitkZoneProgressBar::SetTextFormatInvalid ( QString format)
Parameters
formatthe text to be displayed when setValueInvalid() was called

Definition at line 84 of file QmitkZoneProgressBar.cpp.

◆ SetTextFormatValid()

void QmitkZoneProgressBar::SetTextFormatValid ( QString format)

Setter for the text on the progress bar. Defaults to the string given as name to the constructor. The format string can contain '%1' which will be replaced by the current distance value.

Parameters
formatthe text to be displayed on the progress bar

Definition at line 79 of file QmitkZoneProgressBar.cpp.

◆ setValue()

void QmitkZoneProgressBar::setValue ( int value)
Parameters
valuethe current distance to the zone

Definition at line 26 of file QmitkZoneProgressBar.cpp.

◆ setValueInvalid()

void QmitkZoneProgressBar::setValueInvalid ( )

Can be called to indicate that there is currently no valid distance value available. E.g. if tracking data is not available at the moment. If there is a valid value again, the method setValue() can be called.

Definition at line 72 of file QmitkZoneProgressBar.cpp.

◆ SetWarnColor()

void QmitkZoneProgressBar::SetWarnColor ( float color[3])
Parameters
colorthe color, the progress bar fill changes to if the distance falls below the warn range

Definition at line 94 of file QmitkZoneProgressBar.cpp.

◆ UpdateStyleSheet()

void QmitkZoneProgressBar::UpdateStyleSheet ( QString startColor,
QString stopColor )
protected

Definition at line 104 of file QmitkZoneProgressBar.cpp.

Member Data Documentation

◆ m_BorderColorString

QString QmitkZoneProgressBar::m_BorderColorString
protected

Definition at line 93 of file QmitkZoneProgressBar.h.

◆ m_ColorString

QString QmitkZoneProgressBar::m_ColorString
protected

Definition at line 91 of file QmitkZoneProgressBar.h.

◆ m_MaxRange

int QmitkZoneProgressBar::m_MaxRange
protected

Definition at line 88 of file QmitkZoneProgressBar.h.

◆ m_StyleSheet

QString QmitkZoneProgressBar::m_StyleSheet
protected

Definition at line 95 of file QmitkZoneProgressBar.h.

◆ m_TextFormatInvalid

QString QmitkZoneProgressBar::m_TextFormatInvalid
protected

Definition at line 86 of file QmitkZoneProgressBar.h.

◆ m_TextFormatValid

QString QmitkZoneProgressBar::m_TextFormatValid
protected

Definition at line 85 of file QmitkZoneProgressBar.h.

◆ m_WarnColorString

QString QmitkZoneProgressBar::m_WarnColorString
protected

Definition at line 92 of file QmitkZoneProgressBar.h.

◆ m_WarnRange

int QmitkZoneProgressBar::m_WarnRange
protected

Definition at line 89 of file QmitkZoneProgressBar.h.


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