Qt Designer helps you build a GUI (graphical user interface). You can load a GUI from Python. In this tutorial we’ll show you step by step.

It covers a very basic example of how to use Qt Designer with PyQt and Python. For more details see the link below.

Download Examples:
Download PyQt examples

Qt Designer Python


To start with this tutorial you need these installed:

  • Python
  • PyQt
  • Qt Designer

You will need Python 3 or above, because the others are out dated.

If you don’t have PyQt, install PyQt.

You can install Designer (Ubuntu Linux) with:

sudo apt-get install qttools5-dev-tools
sudo apt-get install qttools5-dev

On other platforms it’s included in the setup.

How to start Designer

Start designer by typing designer in the command line. Important: qt creator is another program.

On Ubuntu Linux:

cd /usr/lib/x86_64-linux-gnu/qt5/bin/ 


A popup shows up. You can choose what you want to design.

pyqt designer

Choose “Main Window” and click create.

You can then resize the form and drag and drop widgets. It’s pretty simple to design a graphical interface like this.

If you click on a widget (say a button), you can set its properties like name.

qt designer

Export Design to UI

You can export your design to a UI file. Click File > Save As > yourname.ui

Then you can convert the ui code to a python file.
Like this:

pyuic5 /home/linux/helloworld.ui -o helloworld.py

The Python file then contains the gui definition.
Create another file that loads the ui file:

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication
import sys
import helloworld

class ExampleApp(QtWidgets.QMainWindow, helloworld.Ui_MainWindow):
def __init__(self, parent=None):
super(ExampleApp, self).__init__(parent)

def main():
app = QApplication(sys.argv)
form = ExampleApp()

if __name__ == '__main__':

Once you run it your GUI appears.