Algoteka
Log in to submit your own samples!

Load user interface from a file

Problem by oml1111
# Tech tags Title Creator Created date
1 0
PyQt5
PyQt
2023-07-09 19:57
View all samples for this language (1 verified and 0 unverified)

Load Qt Designer file | Python | PyQt5 PyQt |

By oml1111 |
0 likes

Allows you to render a GUI designed in QT Designer. In this example, renders the following window:
enter image description here

Code

from PyQt5.QtWidgets import QApplication  
from PyQt5 import uic  
  
application = QApplication([])  
window = uic.loadUi("qt_designer.ui")  
window.show()  
application.exec()

qt_designer.ui example - github.com

Further reading

QtDesigner Python - github.com
Qt Designer standalone version available here:
Qt Designer Download - build-system.fman.io

References

functions
PyQt5.QtCore.QCoreApplication.exec_ doc.qt.io
PyQt5.QtWidgets.QWidget.show doc.qt.io
PyQt5.uic.loadUi riverbankcomputing.com
classes
QApplication doc.qt.io

Problem Description

Load the GUI of your program from some file that defines it, usually created by some external GUI designer program.

View sample discussion (0 comments)
View problem discussion (0 comments)