iblqt.widgets.ThresholdProgressBar

class iblqt.widgets.ThresholdProgressBar[source]

Bases: QProgressBar

A progress bar that changes color based on a threshold value.

__init__(threshold, color_critical=None, color_default=None, **kwargs)[source]

Initialize ThresholdProgressBar.

Parameters:
  • threshold (int) – The threshold at which the progress bar changes color.

  • color_critical (QColor, optional) – The color to use when the threshold is crossed. Defaults to red.

  • color_default (QColor, optional) – The default color of the progress bar when below the threshold.

  • **kwargs (dict) – Arbitrary keyword arguments (passed to QProgressBar).

aboveThreshold()[source]

Check if the current value is above the threshold.

Returns:

True if the current value is above the threshold, False otherwise.

Return type:

bool

setThreshold(value)[source]

Set a new threshold value.

Parameters:

value (int)

Return type:

None

threshold()[source]

Get the current threshold value.

Return type:

int

thresholdChanged(int)

str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

thresholdCrossed(bool)

str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name