Cool project, some questions.
In the README, Quit is a button but doesn't appear to be consistent with the syntax of other buttons like ['Calculate']. Is there a reason for this?
Also, how do you bind buttons to functions?
In the README, Quit is a button but doesn't appear to be consistent with the syntax of other buttons like ['Calculate']. Is there a reason for this?
Also, how do you bind buttons to functions?
Binding is done using QT's signals/slots mechanism under the hood, and can be done in several ways:
- using the 'with' statement as in the example, but this is often limited
- using an events layer, that is, a replica of the GUI layout, with a callable for each widget that you want to bind.
- using the @gui.auto decorator on a function: it will try to guess.
All this is described in the tutorial: https://guietta.readthedocs.io/en/latest/tutorial.html , chapter "GUI actions"