Skip to content

abstracts

Classes:

Functions:

ExtItemBase module-attribute

ExtItemBase = QWidget

LayoutChildT module-attribute

LayoutChildT: TypeAlias = QWidget | QBoxLayout | Stretch | QSpacerItem

AbstractQItem

Methods:

Attributes:

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

AbstractSettingsScrollArea

AbstractSettingsScrollArea()

Bases: ExtendedScrollArea, QYAMLObjectSingleton

Methods:

Attributes:

Source code
374
375
376
377
378
379
380
381
def __init__(self) -> None:
    super().__init__()

    self.setup_ui()

    self.set_defaults()

    self.set_qobject_names()

frame instance-attribute

frame: QFrame

hlayout instance-attribute

hlayout: HBoxLayout

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

vlayout instance-attribute

vlayout: VBoxLayout

get_separator

get_separator(horizontal: bool = False) -> QFrame
Source code
318
319
320
321
322
def get_separator(self, horizontal: bool = False) -> QFrame:
    separator = QFrame(self)
    separator.setFrameShape(QFrame.Shape.HLine if horizontal else QFrame.Shape.VLine)
    separator.setFrameShadow(QFrame.Shadow.Sunken)
    return separator

set_defaults

set_defaults() -> None
Source code
383
384
def set_defaults(self) -> None:
    pass

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
340
341
342
343
344
345
346
347
348
349
def setup_ui(self) -> None:
    self.setWidgetResizable(True)

    self.frame = QFrame(self)

    super().setup_ui()

    self.frame.setLayout(self.vlayout)

    self.setWidget(self.frame)

AbstractSettingsWidget

AbstractSettingsWidget()

Bases: ExtendedWidget, QYAMLObjectSingleton

Methods:

Attributes:

Source code
355
356
357
358
359
360
361
362
363
364
def __init__(self) -> None:
    super().__init__()

    self.setup_ui()

    self.vlayout.addStretch(1)

    self.set_defaults()

    self.set_qobject_names()

hlayout instance-attribute

hlayout: HBoxLayout

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

vlayout instance-attribute

vlayout: VBoxLayout

get_separator

get_separator(horizontal: bool = False) -> QFrame
Source code
318
319
320
321
322
def get_separator(self, horizontal: bool = False) -> QFrame:
    separator = QFrame(self)
    separator.setFrameShape(QFrame.Shape.HLine if horizontal else QFrame.Shape.VLine)
    separator.setFrameShadow(QFrame.Shadow.Sunken)
    return separator

set_defaults

set_defaults() -> None
Source code
366
367
def set_defaults(self) -> None:
    pass

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
314
315
316
def setup_ui(self) -> None:
    self.vlayout = VBoxLayout(self)
    self.hlayout = HBoxLayout(self.vlayout)

AbstractToolbar

AbstractToolbar(main: MainWindow, settings: QWidget | None = None)

Bases: ExtendedWidget, NotchProvider

Methods:

Attributes:

Source code
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
def __init__(self, main: MainWindow, settings: QWidget | None = None) -> None:
    super().__init__(main.central_widget)

    if settings is None:
        from jetpytools import CustomValueError

        raise CustomValueError('Missing settings widget!')

    self.main = main
    self.settings = settings
    self.name = self.__class__.__name__[:-7]

    if settings._add_to_tab:
        self.main.app_settings.addTab(settings, self.name)
    self.setFocusPolicy(Qt.FocusPolicy.ClickFocus)

    self.toggle_button = PushButton(
        self.name, self, checkable=True, clicked=self.on_toggle
    )
    self.toggle_button.setVisible(not self._no_visibility_choice)

    self.setVisible(False)
    self.visibility = False

    self.init_notches(self.main)

class_storable_attrs class-attribute instance-attribute

class_storable_attrs = tuple[str, ...](('settings', 'visibility'))

hlayout instance-attribute

hlayout: HBoxLayout

is_notches_visible property

is_notches_visible: bool

main instance-attribute

main: MainWindow = main

name instance-attribute

name: str = __name__[:-7]

notches_changed class-attribute instance-attribute

notches_changed = pyqtSignal(ExtendedWidget)

num_keys class-attribute instance-attribute

