Skip to content

settings

Classes:

BenchmarkSettings

BenchmarkSettings(parent: type[AbstractToolbar] | AbstractToolbar)

Bases: AbstractToolbarSettings

Methods:

Attributes:

Source code in vspreview/core/abstracts.py
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__()

clear_cache_enabled property

clear_cache_enabled: bool

default_usable_cpus_count property

default_usable_cpus_count: int

frame_data_sharing_fix_enabled property

frame_data_sharing_fix_enabled: bool

hlayout instance-attribute

hlayout: HBoxLayout

log_results_enabled property

log_results_enabled: bool

parent_toolbar_type instance-attribute

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

refresh_interval property

refresh_interval: Time

storable_attrs class-attribute

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

vlayout instance-attribute

vlayout: VBoxLayout

get_separator

get_separator(horizontal: bool = False) -> QFrame
Source code in vspreview/core/abstracts.py
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 in vspreview/toolbars/benchmark/settings.py
52
53
54
55
56
57
58
59
def set_defaults(self) -> None:
    from ...main import MainSettings

    self.clear_cache_checkbox.setChecked(False)
    self.log_results_checkbox.setChecked(True)
    self.refresh_interval_control.setValue(Time(milliseconds=150))
    self.frame_data_sharing_fix_checkbox.setChecked(True)
    self.default_usable_cpus_spinbox.setValue(max(1, MainSettings.get_usable_cpus_count() // 2))

set_qobject_names

set_qobject_names() -> None
Source code in vspreview/core/abstracts.py
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 in vspreview/toolbars/benchmark/settings.py
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
def setup_ui(self) -> None:
    from ...main import MainSettings

    super().setup_ui()

    self.clear_cache_checkbox = CheckBox('Clear VS frame caches before each run', self)
    self.log_results_checkbox = CheckBox('Log results', self)

    self.frame_data_sharing_fix_checkbox = CheckBox('(Debug) Enable frame data sharing fix', self)

    self.refresh_interval_control = TimeEdit(self)

    self.default_usable_cpus_spinbox = SpinBox(self, 1, MainSettings.get_usable_cpus_count())

    self.vlayout.addWidgets([
        self.clear_cache_checkbox,
        self.log_results_checkbox,
        self.frame_data_sharing_fix_checkbox
    ])
    self.vlayout.addLayout(
        HBoxLayout([
            QLabel('Refresh interval'),
            self.refresh_interval_control
        ])
    )
    self.vlayout.addLayout(
        HBoxLayout([
            QLabel('Default usable CPUs count'),
            self.default_usable_cpus_spinbox
        ])
    )