May 2019
Intermediate to advanced
542 pages
13h 37m
English
Take another look at the Ui_ class generated by pyuic5 and notice the last line of code in setupUi:
QtCore.QMetaObject.connectSlotsByName(MainWindow)
connectSlotsByName() is a method that will automatically connect signals and slots by matching up signals to methods named in the on_object_name_signal() format, where object_name matches the objectName property of a PyQt object and signal is the name of one of its built-in signals.
For example, in our CategoryWindow, we would like to create a callback that runs when submit_btn is clicked (if you made your own .ui file, make sure you named your submit button submit_btn). That will happen automatically if we name the callback on_submit_btn_clicked().
The ...
Read now
Unlock full access