num_keys = [
    Key_1,
    Key_2,
    Key_3,
    Key_4,
    Key_5,
    Key_6,
    Key_7,
    Key_8,
    Key_9,
    Key_0,
]

settings instance-attribute

settings = settings

storable_attrs class-attribute instance-attribute

storable_attrs = tuple[str, ...]()

toggle_button instance-attribute

toggle_button = PushButton(name, self, checkable=True, clicked=on_toggle)

visibility instance-attribute

visibility = False

vlayout instance-attribute

vlayout: VBoxLayout

get_notches

get_notches() -> Notches
Source code
405
406
407
def get_notches(self) -> Notches:
    from .custom import Notches
    return Notches()

get_separator

get_separator(horizontal: bool = False) -> QFrame
Source code
318
319
320
321
322
def get_separator(self, horizontal: bool = False) -> QFrame:
    separator = QFrame(self)
    separator.setFrameShape(QFrame.Shape.HLine if horizontal else QFrame.Shape.VLine)
    separator.setFrameShadow(QFrame.Shadow.Sunken)
    return separator

init_notches

init_notches(main: MainWindow = ...) -> None
Source code
402
403
def init_notches(self, main: MainWindow = ...) -> None:
    self.notches_changed.connect(main.timeline.update_notches)

on_current_frame_changed

on_current_frame_changed(frame: Frame) -> None
Source code
471
472
def on_current_frame_changed(self, frame: Frame) -> None:
    pass

on_current_output_changed

on_current_output_changed(index: int, prev_index: int) -> None
Source code
474
475
def on_current_output_changed(self, index: int, prev_index: int) -> None:
    pass

on_toggle

on_toggle(new_state: bool) -> None
Source code
461
462
463
464
465
466
467
468
469
def on_toggle(self, new_state: bool) -> None:
    if new_state == self.visibility:
        return

    # invoking order matters
    self.setVisible(new_state)
    self.visibility = new_state
    self.toggle_button.setChecked(new_state)
    self.resize_main_window(new_state)

resize_main_window

resize_main_window(expanding: bool) -> None
Source code
481
482
483
484
485
486
487
488
489
def resize_main_window(self, expanding: bool) -> None:
    if self.main.windowState() in {Qt.WindowState.WindowMaximized, Qt.WindowState.WindowFullScreen}:
        return

    if expanding:
        self.main.resize(self.main.width(), self.main.height() + self.height() + round(6 * self.main.display_scale))
    if not expanding:
        self.main.resize(self.main.width(), self.main.height() - self.height() - round(6 * self.main.display_scale))
        self.main.timeline.update()

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
455
456
457
458
459
def setup_ui(self) -> None:
    self.hlayout = HBoxLayout(self)
    self.vlayout = VBoxLayout(self.hlayout)

    self.hlayout.setContentsMargins(0, 0, 0, 0)

AbstractToolbarSettings

AbstractToolbarSettings(parent: type[AbstractToolbar] | AbstractToolbar)

Bases: AbstractSettingsWidget

Methods:

Attributes:

Source code
393
394
395
396
def __init__(self, parent: type[AbstractToolbar] | AbstractToolbar) -> None:
    self.parent_toolbar_type = parent if isinstance(parent, type) else parent.__class__

    super().__init__()

hlayout instance-attribute

hlayout: HBoxLayout

parent_toolbar_type instance-attribute

parent_toolbar_type = parent if isinstance(parent, type) else __class__

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

vlayout instance-attribute

vlayout: VBoxLayout

get_separator

get_separator(horizontal: bool = False) -> QFrame
Source code
318
319
320
321
322
def get_separator(self, horizontal: bool = False) -> QFrame:
    separator = QFrame(self)
    separator.setFrameShape(QFrame.Shape.HLine if horizontal else QFrame.Shape.VLine)
    separator.setFrameShadow(QFrame.Shadow.Sunken)
    return separator

set_defaults

set_defaults() -> None
Source code
366
367
def set_defaults(self) -> None:
    pass

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
314
315
316
def setup_ui(self) -> None:
    self.vlayout = VBoxLayout(self)
    self.hlayout = HBoxLayout(self.vlayout)

AbstractYAMLObject

AbstractYAMLObject(*args: Any, **kwargs: Any)

Bases: AbstractQItem, SafeYAMLObject

