[PyQt] Confusion about load.uic() and import regarding pyinstaller
michaelkenth at gmail.com
Thu Mar 7 22:54:53 GMT 2019
> Both did run, but if I use the import and set e.g.
> "self.ui.setWindowTitle('Do not read my title')" the app crashes with
> "AttributeError: 'Ui_MainWindow' object has no attribute 'setWindowTitle'"
> I don't understand the reason and in addition I have no idea how to solve
> this. Further ith hangs on
> widgetList = self.ui.findChildren (QPushButton)
> AttributeError: 'Ui_MainWindow' object has no attribute 'findChildren'
> The idea behind was that I compile the ui before I run pyinstaller to
> avoid problems at runtime.
You need to call self.setWindowTitle or self.findChildren. Those are
methods on QMainWindow.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt