API Reference
Bases: QMainWindow
A QMainWindow subclass that runs a function on a background thread and streams its stdout/stderr live into a QTextEdit.
Subclasses must call set_output_field() with a QTextEdit before
calling _started(), and should override _started's argument
collection to pass whatever inputs the wrapped function needs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable
|
The function to be run |
required |
Source code in src/qtwrap/window/script_capture_window.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 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 | |
Bases: _BrowsingSelector
A path-selection widget for choosing a single directory.
Displays a label, an editable text field showing the selected path, and a browse button that opens a native directory-picker dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_label
|
str
|
Text displayed in the label next to the path field. |
'Select Directory:'
|
btn_label
|
str
|
Text displayed on the browse button. |
'Browse'
|
inline
|
bool
|
If True, arranges the label, path field, and button in a single horizontal row. If False, places the label on its own row above the path field and button. |
True
|
Source code in src/qtwrap/widgets/directory_selector.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
Bases: _BrowsingSelector
A path-selection widget for choosing a single file.
Displays a label, an editable text field showing the selected path, and a browse button that opens a native file-picker dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_label
|
str
|
Text displayed in the label next to the path field. |
'Select File:'
|
btn_label
|
str
|
Text displayed on the browse button. |
'Browse'
|
inline
|
bool
|
If True, arranges the label, path field, and button in a single horizontal row. If False, places the label on its own row above the path field and button. |
True
|
file_filter
|
str
|
A Qt file-dialog filter string restricting which files are shown (e.g. ".json"). Defaults to "", allowing any file. |
'*'
|
Source code in src/qtwrap/widgets/file_selector.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
Bases: QWidget
A widget for selecting one or more options from a set of radio buttons.
Displays a title label followed by a row (or column) of radio
buttons, one per option. Options can be added at construction time
or later via add_options().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*options
|
Labels for the radio buttons to display initially. |
()
|
|
title
|
str
|
Text displayed above the options. |
'ChoiceSelector:'
|
inline
|
bool
|
If True, arranges the options in a single horizontal row. If False, stacks them vertically. |
True
|
exclusive
|
bool
|
If True, only one option can be selected at a time (standard radio-button behavior). If False, multiple options can be selected simultaneously. |
True
|
Source code in src/qtwrap/widgets/choice_selector.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
add_options(*options)
Add additional radio-button options to the widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*options
|
Labels for the new radio buttons to append. |
()
|
Source code in src/qtwrap/widgets/choice_selector.py
40 41 42 43 44 45 46 47 48 49 50 | |
choice()
Return the currently selected option(s).
Returns:
| Type | Description |
|---|---|
list[str]
|
The labels of all currently checked radio buttons. Contains |
list[str]
|
at most one element if |
list[str]
|
or an empty list if nothing has been selected yet. |
Source code in src/qtwrap/widgets/choice_selector.py
52 53 54 55 56 57 58 59 60 61 | |
Bases: QStatusBar
A QStatusBar subclass that adds a logging mechanic.
The status text color is automatically determined from the given :class:qtwrap.enums.LogLevel.
Source code in src/qtwrap/window/tools/status_bar.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Bases: Enum
Enum holding logging levels constants and their associated output color represented as RGB tuple.
Example
LogLevel.INFO.value equals (255, 255, 255) so INFO log events will be displayed in white.
Source code in src/qtwrap/enums/log_level.py
3 4 5 6 7 8 9 10 11 12 13 | |