Methods:

Attributes:

Source code
305
306
307
@abstractmethod
def __init__(self, *args: Any, **kwargs: Any) -> None:
    raise NotImplementedError

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

CheckBox

CheckBox(
    name: str,
    *args: QWidget | QBoxLayout | Stretch,
    tooltip: str | None = None,
    **kwargs: Any
)

Bases: ExtendedItemWithName, QCheckBox

Source code
233
234
235
236
def __init__(
    self, name: str, *args: QWidget | QBoxLayout | Stretch, tooltip: str | None = None, **kwargs: Any
) -> None:
    ...

DoubleSpinBox

DoubleSpinBox(
    *args: QWidget | QBoxLayout | Stretch,
    tooltip: str | None = None,
    hidden: bool = False,
    **kwargs: Any
)

Bases: ExtendedItemInit, QDoubleSpinBox

Source code
216
217
218
219
220
221
222
223
224
225
226
227
228
def __init__(
    self, *args: QWidget | QBoxLayout | Stretch, tooltip: str | None = None, hidden: bool = False, **kwargs: Any
) -> None:
    try:
        super().__init__(*args, **kwargs)  # type: ignore
    except TypeError:
        super().__init__(*args)  # type: ignore

    if tooltip:
        super().setToolTip(tooltip)

    if hidden:
        super().hide()

ExtendedDialog

Bases: AbstractQItem, QDialog

Methods:

Attributes:

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

ExtendedItemInit

ExtendedItemInit(
    *args: QWidget | QBoxLayout | Stretch,
    tooltip: str | None = None,
    hidden: bool = False,
    **kwargs: Any
)

Bases: ExtItemBase

Source code
216
217
218
219
220
221
222
223
224
225
226
227
228
def __init__(
    self, *args: QWidget | QBoxLayout | Stretch, tooltip: str | None = None, hidden: bool = False, **kwargs: Any
) -> None:
    try:
        super().__init__(*args, **kwargs)  # type: ignore
    except TypeError:
        super().__init__(*args)  # type: ignore

    if tooltip:
        super().setToolTip(tooltip)

    if hidden:
        super().hide()

ExtendedItemWithName

ExtendedItemWithName(
    name: str,
    *args: QWidget | QBoxLayout | Stretch,
    tooltip: str | None = None,
    **kwargs: Any
)

Bases: ExtendedItemInit

Source code
233
234
235
236
def __init__(
    self, name: str, *args: QWidget | QBoxLayout | Stretch, tooltip: str | None = None, **kwargs: Any
) -> None:
    ...

ExtendedLayout

ExtendedLayout()
ExtendedLayout(init_value: QWidget | QBoxLayout | None, **kwargs: Any)
ExtendedLayout(
    init_value: LayoutChildT | Sequence[LayoutChildT] | None, **kwargs: Any
)
ExtendedLayout(
    parent: QWidget | QBoxLayout | None = None,
    children: LayoutChildT | Sequence[LayoutChildT] | None = None,
    **kwargs: Any
)
ExtendedLayout(
    arg0: QWidget | QBoxLayout | None = None,
    arg1: LayoutChildT | Sequence[LayoutChildT] | None = None,
    spacing: int | None = None,
    alignment: AlignmentFlag | None = None,
    **kwargs: Any
)

Bases: QBoxLayout

Methods:

Source code
 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
def __init__(  # type: ignore
    self, arg0: QWidget | QBoxLayout | None = None,
    arg1: LayoutChildT | Sequence[LayoutChildT] | None = None,
    spacing: int | None = None, alignment: Qt.AlignmentFlag | None = None, **kwargs: Any
) -> ExtendedLayout:
    from .types import Stretch

    try:
        if isinstance(arg0, QBoxLayout):
            super().__init__(**kwargs)
            arg0.addLayout(self)
            arg0 = None
        elif isinstance(arg0, QWidget):
            super().__init__(arg0, **kwargs)  # type: ignore
            arg0 = None
        else:
            raise BaseException()
    except BaseException:
        super().__init__(**kwargs)

        if not any((arg0, arg1)):
            return  # type: ignore

    items = [u for s in (t if isinstance(t, Sequence) else [t] if t else [] for t in [arg0, arg1]) for u in s]

    for item in items:
        if isinstance(item, QBoxLayout):
            self.addLayout(item)
        elif isinstance(item, QSpacerItem):
            self.addSpacerItem(item)
        elif isinstance(item, Stretch):
            self.addStretch(item.amount)
        else:
            self.addWidget(item)

    for arg, action in ((spacing, 'setSpacing'), (alignment, 'setAlignment')):
        if arg is not None:
            getattr(self, action)(arg)

