custom_widgets
Class info
Classes
| Name | Children | Inherits |
|---|---|---|
| AnnotatedScrollBar prettyqt.custom_widgets.scrollbars.annotatedscrollbar ScrollBar which can highlight user-defined ranges. |
||
| AstViewer prettyqt.custom_widgets.astviewer Widget which displays an AST Tree next to the corresponding source code. |
||
| AutoResizePlainTextEdit prettyqt.custom_widgets.autoresizingtextedit PlainTextEdit which adjusts its height to the contained text. |
|
|
| AutoResizeTextEdit prettyqt.custom_widgets.autoresizingtextedit TextEdit which adjusts its height to the contained text. |
|
|
| BoolDictToolButton prettyqt.custom_widgets.booldicttoolbutton |
||
| BorderLayout prettyqt.custom_widgets.layouts.borderlayout Layout based on 5 Regions (north east, south, west and center). |
||
| BrushEdit prettyqt.custom_widgets.editors.brushedit |
||
| ClickableLabel prettyqt.custom_widgets.labels.clickablelabel A label widget that behaves like a button. |
||
| CodeEditor prettyqt.custom_widgets.codeeditor Code editor with line numbers, syntax highlighting and line markers. |
||
| CollapsibleFrame prettyqt.custom_widgets.collapsibleframe Frame containing another widget which can be collapsed. |
||
| ColorChooserButton prettyqt.custom_widgets.editors.colorchooserbutton |
||
| ColorComboBox prettyqt.custom_widgets.editors.colorcombobox |
||
| CommandPalette prettyqt.custom_widgets.commandpalette A Qt command palette widget. |
||
| CrossFadeWidget prettyqt.custom_widgets.crossfadewidget |
||
| CursorEdit prettyqt.custom_widgets.editors.cursoredit |
||
| ElidedLabel prettyqt.custom_widgets.labels.elidedlabel |
||
| EnumComboBox prettyqt.custom_widgets.editors.enumcombobox ComboBox presenting options from a python Enum. |
||
| EnumFlagWidget prettyqt.custom_widgets.editors.enumflagwidget |
||
| FaderWidget prettyqt.custom_widgets.faderwidget |
||
| FileChooserButton prettyqt.custom_widgets.editors.filechooserbutton |
||
| FileTree prettyqt.custom_widgets.itemviews.filetree |
||
| FilterHeader prettyqt.custom_widgets.itemviews.filterheader A HeaderView subclass which includes widgets with filter possibilities. |
||
| FlagSelectionWidget prettyqt.custom_widgets.editors.flagselectionwidget |
||
| FloatLineEdit prettyqt.custom_widgets.editors.lineedits |
||
| FlowLayout prettyqt.custom_widgets.layouts.flowlayout Layout which adjusts its children based on space available. |
||
| FontChooserButton prettyqt.custom_widgets.editors.fontchooserbutton |
||
| IconBrowser prettyqt.custom_widgets.iconbrowser A small browser window that allows the user to search through all icons. |
||
| IconEdit prettyqt.custom_widgets.editors.iconedit |
||
| IconLabel prettyqt.custom_widgets.labels.iconlabel |
||
| IconWidget prettyqt.custom_widgets.labels.iconwidget |
||
| ImageViewer prettyqt.custom_widgets.imageviewer |
||
| InputAndSlider prettyqt.custom_widgets.editors.inputandslider |
||
| IntLineEdit prettyqt.custom_widgets.editors.lineedits |
||
| KeyCombinationEdit prettyqt.custom_widgets.editors.keycombinationedit |
||
| LabeledSlider prettyqt.custom_widgets.labeledslider |
||
| ListInput prettyqt.custom_widgets.editors.listinput |
||
| LocaleEdit prettyqt.custom_widgets.editors.localeedit |
||
| LogRecordTableView prettyqt.custom_widgets.logrecordtableview Table view showing a log table. |
||
| LogTextEdit prettyqt.custom_widgets.logtextedit |
||
| MappedCheckBox prettyqt.custom_widgets.editors.mappedcheckbox |
||
| MultiComboBox prettyqt.custom_widgets.multicombobox ComboBox allowing multiple-choice selection. |
||
| MultiLineLayout prettyqt.custom_widgets.layouts.multilinelayout Nested Boxlayout. |
||
| NumFilterWidget prettyqt.custom_widgets.numfilterwidget Widget with a button to choose from a comparison op (>\=, >, etc) + a lineedit. |
||
| ObjectBrowser prettyqt.custom_widgets.objectbrowser Info window for python objects. |
||
| OptionalWidget prettyqt.custom_widgets.optionalwidget Wraps another widget in a GroupBox with and CheckBock and makes it optional. |
||
| OrientedTableView prettyqt.custom_widgets.orientedtableview TableView class with some convenience methods for oriented tables. |
||
| PaletteEdit prettyqt.custom_widgets.editors.paletteedit Simple editor to edit QPalettes. |
||
| PointEdit prettyqt.custom_widgets.editors.pointedit Simple Editor for QPoints. |
||
| PopupInfo prettyqt.custom_widgets.popupinfo Dialog overlay to show some info to user. |
||
| PreviewScrollBar prettyqt.custom_widgets.scrollbars.previewscrollbar Scrollbar showing a small preview of a (Plain)TextEdit. |
||
| QObjectHierarchyTreeView prettyqt.custom_widgets.qobjecthierarchytreeview |
||
| QObjectPropertiesTableView prettyqt.custom_widgets.qobjectpropertiestableview |
||
| RangeEdit prettyqt.custom_widgets.editors.rangeedit |
||
| RectEdit prettyqt.custom_widgets.editors.rectedit |
|
|
| RectFEdit prettyqt.custom_widgets.editors.rectedit |
|
|
| RegexInput prettyqt.custom_widgets.editors.regexinput |
||
| RegexLineEdit prettyqt.custom_widgets.editors.regexlineedit |
||
| RegionEdit prettyqt.custom_widgets.editors.rectedit |
|
|
| RoundProgressBar prettyqt.custom_widgets.roundprogressbar |
||
| ScrollAreaTocWidget prettyqt.custom_widgets.scrollareatocwidget |
||
| SelectionWidget prettyqt.custom_widgets.editors.selectionwidget |
||
| SidebarWidget prettyqt.custom_widgets.sidebarwidget |
||
| SingleLineTextEdit prettyqt.custom_widgets.editors.singlelinetextedit |
||
| SizeEdit prettyqt.custom_widgets.editors.sizeedit |
||
| SizePolicyEdit prettyqt.custom_widgets.editors.sizepolicyedit |
||
| SliceEdit prettyqt.custom_widgets.editors.sliceedit Simple editor to edit slices. |
||
| SmoothScrollBar prettyqt.custom_widgets.scrollbars.smoothscrollbar |
||
| SpanSlider prettyqt.custom_widgets.editors.spanslider |
||
| SpanSliderWidget prettyqt.custom_widgets.editors.spanslider |
||
| StandardIconsWidget prettyqt.custom_widgets.standardiconswidget Dialog showing standard icons. |
||
| StringListEdit prettyqt.custom_widgets.editors.lineedits |
||
| StringOrNumberWidget prettyqt.custom_widgets.editors.stringornumberwidget |
||
| SubsequenceCompleter prettyqt.custom_widgets.subsequencecompleter QCompleter specialised for subsequence matching. |
||
| Timeline prettyqt.custom_widgets.timeline |
||
| UrlLineEdit prettyqt.custom_widgets.editors.lineedits |
||
| VideoSample prettyqt.custom_widgets.timeline |
||
| WaitingSpinner prettyqt.custom_widgets.waitingspinner |
|
|
| WidgetEditor prettyqt.custom_widgets.widgeteditor |
🛈 DocStrings
AnnotatedScrollBar
Bases: ScrollBar
ScrollBar which can highlight user-defined ranges.
widget = widgets.PlainTextEdit("\n".join(str(i) for i in range(1000)))
widget.v_scrollbar = AnnotatedScrollBar(constants.VERTICAL)
widget.v_scrollbar.set_annotations([(10, 20), (50, 60), (82, 85)])
Source code in prettyqt/custom_widgets/scrollbars/annotatedscrollbar.py
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 | |
AstViewer
Bases: Splitter
Widget which displays an AST Tree next to the corresponding source code.
Selecting a node in the tree will highlight the corresponing text section in source.
Source code in prettyqt/custom_widgets/astviewer.py
rename_variable(old: str, new: str, ignore: list[str] | None = None, scope: list[str] | None = None)
Rename all identifiers named old to new (see AstModel.rename_variable).
Source code in prettyqt/custom_widgets/astviewer.py
AutoResizePlainTextEdit
Bases: AutoResizeTextEditMixin, PlainTextEdit
PlainTextEdit which adjusts its height to the contained text.
Source code in prettyqt/custom_widgets/autoresizingtextedit.py
AutoResizeTextEdit
Bases: AutoResizeTextEditMixin, TextEdit
TextEdit which adjusts its height to the contained text.
Source code in prettyqt/custom_widgets/autoresizingtextedit.py
BorderLayout
Bases: Layout
Layout based on 5 Regions (north east, south, west and center).
Source code in prettyqt/custom_widgets/layouts/borderlayout.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 137 138 139 | |
ClickableLabel
Bases: Label
A label widget that behaves like a button.
Source code in prettyqt/custom_widgets/labels/clickablelabel.py
CodeEditor
Bases: PlainTextEdit
Code editor with line numbers, syntax highlighting and line markers.
Line markers (errors / warnings / infos) tint the line and its number;
hovering the line number or the line shows the marker messages as tooltip.
set_text() keeps cursor and scroll position (and the undo history).
Source code in prettyqt/custom_widgets/codeeditor.py
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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | |
add_line_marker(line: int, message: str, kind: MarkerKindStr = 'error')
Attach a message to a line (1-based line number).
Source code in prettyqt/custom_widgets/codeeditor.py
clear_line_markers(line: int | None = None)
Remove the markers of a line, or all markers.
get_line_marker_text(line: int) -> str
set_line_markers(markers: Mapping[int, str] | Iterable[LineMarker | tuple[int, str]], kind: MarkerKindStr = 'error')
Replace all markers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
markers
|
Mapping[int, str] | Iterable[LineMarker | tuple[int, str]]
|
{line: message}, LineMarkers or (line, message) tuples |
required |
kind
|
MarkerKindStr
|
kind for markers given as mapping / tuples |
'error'
|
Source code in prettyqt/custom_widgets/codeeditor.py
set_syntaxhighlighter(syntax: str | gui.QSyntaxHighlighter, style: syntaxhighlighters.pygmentshighlighter.StyleStr | None = None)
Set the highlighter; the previous one is detached from the document.
Source code in prettyqt/custom_widgets/codeeditor.py
set_text(text: str, *, keep_position: bool = True)
Set the text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
new text |
required |
keep_position
|
bool
|
keep cursor position, selection and scroll position, and make the change undoable (instead of resetting the document) |
True
|
Source code in prettyqt/custom_widgets/codeeditor.py
CollapsibleFrame
Bases: Frame
Frame containing another widget which can be collapsed.
Source code in prettyqt/custom_widgets/collapsibleframe.py
CommandPalette
Bases: Widget
A Qt command palette widget.
Source code in prettyqt/custom_widgets/commandpalette.py
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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |
add_actions(actions: Iterable[gui.QAction])
clear()
get_actions() -> list[gui.QAction]
match_color() -> str
set_actions(actions: Iterable[gui.QAction])
Replace all actions of the palette (also refreshes changed action texts).
set_match_color(color: datatypes.ColorType)
CrossFadeWidget
Bases: Widget
Source code in prettyqt/custom_widgets/crossfadewidget.py
get_blend_factor() -> float
paintEvent(event)
Paint the interpolated pixmap image.
Source code in prettyqt/custom_widgets/crossfadewidget.py
sizeHint()
Return max size of both.
EnumComboBox
Bases: ComboBox
ComboBox presenting options from a python Enum.
If the Enum class does not implement __str__ then a human readable name
is created from the name of the enum member, replacing underscores with spaces.
Source code in prettyqt/custom_widgets/editors/enumcombobox.py
get_enum_class() -> type[enum.Enum] | None
get_value() -> enum.Enum | None
Current value as Enum member.
Source code in prettyqt/custom_widgets/editors/enumcombobox.py
is_optional() -> bool
set_value(value: enum.Enum | None) -> None
Set value with Enum.
Source code in prettyqt/custom_widgets/editors/enumcombobox.py
EnumFlagWidget
Bases: ToolButton
Source code in prettyqt/custom_widgets/editors/enumflagwidget.py
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 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 | |
get_enum_class() -> type[enum.Flag] | None
get_value() -> enum.Flag | None
Current value as Enum member.
Source code in prettyqt/custom_widgets/editors/enumflagwidget.py
set_value(value: enum.Flag) -> None
Set value with Enum.
Source code in prettyqt/custom_widgets/editors/enumflagwidget.py
FileChooserButton
Bases: Widget
Source code in prettyqt/custom_widgets/editors/filechooserbutton.py
__init__(extensions: dict[str, list[str]] | None = None, mode: widgets.filedialog.AcceptModeStr = 'save', file_mode: widgets.filedialog.FileModeStr = 'existing_files', root: str | pathlib.Path | None = None, object_name: str = 'file_chooser_button', **kwargs: Any)
Initialize FileChooserButton.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extensions
|
dict[str, list[str]] | None
|
dict allowed extensions form: "'name': ['.ext1', '.ext2']" |
None
|
mode
|
AcceptModeStr
|
Accept mode ("save" or "load") |
'save'
|
file_mode
|
FileModeStr
|
File mode ("existing_files", "existing_file", "any_file", or "directory") |
'existing_files'
|
root
|
str | Path | None
|
Root path |
None
|
object_name
|
str
|
Object name |
'file_chooser_button'
|
kwargs
|
Any
|
kwargs passed to parent |
{}
|
Source code in prettyqt/custom_widgets/editors/filechooserbutton.py
FileTree
Bases: TreeView
Source code in prettyqt/custom_widgets/itemviews/filetree.py
get_expanded_state(root_index: core.ModelIndex | None = None) -> list[str]
Get a list of all expanded paths.
Can be used to re-expand to the same state.
Source code in prettyqt/custom_widgets/itemviews/filetree.py
set_expanded_state(state: list[str], root_index: core.ModelIndex | None = None)
Set all indexes which correspond to given paths to expanded.
Source code in prettyqt/custom_widgets/itemviews/filetree.py
set_root_path(path: datatypes.PathType)
Set tree rootpath to given path.
FilterHeader
Bases: HeaderView
A HeaderView subclass which includes widgets with filter possibilities.
When setting the header view on an ItemView, a proxy model will be created which is linked to the filter widgets. The correct filter widget is automatically inferred from the content of the columns.
So basically everything that needs to be done is the following:
model = MyModel()
widget = widgets.TableView()
widget.set_model(model)
widget.h_header = custom_widgets.FilterHeader() # same as setHorizontalHeader()
and you will get filter capabilities for your table.
!!! note Since the FilterHeader will infer the column content type based on the first few rows, it will only work correctly for tables with homogenous data.
Source code in prettyqt/custom_widgets/itemviews/filterheader.py
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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
FlowLayout
Bases: Layout
Layout which adjusts its children based on space available.
Source code in prettyqt/custom_widgets/layouts/flowlayout.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 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 | |
IconBrowser
Bases: MainWindow
A small browser window that allows the user to search through all icons.
You can also copy the name and python code for the currently selected icon.
Source code in prettyqt/custom_widgets/iconbrowser.py
IconWidget
Bases: Label
Source code in prettyqt/custom_widgets/labels/iconwidget.py
set_icon(_icon: datatypes.IconType)
Set a new icon().
Parameters
_icon: qtawesome.icon icon to set
Source code in prettyqt/custom_widgets/labels/iconwidget.py
LogRecordTableView
Bases: TableView
Table view showing a log table.
Source code in prettyqt/custom_widgets/logrecordtableview.py
MultiComboBox
Bases: ComboBox
ComboBox allowing multiple-choice selection.
Source code in prettyqt/custom_widgets/multicombobox.py
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 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
MultiLineLayout
Bases: BoxLayout
Nested Boxlayout.
Source code in prettyqt/custom_widgets/layouts/multilinelayout.py
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 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 | |
NumFilterWidget
Bases: Widget
Widget with a button to choose from a comparison op (>=, >, etc) + a lineedit.
Source code in prettyqt/custom_widgets/numfilterwidget.py
ObjectBrowser
Bases: MainWindow
Info window for python objects.
Source code in prettyqt/custom_widgets/objectbrowser.py
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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
closeEvent(event)
Called when the window is closed.
Source code in prettyqt/custom_widgets/objectbrowser.py
toggle_auto_refresh(checked)
Toggle auto-refresh on/off.
Source code in prettyqt/custom_widgets/objectbrowser.py
OptionalWidget
Bases: GroupBox
Wraps another widget in a GroupBox with and CheckBock and makes it optional.
Source code in prettyqt/custom_widgets/optionalwidget.py
OrientedTableView
Bases: TableView
TableView class with some convenience methods for oriented tables.
Source code in prettyqt/custom_widgets/orientedtableview.py
PaletteEdit
Bases: Widget
Simple editor to edit QPalettes.
Source code in prettyqt/custom_widgets/editors/paletteedit.py
PointEdit
Bases: Widget
Simple Editor for QPoints.
Source code in prettyqt/custom_widgets/editors/pointedit.py
PopupInfo
Bases: Dialog
Dialog overlay to show some info to user.
Source code in prettyqt/custom_widgets/popupinfo.py
PreviewScrollBar
Bases: ScrollBar
Scrollbar showing a small preview of a (Plain)TextEdit.
Source code in prettyqt/custom_widgets/scrollbars/previewscrollbar.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 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 155 156 157 158 159 160 161 | |
RoundProgressBar
Bases: Widget
Source code in prettyqt/custom_widgets/roundprogressbar.py
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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
BarStyle
Position
ScrollAreaTocWidget
Bases: TreeView
Source code in prettyqt/custom_widgets/scrollareatocwidget.py
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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
__init__(scrollarea: widgets.ScrollArea, orientation: constants.Orientation | constants.OrientationStr = constants.VERTICAL, widget_class: type[widgets.QWidget] = widgets.QWidget, **kwargs) -> None
A TreeView which can show a Table-of-contents list based on a given ScrollArea.
With default settings, it will scan the widgets contained in the scrollArea for a windowTitle. These widgets will be shown in the TreeView, and the TreeView selection will be synced to what is currently visible in the ScrollArea. This basically emulates the behaviour of many websites (like the [Qt Website][https://doc.qt.io/qt-6/supported-platforms.html]) or from VS code settings.
You can set up the Toc Tree by passing a ScrollArea instance:
widget = widgets.Widget()
layout = widget.set_layout("horizontal")
scrollarea = widgets.ScrollArea()
# add some widgets to the ScrollArea here
# ...
toc = ScrollAreaTocWidget(scrollarea)
layout.add(toc)
layout.add(scrollarea)
The Toc tree can be configured to use other properties for populating than windowTitle. You can also set a widget class filter if you only want a specific widget class to be shown.
The widget supports 3 different scroll modes:
1) Single: Only one row in the Tree will be highlighted. (the one which equals the topmost one from the scrollArea) 2) Multi: All rows which equal to visible widgets in the ScrollArea will be shown. 3) HeadersOnly: like Single, but only highlights top-level widgets from the ScrollArea.
There are also two different expand modes to choose from:
1) ExpandAll: All subsections are always expanded. 2) on_focus: Only the section containing the focused item is expanded.
This widget is used by ConfigWidget.
Source code in prettyqt/custom_widgets/scrollareatocwidget.py
set_widget(widget: widgets.ScrollArea)
Set the ScrollArea widget to follow.
Source code in prettyqt/custom_widgets/scrollareatocwidget.py
SidebarWidget
Bases: MainWindow
Source code in prettyqt/custom_widgets/sidebarwidget.py
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 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 155 156 157 158 159 160 161 162 163 164 165 | |
SliceEdit
Bases: Widget
Simple editor to edit slices.
Source code in prettyqt/custom_widgets/editors/sliceedit.py
SmoothScrollBar
Bases: ScrollBar
Source code in prettyqt/custom_widgets/scrollbars/smoothscrollbar.py
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 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 | |
scroll_by_value(value: int)
scroll_to(value: int)
SpanSlider
Bases: Slider
Source code in prettyqt/custom_widgets/editors/spanslider.py
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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | |
set_movement_mode(mode: MovementModeStr)
Set movement mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
MovementModeStr
|
movement mode for the main window |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
movement mode type does not exist |
Source code in prettyqt/custom_widgets/editors/spanslider.py
StandardIconsWidget
Bases: Widget
Dialog showing standard icons.
Source code in prettyqt/custom_widgets/standardiconswidget.py
SubsequenceCompleter
Bases: Completer
QCompleter specialised for subsequence matching.