Bases: AbstractToolbarSettings
Methods:
Attributes:
Source code in vspreview/core/abstracts.py
| 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: bool
default_usable_cpus_count: int
frame_data_sharing_fix_enabled: bool
log_results_enabled: bool
parent_toolbar_type = parent if isinstance(parent, type) else __class__
get_separator(horizontal: bool = False) -> QFrame
Source code in vspreview/core/abstracts.py
| 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
|
Source code in vspreview/toolbars/benchmark/settings.py
| 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() -> 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)
|
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
])
)
|