PyQt5 Tutorial - How to Use Qt Designer

preview_player
Показать описание
This pyqt5 tutorial will show you how to use Qt Designer with python. The first steps to using QtDesigner is to download and install pyqt5-tools (this can be done through pip). Next you need to locate the designer application. This can be found in your python install locations Lib/sit-packages/pyqt5-tools folder. It is named "designer".

Command to turn .ui to .py
pyuic5 –x "filename".ui –o "filename".py

◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python

◾◾◾◾◾◾

⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡

Tags:
- Tech With Tim
- Python Tutorials
- PyQt5 Tutorial
- PyQt Designer
- How to use pyqt designer

#python #pyqt5 #qtdesigner
Рекомендации по теме
Комментарии
Автор

Using python 3.9 I found the designer.exe in site-packages -> qt5_applications -> Qt -> bin👍

chriss
Автор

Using Python 3.10.4, I found that PyQt5-tools had an error when installing. PyQt5 was fine. Nothing seemed to resolve this until I removed Python and installed 3.9.10 which allowed me to install both PyQt5 and PyQt5-tools. The Designer and pyuic5 both worked perfectly.

Great tutorial! Thank you Tim.

markjohnson
Автор

I've been searching for how to make my Designer work for a month: googling weird advices, reading overcomplicated articles, digging into documentation... And you has solved my problem in a half an hour. Thanks!!!

crimsonjester
Автор

Initially I couldn't find pyqt5-tools inside scripts. Using pycharm with virtual environment made using virtualenv, python version 3.10.5. pyqt5-tools didn't get installed in my system for some reason. So, "pip install PyQt5Designer" within the same working directory as my virtual environment worked for me. I can now use designer.exe. As always, I'm grateful to tim for his clear explainations and free tutorials. God bless you brother, keep up the good work. You're definitely making this world a better place.

ashish
Автор

Just open up your console and type in "designer" after the pip installs

AnnoyingErrors
Автор

For those who are experiencing this error:
"'pyuic5' is not recognized as an internal or external command,
operable program or batch file. "

This is because your pyuic5.exe is not in PATH. Probably your pyhton script folder is not in PATH, even though you put the option "add to Path" when you were installing Python.

This happened to me, my Python folders are scattered around and I don't even know why. There are two methods of resolving:

01 - (What I did) The folder he shows that has all the files that pip installed, I added to PATH. (So much so that when you install a new library, you will no longer see that warning suggesting to add it to the path as the entire folder is already there.)
There are already tutorials on the internet, it's very simple

02 - Instead of typing "pyuic5", you write the location where "pyuic5.exe" is. It's more complicated, but it also works.

Like if I helped you :)

guireis
Автор

8:11 TIL that you can open command prompt in a folder by typing cmd in the address bar

wabalabavxx
Автор

This helped me a lot to get started, however I learned later that this is not the best way to program a more complicated program, as each time you edit the GUI, you rebuild the code, and have to code everything again (or just copy and paste). I found much more efficient to create a main program that loads the .ui file that's generated. It means you can make any changes to the GUI in QTDesigner and your code will not be affected.


I used the function loadUI for the uic package in PyQt5.



Just in case anyone else gets stuck there! Thanks for the tutorial, it def helped me to get started!

thekillerbunny
Автор

If u cant find the designer in pyqt5-tools
then Qt then bin folder


If Qt folder is not shown then install "Qt for Python' extension on vscode etc

zitrakzsingh
Автор

For anyone getting this error when trying to open the deigner: "this application failed to start because no qt platform plugin could be initialized" I solved it by going into the plugins folder and copying a folder called "platforms", I then pasted the folder where the designer.exe is located.

SafikMaster
Автор

Just started a python project that needed a GUI - having never done this much in python (I've done the odd py project and used circuitpython a fair bit but not as complex as my current project) -- this video playlist has been a godsend! Thank you so much for this pyqt5 series playlist / tutorial :)

IAmOrion
Автор

I finally got QtDesigner installed on my Samsung Chromebook Plus v2. To start out with, I installed all of QtCreator and Qt5. I ended up with a /usr/bin/designer that didn't work. It wanted something and I couldn't figure out what

I installed QtDesigner for Qt 4, and that one worked. I found out that /usr/bin/designer was a reference.

I changed my .desktop file for the "Qt 4 Designer" (find | grep) to "Qt Designer" and changed its command to "designer -qt=5". This means that the Qt4 version exists, but for whatever reason the new one works because of that.

Maybe this will help someone.



PLEASE KEEP MAKING THESE VIDEOS! PyQt is terribly under-documented.

davidgrove
Автор

Another way of finding where Python is installed on Windows is just typing the command in CMD: "where python" and it will show the installed locations on your PC!

noobownerbob
Автор

Hey Tim. Great tutorials. I just wanted to share an update. For those looking for the Designer.exe file, mine was located in

ronaldknerr
Автор

Definitely my new favorite channel that I found.... I'm going to go through your pygame tutorial series soon

Soljarag
Автор

Import uic and just load the .ui file... it's much simpler and will save you SO much time when you want to change something

cornevanzyl
Автор

This is the tutorial I've been waiting for - in particular 9:24

rob
Автор

Earned my subscribe bro. I'm a big ole Windows nerd. I use hotkeys for everything, I know all of the little tricks, I customize it to hell. In short, I use Windows very efficiently.... but man, I never knew you could open a cmd prompt by typing cmd in the address bar... You added another tool to my tool belt.... Oh, and you're also very smart, you teach in an effective way, and third compliment. Thanks.

Dimlutube
Автор

Thank you, great tuto. Just one thing, instead of explaining, how to search for hours where is python.exe on your computer, just open the console and type "where python", that's it!

mikaelloeser
Автор

Hey Tom, I recently started following your tutorial videos on PyQt5. Let me tell you: Thanks so much for the GREAT work. By far, you are the best! Keep it going.

Scanito