DESIGNER
Qt Designer lets you build PyQt interfaces by dragging widgets instead of hand-coding every button. This guide shows how to get it, design a form, and wire that form into your Python app two different ways.
What is Qt Designer?
Qt Designer is a visual editor for Qt interfaces. You drag widgets onto a canvas, set their properties in a panel, and arrange them with layouts. Then you save the result as a .ui file, which is just XML that describes your screen.
It is a huge time-saver for forms, settings pages and any screen with lots of fields. You see the layout as you build it, instead of guessing from code.
Getting Qt Designer
The easiest way is the tools package:
pip install pyqt6-tools pyqt6-tools designer
On some platforms Designer comes with the official Qt installer instead. Both make the same .ui files, so either is fine.
Designing a form
Open Designer and pick the "Widget" template. Drag a label, a line edit and a push button onto the canvas. Select them all and apply a vertical layout so they line up and resize cleanly.
Now give each widget a clear name in the property panel — the objectName. You will use those names in Python, so pick ones you will recognise, like nameEdit and saveButton. Save the file as form.ui.
Loading the .ui at runtime
The quickest route reads the file when the app starts. No extra build step:
from PyQt6 import uic
from PyQt6.QtWidgets import QApplication
app = QApplication([])
win = uic.loadUi("form.ui")
win.saveButton.clicked.connect(lambda: win.label.setText("Saved!"))
win.show()
app.exec()Notice how you reach widgets by the names you set in Designer. This keeps your Python short and your layout in one place.
Compiling with pyuic6
For bigger projects, compile the form into a Python class once, then import it:
pyuic6 form.ui -o ui_form.py
This creates a Ui_Form class. In your window class, call setupUi(self) to build the screen. Compiling is a little faster at start-up and makes the layout easy to version-control.
When to use Designer
Designer shines for complex, mostly static layouts, and for trying ideas fast. For small screens or highly dynamic ones, hand-written code can be quicker. Many teams mix both: Designer for the skeleton, Python for the behaviour.
Connecting widgets after loading
Designer lays out your screen, but the behaviour still lives in Python. After you load the .ui file, you reach each widget by the object name you gave it and connect its signals.
So a button named saveButton becomes win.saveButton in code. Give your widgets clear names in Designer and this step reads almost like plain English, which makes the whole app easier to follow.
Using custom widgets
Sometimes you build your own widget in Python and want to drop it into a Designer layout. Designer supports this through "promotion". You place a normal widget as a stand-in, then promote it to your custom class.
At runtime, your real widget takes its place. This lets you mix hand-written components with drag-and-drop layouts, which is handy for charts, custom paint areas and other special controls.
A healthy Designer workflow
Keep the .ui file as the single source of your layout. Do not hand-edit the generated Python, because it is overwritten each time you compile. Put your logic in a separate class that uses the layout.
This split keeps design and code from stepping on each other. A designer can tweak the screen while a developer works on behaviour, and neither undoes the other's work.
Why designers love it
Qt Designer lets you see the screen as you build it. You drag a widget, drop it, and it is there. You change a property and the preview updates. For anyone who thinks visually, this is far more natural than imagining a layout from code.
It also speeds up teamwork. A designer can shape the look while a developer writes the behaviour, and the two meet at the .ui file. Nobody has to wait for the other to finish, which keeps a project moving.
Even seasoned developers reach for Designer on big forms. Laying out twenty fields by hand in code is tedious. In Designer it takes minutes, and the result is easy to tweak later.
Tips for clean forms
A few habits keep Designer files tidy. Always wrap your widgets in layouts, so the form resizes well. Name every widget you will use in code with a clear, consistent name. And group related fields with spacers so the screen breathes.
Use form layouts for label-and-input rows, grids for tables of controls, and box layouts for everything else. Mixing them thoughtfully gives a professional result without any code at all.
Finally, preview your form at different sizes inside Designer. If it still looks right when stretched or shrunk, your layout is solid and will behave the same way once it is loaded in Python.
Key takeaways
Qt Designer turns screen building into drag and drop. You arrange widgets visually, save a .ui file, and load it into Python either at runtime with uic.loadUi or compiled with pyuic6. The heavy layout work happens in minutes instead of hours.
Keep the design and the logic apart. The .ui file holds the layout; your Python class holds the behaviour. Reach widgets by the clear names you set in Designer, and never hand-edit the generated code, which is overwritten each time.
Use Designer for big, mostly static forms and for trying ideas fast. Hand-written code still suits small or highly dynamic screens. Most teams happily mix both, and the .ui file is where design and development meet.
FAQs
Is Qt Designer free?
Yes. It comes with the free tools and the open Qt install.
Should I load or compile the .ui file?
Load it at runtime for small apps. Compile it with pyuic6 for larger projects you maintain over time.
Can I edit the generated Python file?
Avoid editing it by hand — it is regenerated. Put your logic in your own class instead.
Why can't I find the designer command?
Install pyqt6-tools, or use the Designer bundled with a full Qt install. See our troubleshooting guide.
Conclusion
Qt Designer turns screen building into drag and drop. Install it, design a form, and load it with uic.loadUi or compile it with pyuic6. Use it for the heavy layouts and keep your logic in Python. Next, learn how those widgets talk to your code in our signals and slots guide.
Ready to start? Download PyQt or run pip install PyQt6.