0% found this document useful (0 votes)
2 views

Building-PyQt-GUI

Uploaded by

velrajan2004
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Building-PyQt-GUI

Uploaded by

velrajan2004
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Building PyQt Graphical User Interface

Follow steps described below to create design of future GUI, convert it from .ui to .py file
and run application.

Step 1: Create design of GUI in Qt Designer

To run Qt Designer open Terminal (or Anaconda Prompt), activate your environment where
you have installed Qt Designer and use following command:

• designer

As a result, the main window of Qt Designer will be opened.

• Drag and drop Label and PushButton from Widget Box


• Add Lay Out Vertically to make elements follow main window when it is resized
• Make adjustments of maximum size for elements and main window in Property Editor
• Save created GUI and name it, for instance, design.ui
Section-7
Building PyQt GUI
Step 2: Convert .ui into .py

To convert .ui file into .py file open Terminal (or Anaconda Prompt), activate your
environment where you have installed PyQt, then navigate to saved file design.ui and run
following command:

• pyuic5 design.ui -o design.py

As a result, new file design.py will appear next to design.ui file.

Step 3: Run Application

Copy converted file design.py into folder GUI that includes downloaded file gui.py and image.

• Run file gui.py


• Click on button and find image
• Click open

As a result, image will appear in the GUI window.

Page 2

You might also like