addLayouts

addLayouts(layouts: Sequence[QBoxLayout]) -> None
Source code
112
113
114
def addLayouts(self, layouts: Sequence[QBoxLayout]) -> None:
    for layout in layouts:
        self.addLayout(layout)

addWidgets

addWidgets(widgets: Sequence[QWidget]) -> None
Source code
108
109
110
def addWidgets(self, widgets: Sequence[QWidget]) -> None:
    for widget in widgets:
        self.addWidget(widget)

clear

clear() -> None
Source code
116
117
118
119
120
121
122
123
124
125
126
127
128
129
def clear(self) -> None:
    for i in reversed(range(self.count())):
        item = self.itemAt(i)
        widget = item.widget()
        self.removeItem(item)
        if widget:
            # removeItem only takes it out of the layout. The widget
            # still exists inside its parent widget.
            widget.deleteLater()
        else:
            # Clear and delete sub-layouts
            if isinstance(item, ExtendedLayout):
                item.clear()
            item.deleteLater()  # type: ignore

stretch staticmethod

stretch(amount: int | None) -> Stretch
Source code
131
132
133
134
135
@staticmethod
def stretch(amount: int | None) -> Stretch:  # type: ignore
    from .types import Stretch

    return Stretch(amount)  # type: ignore

ExtendedScrollArea

Bases: ExtendedWidgetBase, QScrollArea

Methods:

Attributes:

frame instance-attribute

frame: QFrame

hlayout instance-attribute

hlayout: HBoxLayout

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

vlayout instance-attribute

vlayout: VBoxLayout

get_separator

get_separator(horizontal: bool = False) -> QFrame
Source code
318
319
320
321
322
def get_separator(self, horizontal: bool = False) -> QFrame:
    separator = QFrame(self)
    separator.setFrameShape(QFrame.Shape.HLine if horizontal else QFrame.Shape.VLine)
    separator.setFrameShadow(QFrame.Shadow.Sunken)
    return separator

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
340
341
342
343
344
345
346
347
348
349
def setup_ui(self) -> None:
    self.setWidgetResizable(True)

    self.frame = QFrame(self)

    super().setup_ui()

    self.frame.setLayout(self.vlayout)

    self.setWidget(self.frame)

ExtendedTableView

Bases: AbstractQItem, QTableView

Methods:

Attributes:

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

ExtendedWidget

Bases: ExtendedWidgetBase, QWidget

Methods:

Attributes:

hlayout instance-attribute

hlayout: HBoxLayout

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

vlayout instance-attribute

vlayout: VBoxLayout

get_separator

get_separator(horizontal: bool = False) -> QFrame
Source code
318
319
320
321
322
def get_separator(self, horizontal: bool = False) -> QFrame:
    separator = QFrame(self)
    separator.setFrameShape(QFrame.Shape.HLine if horizontal else QFrame.Shape.VLine)
    separator.setFrameShadow(QFrame.Shadow.Sunken)
    return separator

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
314
315
316
def setup_ui(self) -> None:
    self.vlayout = VBoxLayout(self)
    self.hlayout = HBoxLayout(self.vlayout)

ExtendedWidgetBase

Bases: AbstractQItem

Methods:

Attributes:

hlayout instance-attribute

hlayout: HBoxLayout

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

vlayout instance-attribute

vlayout: VBoxLayout

get_separator

get_separator(horizontal: bool = False) -> QFrame
Source code
318
319
320
321
322
def get_separator(self, horizontal: bool = False) -> QFrame:
    separator = QFrame(self)
    separator.setFrameShape(QFrame.Shape.HLine if horizontal else QFrame.Shape.VLine)
    separator.setFrameShadow(QFrame.Shadow.Sunken)
    return separator

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
314
315
316
def setup_ui(self) -> None:
    self.vlayout = VBoxLayout(self)
    self.hlayout = HBoxLayout(self.vlayout)

