Object view#
The cdl.core.gui.objectview
module provides widgets to display object
(signal/image) trees.
Note
This module provides tree widgets to display signals, images and groups. It is important to note that, by design, the user can only select either individual signals/images or groups, but not both at the same time. This is an important design choice, as it allows to simplify the user experience, and to avoid potential confusion between the two types of selection.
Simple object tree#
- class cdl.core.gui.objectview.SimpleObjectTree(parent: QW.QWidget, objmodel: ObjectModel)[source]#
Base object handling panel list widget, object (sig/ima) lists
- initialize_from(sobjlist: SimpleObjectTree) None [source]#
Init from another SimpleObjectList, without making copies of objects
- iter_items(item: QTreeWidgetItem | None = None) Iterator[QTreeWidgetItem] [source]#
Recursively iterate over all items
- get_item_from_id(item_id) QTreeWidgetItem [source]#
Return QTreeWidgetItem from id (stored in itemβs data)
- add_object_item(obj: SignalObj | ImageObj, group_id: str, set_current: bool = True) None [source]#
Add item
Get object dialog#
Object view#
- class cdl.core.gui.objectview.ObjectView(parent: QW.QWidget, objmodel: ObjectModel)[source]#
Object handling panel list widget, object (sig/ima) lists
- get_all_group_uuids() list[str] [source]#
Return all group uuids, in a list ordered by group position in the tree
- get_all_object_uuids() dict[str, list[str]] [source]#
Return all object uuids, in a dictionary that maps group uuids to the list of object uuids in each group, in the correct order
- get_sel_object_uuids(include_groups: bool = False) list[str] [source]#
Return selected objects uuids.
- Parameters:
include_groups β If True, also return objects from selected groups.
- Returns:
List of selected objects uuids.
- get_sel_objects(include_groups: bool = False) list[SignalObj | ImageObj] [source]#
Return selected objects.
If include_groups is True, also return objects from selected groups.
- item_selection_changed() None [source]#
Refreshing the selection of objects and groups, emitting the SIG_SELECTION_CHANGED signal which triggers the update of the object properties panel, the plot items and the actions of the toolbar and menu bar.
This method is called when the user selects or deselects items in the tree. It is also called when the user clicks on an item that was already selected.
This method emits the SIG_SELECTION_CHANGED signal.
- select_objects(selection: list[SignalObj | ImageObj | int | str]) None [source]#
Select multiple objects
- Parameters:
selection (list) β list of objects, object numbers (1 to N) or object uuids