ert
ert copied to clipboard
Tools should not create QAction on its own
The principle of least knowledge requires us to refactor the ert.gui.tools.Tool
class to take a QAction
instead of instantiating it:
https://github.com/equinor/ert/blob/bf6d58c0eb3286244fd6393c754e1746904b88ee/src/ert/gui/tools/tool.py#L21
This also has the benefit of easing the testing of any derived tools, simply because an inert QAction
can be passed during initialization, instead of the concrete QAction
, which currently requires a QIcon
, which in turn requires a QPixmap
, which will abort
if there's no underlying running gui application.