HBoxLayout

HBoxLayout()
HBoxLayout(init_value: QWidget | QBoxLayout | None, **kwargs: Any)
HBoxLayout(
    init_value: LayoutChildT | Sequence[LayoutChildT] | None, **kwargs: Any
)
HBoxLayout(
    parent: QWidget | QBoxLayout | None = None,
    children: LayoutChildT | Sequence[LayoutChildT] | None = None,
    **kwargs: Any
)
HBoxLayout(
    arg0: QWidget | QBoxLayout | None = None,
    arg1: LayoutChildT | Sequence[LayoutChildT] | None = None,
    spacing: int | None = None,
    alignment: AlignmentFlag | None = None,
    **kwargs: Any
)

Bases: QHBoxLayout, ExtendedLayout

Methods:

Source code
159
160
161
162
163
164
def __init__(  # type: ignore
    self, arg0: QWidget | QBoxLayout | None = None,
    arg1: LayoutChildT | Sequence[LayoutChildT] | None = None,
    spacing: int | None = None, alignment: Qt.AlignmentFlag | None = None, **kwargs: Any
) -> ExtendedLayout:
    ...

addLayouts

addLayouts(layouts: Sequence[QBoxLayout]) -> None
Source code
112
113
114
def addLayouts(self, layouts: Sequence[QBoxLayout]) -> None:
    for layout in layouts:
        self.addLayout(layout)

addWidgets

addWidgets(widgets: Sequence[QWidget]) -> None
Source code
108
109
110
def addWidgets(self, widgets: Sequence[QWidget]) -> None:
    for widget in widgets:
        self.addWidget(widget)

clear

clear() -> None
Source code
116
117
118
119
120
121
122
123
124
125
126
127
128
129
def clear(self) -> None:
    for i in reversed(range(self.count())):
        item = self.itemAt(i)
        widget = item.widget()
        self.removeItem(item)
        if widget:
            # removeItem only takes it out of the layout. The widget
            # still exists inside its parent widget.
            widget.deleteLater()
        else:
            # Clear and delete sub-layouts
            if isinstance(item, ExtendedLayout):
                item.clear()
            item.deleteLater()  # type: ignore

stretch staticmethod

stretch(amount: int | None) -> Stretch
Source code
131
132
133
134
135
@staticmethod
def stretch(amount: int | None) -> Stretch:  # type: ignore
    from .types import Stretch

    return Stretch(amount)  # type: ignore

LineEdit

LineEdit(
    placeholder: str,
    *args: QWidget | QBoxLayout | Stretch,
    tooltip: str | None = None,
    **kwargs: Any
)

Bases: ExtendedItemInit, QLineEdit

Source code
244
245
246
247
def __init__(
    self, placeholder: str, *args: QWidget | QBoxLayout | Stretch, tooltip: str | None = None, **kwargs: Any
) -> None:
    return super().__init__(*args, tooltip=tooltip, **kwargs, placeholderText=placeholder)

NotchProvider

Bases: QABC

Methods:

Attributes:

is_notches_visible abstractmethod property

is_notches_visible: bool

notches_changed class-attribute instance-attribute

notches_changed = pyqtSignal(ExtendedWidget)

get_notches

get_notches() -> Notches
Source code
405
406
407
def get_notches(self) -> Notches:
    from .custom import Notches
    return Notches()

init_notches

init_notches(main: MainWindow = ...) -> None
Source code
402
403
def init_notches(self, main: MainWindow = ...) -> None:
    self.notches_changed.connect(main.timeline.update_notches)

ProgressBar

ProgressBar(
    *args: QWidget | QBoxLayout | Stretch,
    tooltip: str | None = None,
    hidden: bool = False,
    **kwargs: Any
)

Bases: ExtendedItemInit, QProgressBar

Source code
216
217
218
219
220
221
222
223
224
225
226
227
228
def __init__(
    self, *args: QWidget | QBoxLayout | Stretch, tooltip: str | None = None, hidden: bool = False, **kwargs: Any
) -> None:
    try:
        super().__init__(*args, **kwargs)  # type: ignore
    except TypeError:
        super().__init__(*args)  # type: ignore

    if tooltip:
        super().setToolTip(tooltip)

    if hidden:
        super().hide()

