In many sources it is described how the ui files created with the QtDesigner are converted to a .py file using pyuic (4/5) in order to import this file and to generate a new class using inheritance.
But there is also the following possibility to use the ui file (s) directly:
> from PyQt5 import uic > > class Ui (QMainWindow): > """ Main window class of my cool app """ > > def __init __ (self, * args, ** kwds): > super (Ui, self) .__ init __ (* args, ** kwds) > """ Initialize the UI Class """ > > uic.loadUi ('ui / mainwindow.ui', self)
This seems to me to be a much faster and more convenient way because converting is unnecessary. Only that does not seem to be common. Are there any significant disadvantages to doing this?