nqrduck.helpers.duckwidgets#
Provides a variety of different widgets for the NQRduck GUI.
Classes
|
A QLineEdit widget for floats and integers. |
|
A QLineEdit widget for floats. |
|
A QLineEdit widget for integers. |
|
A class that provides a QSpinBox or QDoubleSpinBox widget. |
- class nqrduck.helpers.duckwidgets.DuckEdit(*args: Any, **kwargs: Any)#
A QLineEdit widget for floats and integers.
By setting the validator attribute, the widget can be used for integers or floats.
- Parameters:
parent (QWidget) – The parent widget.
- validator#
The validator for the input.
- Type:
- Signals:
state_updated: Signal emitted when the state of the widget changes. It emits a bool and a str the bool indicates if the input is valid and the str is the input.
- on_text_changed(text)#
Slot that is called when the text of the QLineEdit changes.
- Parameters:
text (str) – The text of the QLineEdit.
- state_updated#
alias of
bool
- class nqrduck.helpers.duckwidgets.DuckFloatEdit(*args: Any, **kwargs: Any)#
A QLineEdit widget for floats.
This widget only accepts floats as input. Additionally, it changes its appearance when the input is invalid.
- Parameters:
parent (QWidget) – The parent widget.
min_value (float) – The minimum value that is accepted.
max_value (float) – The maximum value that is accepted.
- validator#
The validator for the input.
- Type:
- set_max_value(max_value)#
Sets the maximum value that is accepted.
Use this when creating the DuckFloatWidgets with the Qtdesigner.
- Parameters:
max_value (float) – The maximum value.
- set_min_value(min_value)#
Sets the minimum value that is accepted.
Use this when creating the DuckFloatWidgets with the Qtdesigner.
- Parameters:
min_value (float) – The minimum value.
- class nqrduck.helpers.duckwidgets.DuckIntEdit(*args: Any, **kwargs: Any)#
A QLineEdit widget for integers.
This widget only accepts integers as input. Additionally, it changes its appearance when the input is invalid.
- Parameters:
parent (QWidget) – The parent widget.
min_value (int) – The minimum value that is accepted.
max_value (int) – The maximum value that is accepted.
- validator#
The validator for the input.
- Type:
- set_max_value(max_value)#
Sets the maximum value that is accepted.
- Parameters:
max_value (int) – The maximum value.
- set_min_value(min_value)#
Sets the minimum value that is accepted.
- Parameters:
min_value (int) – The minimum value.
- class nqrduck.helpers.duckwidgets.DuckSpinBox(*args: Any, **kwargs: Any)#
A class that provides a QSpinBox or QDoubleSpinBox widget.
Additionally, a slider can be added to the widget.
- on_slider_value_changed(value)#
Slot that is called when the value of the QSlider changes.
- Parameters:
value (int) – The new value of the QSlider.
- on_value_changed(value)#
Slot that is called when the value of the QSpinBox changes.
- Parameters:
value (int) – The new value of the QSpinBox.
- set_value(value)#
Sets the value of the QSpinBox.
- Parameters:
value (int) – The value that should be set.
- state_updated#
alias of
bool
- value()#
Returns the value of the QSpinBox.
- Returns:
The value of the QSpinBox.
- Return type:
int