4 ms·
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
by als0 6y ago
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?
- alfiopuglisi 6y agoQuit is a built-in class, because is very common. There are also Yes, No, Ok and Cancel builtins. You could do the same writing ['Quit'] and binding it a function that quits the program. 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 https://guietta.readthedocs.io/en/latest/tutorial.html , chapter "GUI actions"