qt_widgets
Various pure Qt widgets.
DoubleSpinBox
#
Bases: QDoubleSpinBox
A double spin box that ignores wheel events.
Source code in src/careamics_napari/widgets/qt_widgets.py
wheelEvent(event)
#
Ignore wheel events.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event | Any | The wheel event. | required |
PowerOfTwoSpinBox
#
Bases: QSpinBox
A spin box that only accepts power of two values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_val | int | Minimum value. | required |
max_val | int | Maximum value. | required |
default | int | Default value. | required |
*args | Any | Additional arguments. | () |
**kwargs | Any | Additional keyword arguments. | {} |
Source code in src/careamics_napari/widgets/qt_widgets.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
__init__(min_val, max_val, default, *args, **kwargs)
#
Initialize the widget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_val | int | Minimum value. | required |
max_val | int | Maximum value. | required |
default | int | Default value. | required |
*args | Any | Additional arguments. | () |
**kwargs | Any | Additional keyword arguments. | {} |
Raises:
Type | Description |
---|---|
ValueError | If min or max are not power of 2. |
Source code in src/careamics_napari/widgets/qt_widgets.py
stepBy(steps)
#
Step the value by a given number of steps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
steps | int | Number of steps to step the value by. | required |
Source code in src/careamics_napari/widgets/qt_widgets.py
textFromValue(value)
#
Get the text representation of the value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value | int | The value. | required |
Returns:
Type | Description |
---|---|
str | The text representation of the value. |
Source code in src/careamics_napari/widgets/qt_widgets.py
valueFromText(text)
#
Get the value from the text representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text | str | The text representation. | required |
Returns:
Type | Description |
---|---|
int | The value. |
Source code in src/careamics_napari/widgets/qt_widgets.py
SpinBox
#
Bases: QSpinBox
A spin box that ignores wheel events.
Source code in src/careamics_napari/widgets/qt_widgets.py
wheelEvent(event)
#
Ignore wheel events.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event | Any | The wheel event. | required |
create_double_spinbox(min_value=0, max_value=1, value=0.5, step=0.1, visible=True, tooltip=None, n_decimal=1)
#
Create a double-typed spin box.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_value | float | Minimum value. | 0 |
max_value | float | Maximum value. | 1 |
value | float | Default value. | 0.5 |
step | float | Step value. | 0.1 |
visible | bool | Visibility. | True |
tooltip | str or None | Tooltip text. | None |
n_decimal | int | Number of decimal places. | 1 |
Returns:
Type | Description |
---|---|
DoubleSpinBox | The double spin box. |
Source code in src/careamics_napari/widgets/qt_widgets.py
create_int_spinbox(min_value=1, max_value=1000, value=2, step=1, visible=True, tooltip=None)
#
Create an integer-typed spin box.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_value | int | Minimum value. | 1 |
max_value | int | Maximum value. | 1000 |
value | int | Default value. | 2 |
step | int | Step value. | 1 |
visible | bool | Visibility. | True |
tooltip | str or None | Tooltip text. | None |
Returns:
Type | Description |
---|---|
SpinBox | The integer spin box. |
Source code in src/careamics_napari/widgets/qt_widgets.py
create_progressbar(min_value=0, max_value=100, value=0, text_visible=True, visible=True, text_format=f'Epoch ?/{100}', tooltip=None)
#
Create a progress bar.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_value | int | Minimum value. | 0 |
max_value | int | Maximum value. | 100 |
value | int | Default value. | 0 |
text_visible | bool | Visibility of the text. | True |
visible | bool | Visibility. | True |
text_format | str | Text format. | "Epoch ?/{100}" |
tooltip | str or None | Tooltip text. | None |
Returns:
Type | Description |
---|---|
QProgressBar | The progress bar. |