ert icon indicating copy to clipboard operation
ert copied to clipboard

Tools should not create QAction on its own

Open jondequinor opened this issue 5 years ago • 1 comments

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.

jondequinor avatar Aug 20 '19 06:08 jondequinor