[PyQt] Confusion about load.uic() and import regarding pyinstaller

michael h 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...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190307/ba80a046/attachment.html>


More information about the PyQt mailing list