PushButton

PushButton(
    name: str,
    *args: QWidget | QBoxLayout | Stretch,
    tooltip: str | None = None,
    **kwargs: Any
)

Bases: ExtendedItemWithName, QPushButton

Source code
233
234
235
236
def __init__(
    self, name: str, *args: QWidget | QBoxLayout | Stretch, tooltip: str | None = None, **kwargs: Any
) -> None:
    ...

Shortcut

Shortcut(
    key: QKeySequence | StandardKey | str | int | None,
    parent: QObject | None,
    handler: Callable[[], None],
)

Bases: QShortcut

Source code
267
268
269
270
271
272
def __init__(
    self, key: QKeySequence | QKeySequence.StandardKey | str | int | None,
    parent: QObject | None, handler: Callable[[], None]
) -> None:
    super().__init__(key, parent)
    self.activated.connect(handler)

SpinBox

SpinBox(
    parent: QWidget | None = None,
    minimum: int | None = None,
    maximum: int | None = None,
    suffix: str | None = None,
    tooltip: str | None = None,
    **kwargs: Any
)

Bases: QSpinBox

Source code
197
198
199
200
201
202
203
204
205
206
def __init__(
    self, parent: QWidget | None = None, minimum: int | None = None,
    maximum: int | None = None, suffix: str | None = None, tooltip: str | None = None, **kwargs: Any
) -> None:
    super().__init__(parent, **kwargs)
    for arg, action in (
        (minimum, 'setMinimum'), (maximum, 'setMaximum'), (suffix, 'setSuffix'), (tooltip, 'setToolTip')
    ):
        if arg is not None:
            getattr(self, action)(arg)

Timer

Timer(
    *args: QWidget | QBoxLayout | Stretch,
    tooltip: str | None = None,
    hidden: bool = False,
    **kwargs: Any
)

Bases: ExtendedItemInit, QTimer

Source code
216
217
218
219
220
221
222
223
224
225
226
227
228
def __init__(
    self, *args: QWidget | QBoxLayout | Stretch, tooltip: str | None = None, hidden: bool = False, **kwargs: Any
) -> None:
    try:
        super().__init__(*args, **kwargs)  # type: ignore
    except TypeError:
        super().__init__(*args)  # type: ignore

    if tooltip:
        super().setToolTip(tooltip)

    if hidden:
        super().hide()

VBoxLayout

VBoxLayout()
VBoxLayout(init_value: QWidget | QBoxLayout | None, **kwargs: Any)
VBoxLayout(
    init_value: LayoutChildT | Sequence[LayoutChildT] | None, **kwargs: Any
)
VBoxLayout(
    parent: QWidget | QBoxLayout | None = None,
    children: LayoutChildT | Sequence[LayoutChildT] | None = None,
    **kwargs: Any
)
VBoxLayout(
    arg0: QWidget | QBoxLayout | None = None,
    arg1: LayoutChildT | Sequence[LayoutChildT] | None = None,
    spacing: int | None = None,
    alignment: AlignmentFlag | None = None,
    **kwargs: Any
)

Bases: QVBoxLayout, ExtendedLayout

Methods:

Source code
188
189
190
191
192
193
def __init__(  # type: ignore
    self, arg0: QWidget | QBoxLayout | None = None,
    arg1: LayoutChildT | Sequence[LayoutChildT] | None = None,
    spacing: int | None = None, alignment: Qt.AlignmentFlag | None = None, **kwargs: Any
) -> ExtendedLayout:
    ...

addLayouts

addLayouts(layouts: Sequence[QBoxLayout]) -> None
Source code
112
113
114
def addLayouts(self, layouts: Sequence[QBoxLayout]) -> None:
    for layout in layouts:
        self.addLayout(layout)

addWidgets

addWidgets(widgets: Sequence[QWidget]) -> None
Source code
108
109
110
def addWidgets(self, widgets: Sequence[QWidget]) -> None:
    for widget in widgets:
        self.addWidget(widget)

clear

