How to Load Qt Designer UI File in PyQt6

In this lesson we are going to learn How to Load Qt Designer UI File in PyQt6, so Qt Designer is the Qt tool for designing and building graphical user interfaces (GUIs) with Qt Widgets. You can compose and customize your windows or dialogs in a what-you-see-is-what-you-get (WYSIWYG) manner, and test them using different styles and resolutions. Widgets and forms created with Qt Designer integrate seamlessly with programmed code, using Qt’s signals and slots mechanism, so that you can easily assign behavior to graphical elements. All properties set in Qt Designer can be changed dynamically within the code. Furthermore, features like widget promotion and custom plugins allow you to use your own components with Qt Designer. Qt Designer is not part of PyQt6, for using Qt Designer we need to install another library that is called PyQt6 Tools.

 

 

 

 

Now let’s open our Qt Designer and we are going to build a simple design.

Qt Designer
Qt Designer

 

 

 

Now we have our design, after that save your design and it will be a UI file, iam going to call it myapp.ui after that create a python file, iam going to call it LoadUI.py file, and now add this code.

 

 

 

 

Now run your complete code and this will be the result.

How to Load Qt Designer UI File in PyQt6
How to Load Qt Designer UI File in PyQt6

 

Leave a Comment