Skip to content

General gui module

Johannes Kung requested to merge refactor_gui into main

Closes #14 (closed). Relates to #46, #60.

Implemented a new class, ModuleWidget, that can be used for modules in general. Through parameterization it is possible to control what an instance displays and what actions are available to a finer degree without needing to subclass the widget. The widget also has some extra capabilities compared to the previously used ModuleGraphicsItem. These include support for choosing how to format and parse the displayed state variables, and to change the appearance of the module by modifying its Qt properties e.g. through Qt stylesheets. See formatting.py for data classes and static functions related to formatting.

Moreover, the widget has better separation of concern. In particular, a module widget completely owns and manages its displayed signal ports using the new PortWidget (a rewrite of PortGraphicsItem). The widget also no longer instantiates dialogs for context menu actions such as "Edit module state". Instead, such actions should be added by calling addAction on the widget instance, where the action is responsible for the dialog. To aid in creating these actions, static convenience functions have been created in actions.py.

Edited by Johannes Kung

Merge request reports

Loading