clear() -> None
Source code
116
117
118
119
120
121
122
123
124
125
126
127
128
129
def clear(self) -> None:
    for i in reversed(range(self.count())):
        item = self.itemAt(i)
        widget = item.widget()
        self.removeItem(item)
        if widget:
            # removeItem only takes it out of the layout. The widget
            # still exists inside its parent widget.
            widget.deleteLater()
        else:
            # Clear and delete sub-layouts
            if isinstance(item, ExtendedLayout):
                item.clear()
            item.deleteLater()  # type: ignore

stretch staticmethod

stretch(amount: int | None) -> Stretch
Source code
131
132
133
134
135
@staticmethod
def stretch(amount: int | None) -> Stretch:  # type: ignore
    from .types import Stretch

    return Stretch(amount)  # type: ignore

main_window cached

main_window() -> MainWindow
Source code
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
@lru_cache()
def main_window() -> MainWindow:
    import logging

    from ..main.window import MainWindow

    app = QApplication.instance()

    if app is not None:
        for widget in app.topLevelWidgets():  # type: ignore
            if isinstance(widget, MainWindow):
                return cast(MainWindow, widget)
        app.exit()

    logging.critical('main_window() failed')

    raise RuntimeError

storage_err_msg

storage_err_msg(name: str, level: int = 0) -> str
Source code
534
535
536
537
538
539
540
541
542
def storage_err_msg(name: str, level: int = 0) -> str:
    import inspect

    pretty_name = name.replace('current_', ' ').replace('_enabled', ' ').replace('_', ' ').strip()
    frame = inspect.stack()[level + 1]
    caller_name = frame[0].f_locals['self'].__class__.__name__
    frame = None

    return f'Storage loading ({caller_name}): failed to parse {pretty_name}. Using default.'

try_load

try_load(
    state: dict[str, Any],
    name: str,
    expected_type: type[T],
    receiver: Literal[None] = ...,
    error_msg: str | None = None,
    nullable: bool = False,
) -> T
try_load(
    state: dict[str, Any],
    name: str,
    expected_type: type[T],
    receiver: T | _OneArgumentFunction | _SetterFunction = ...,
    error_msg: str | None = None,
    nullable: bool = False,
) -> None
try_load(
    state: dict[str, Any],
    name: str,
    expected_type: type[T],
    receiver: T | _OneArgumentFunction | _SetterFunction | None = None,
    error_msg: str | None = None,
    nullable: bool = False,
) -> None
Source code
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
def try_load(
    state: dict[str, Any], name: str, expected_type: type[T],
    receiver: T | _OneArgumentFunction | _SetterFunction | None = None,
    error_msg: str | None = None, nullable: bool = False
) -> None:
    import logging

    if error_msg is None:
        error_msg = storage_err_msg(name, 1)

    try:
        value = state[name]
        if not isinstance(value, expected_type) and not (nullable and value is None):
            raise TypeError
    except (KeyError, TypeError) as e:
        logging.error(e)
        logging.warning(error_msg)
        return
    finally:
        if nullable:
            value = None

    if receiver is None:
        return value

    if isinstance(receiver, expected_type):
        receiver = value
    elif callable(receiver):
        from inspect import Signature, _ParameterKind

        try:
            len_params = len([
                x for x in Signature.from_callable(receiver).parameters.values()
                if x.kind in (_ParameterKind.POSITIONAL_ONLY, _ParameterKind.POSITIONAL_OR_KEYWORD)
            ])

            if len_params >= 2:
                param_tries = [2, 1, 0]
            elif len_params >= 1:
                param_tries = [1, 0, 2]
            else:
                param_tries = [0, 1, 2]
        except ValueError:
            param_tries = [2, 1, 0]

        exceptions = []

        for ptry in param_tries:
            try:
                if ptry == 2:
                    receiver(name, value)
                elif ptry == 1:
                    receiver(value)
                elif ptry == 0:
                    receiver()
            except Exception as e:
                exceptions.append(e)
            else:
                exceptions.clear()
                break

        if exceptions:
            filtered = [
                e for e in exceptions if 'positional arguments but' not in str(e)
            ]

            return main_window().handle_error(filtered[0] if filtered else exceptions[0])
    elif hasattr(receiver, name) and isinstance(getattr(receiver, name), expected_type):
        try:
            receiver.__setattr__(name, value)
        except AttributeError as e:
            logging.error(e)
            logging.warning(error_msg)