-
Notifications
You must be signed in to change notification settings - Fork 0
widget_mix
version: v1.0.0
A module for a mix of custom widgets.
class WheelEventFilter(QObject) [src]
Event filter for blocking wheel events, install it on a target widget. The constructor needs a parent so the filter won't get garbage-collected. Needed as focusPolicy is ignored in PySide6 v6.6.2
[src]
def eventFilter(self, watched: CustomWidgetT, event: QEvent) -> boolOverridden event filter method.
Parameters:
- watched: The watched object.
- event: The caught event.
class WidgetListWidget(QWidget) [src]
A widget that emulates a QListWidget for QWidgets. (Each contained widget is expected to inherit ListMixin.)
[src]
def __init__(self, widgets: list = None) -> NoneInitializer for the class.
Parameters:
- widgets: The list of widgets to add to the list.
[src]
def __getitem__(self, index: int) -> CustomWidgetTReturns the widget from the requested index in the list.
Parameters:
- index: The index of the widget to return.
[src]
def __iter__(self) -> Iterator[CustomWidgetT]Makes the object iterable, yielding the widgets of the list.
[src]
def _setup_ui(self) -> NoneSets up the user interface: GUI objects and layouts.
[src]
def _setup_connections(self) -> NoneSets up the connections of the GUI objects.
[src]
@property
def widget_count(self) -> intReturns the number of widgets in the list.
[src]
@property
def selection(self) -> intReturns the selection index or -1 if no widget is selected.
[src]
def _update_widget_names(self) -> NoneUpdates the widgets' objectName by their position in the list.
[src]
def list_handler(self, command: str, widget: CustomWidgetT = None) -> boolHandles list operations (e.g. adding a widget to the list).
Parameters:
- command: 'a', 'r', 'u', 'd' for adding, removing, moving up or down a widget, respectively. To clear the list, use 'c'.
- widget: Optional parameter, the widget to be added to the list.
Returns: A success flag.
[src]
def _update_selection(self) -> NoneEmulates the selection behaviour of a button group.
[src]
def _visual_update(self) -> NoneProvides visual update to the list widget.
class ListMixin [src]
Mixin class to make a QWidget compatible with the WidgetListWidget.
Expects the target widget to use the checkbox named _chkSelection (created here).
Note: remember to call _setup_ui() and _setup_connections() with super() in the subclass.
Signals:
- selected: A signal indicating that the course got selected.
[src]
def __init__(self) -> NoneInitializer for the class.
[src]
def _setup_ui(self) -> NoneSets up the user interface: GUI objects and layouts.
[src]
def _setup_connections(self) -> NoneSets up the connections of the GUI objects.
[src]
def _slot_selected(self) -> NoneEmits the selection signal.
[src]
@property
def is_selected(self) -> boolReturns the selection state of the selection checkbox.
[src]
def deselect(self) -> NoneDeselects the widgets while blocking the corresponding signal.