▶️ Watch Entire PyQt5 GUI Thursdays Playlist ✅ Subscribe To My RUclips Channel: bit.ly/3sHT8dc bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code: bit.ly/394NQ3R
THIS is the info I've needed and never found an any other Qt Designer videos I've watched (which all seem to stop after "Hello World"). I kept wondering how you could ever go back and edit a UI (without doing it manually in the code), but not lose all your application code. Thanks!
You can completely skip defining all those widgets. Those widgets are defined and NAMED inside of designer. You call them by their EXACT custom name inside of the python file. Such as self.MY_CUSTOM_NAME_Label.setText("Some Text or variable")
I noticed in this code you are putting "super(UI, self).__init__()" Unless I missed it where did that come from compared to all the previous videos? Why is it needed here?
I have plot a graph from excel using python code and i have created a gui using qt designer, how can i plot this graph inside qt graphics view of gui .Please suggest
Why are you using the self.findChild method? I can access the objects directly after uic.loadUi with "self.textEdit", "self.pushButton" and so on. No need for creating new variables and setting them with findChild. Maybe I am using a newer version?
hey so when i try to make the button clicked thing I get the error "argument 1 has unexpected type 'QPushButton'" but I imported all right so yeah idk what is the problem
Good video! If I want to change the GUI in Qt designer, should I upload the new version of file with ui extension, or everything will be updated automatically since we linked file "loadui" with Python code? So, if I am updating the GUI via Qt designer I merely need to click "save" button to make changes? Then I can run my app with these changes and all previously coded functionality will be working
Hello. Trying to understand the connection between the UI file and the PY file. Is it correct that the UI is an XML that gets processed by the Qt package and Qt has a graphic render engine which consumes the XML and creates one form per UI? If yes, is there a manual of the XML commands? Thanks. Love this format.
Thanks for the info! When I first did this (and couple times afterward actually, respecting folder structure) it worked. Not too bad. However, whenever I move the files to a different folder, it can't find the .ui file. Even in same folder. Instead of looking at relative folders like imports do, it instead relies on the folder that vscode is in (terminal at bottom) (haven't tried it with other ide's studios etc) Is there a cleaner way to tell the py file where to find the ui file?
This can work: import os This is supposed to be, underscore underscore file underscore underscore But reads it as italicize, sorry it gets around it second time but not this first: __file__ will refer to the py file's actual directory path (AND name) But when using the following, path1 = os.path.dirname(__file__) this will just refer ONLY to the directory, and not include the file's filename. As long as both files are kept together in the same subfolder (or ui is in sub-subfolder from your py file), you can refer to the ui file using the above, as a string + ui file's name (or + sub-subfolder/uifile.ui etc) ie, fullpath1 = path1 + 'loadui.ui' This looks like an absolute path technique - it is an absolute path - but is initially relative using the py file's location stored as a variable, which THEN becomes absolute path. This might also be flexible enough to add portability for your programs (I'm not 100% sure it will work but I'm pretty sure:) ).
Great video, thanks! What if your GUI contains multiple windows, where each window represented by its own ui file? How would you import to the .py file those multiple ui files?
I guess you have to do the same process for each ui file, and manipulate them with different python files as well (for exemple, if you have a menu.ui, creates a menu.py, if you have register.ui, creates register.py and so on), like the video. So probably you will have to create a "master" python file to call them (like a "main.py"), and makes the transition of each one. This is what I guess because Im learning too.
Hello, John... Thank you so much about all your wonderfull gifts: These videoes... I have a problem running your program: TypeError: ('Wrong base class of toplevel widget', (, 'QDialog')) ----- (I did exactly what you did)...
Hi John, thank you for the great tutorial, I have one question, what i don't understand is if you have both py and ui files in qt creator why do you compleating coding in another editor, is there any problem completing both ui and py file in qt creator ??
I get 3 errors in PyCharm when i run my main.py file. They are 1. "Cannot find reference 'uic' in '__init__py' 2. 'Unresolved reference loadUi' 3. FileNotFoundError: [Errno 2] No such file or directory: '[file_name].ui, self Any idea how i can fix these errors?
Is there anywhere else that I can go research about this subject? This video works, but is alittle outdated. I used the QtDesigner, all blown out widgets and all, but trying to add them all inside those widgets I made is VERY challenging. Is there a place I can go? Does anyone know?
Hey John, whenever I try "from PyQt5 import uic" I get an error: uic is underlined in red, so when I try to do the uic.loadUi("load.ui", self), I get several errors. As I have been investigating, this seems to be a pretty common issue for lots of people. I have checked my Python and PyQT5 installation/configuration and they seem to be fine. In fact, I can run the line "from PyQt5 import uic" from the Python console with no problem. It is only from within the scrip in PyCharm that I am getting this problem. YOUR HELP WILL BE HIGHLY APPRECIATED!
I did everything you explained using pycharm. But when I got to the part that we pass MainWindow to the second window. I got an error saying: Ui_SecondWindow.setupUi() missing 1 required positional argument: ‘MainWindow’ But I actually did everything right
Hi John, Thanks heaps for you video. I have a loadUi question relating to a Homepage.py and 2 other windows that load ui files: Like this: * HomePage.py (this has a button labelled Goto_Window1.py that loads Window1.ui, and another button Goto_Window2 that loads Window2.ui. * When clicking on the Goto_Windows1.py it opens the Window1 window (and hides itself ie: HomePage.py) OR when when clicking on the Goto_Windows2.py it opens the Window2 (and hides itself ie: HomePage.py) * Both Goto_WIndows1.py and Goto_WIndows2.py have a "HOME" button which takes you back to the Homepage.py Can you please help me get a rough template for such an app.
John Elder, please make a video how can we control the second window from 1st using *LOAD UI* method. Please show how can we create responsive gui using PYQT5
▶️ Watch Entire PyQt5 GUI Thursdays Playlist ✅ Subscribe To My RUclips Channel:
bit.ly/3sHT8dc bit.ly/2IGzvOR
▶️ See More At: ✅ Join My Facebook Group:
Codemy.com bit.ly/2GFmOBz
▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
▶️ Get The Code:
bit.ly/394NQ3R
Great Python PyQt5 tutorial! Thanks for these!
Feed the algorithm! its free and it helps our favorite creators.
Thanks!
THIS is the info I've needed and never found an any other Qt Designer videos I've watched (which all seem to stop after "Hello World"). I kept wondering how you could ever go back and edit a UI (without doing it manually in the code), but not lose all your application code. Thanks!
Glad it was helpful!
Thanks!
Welcome!
Maaaan this is really insane, I didn't know that was possible to work without converting to python file.
You are amazing, thank you so much!!! 🙏
welcome!
Thanks a lot, I searched a ton of videos literally , Thanks a lot again, Liked & Subscribed 🙂
dude you saved my project, you're the best
Glad you found what you needed!
I always struggled to covert and reconvert every time .....thanks for the video it was a significant help.
welcome
Лысый, ваще красавчик респект таким как ты!
Man....... you saved my life!
Thanks for making these great videos. They are very helpful and instructive.
Glad you like them!
Suppose it have to the first tutorial in pyqt and only then other functions, since load ui is a fundamental of pyqt idea.
Great tutorial, thanks a lot
You can completely skip defining all those widgets. Those widgets are defined and NAMED inside of designer.
You call them by their EXACT custom name inside of the python file.
Such as
self.MY_CUSTOM_NAME_Label.setText("Some Text or variable")
Thank you! I thought I was loosing my mind as I could access the labels defined by their object name in Qt Designer
That's precisely what I'm looking for.
Thank you very much 😄
welcome
Yohoooo a new video...!!! Pleaseee speed uploading the videos up ,, I really need this course ,pleasee !!
I upload videos every single weekday, I'm not going to go any faster. Pyqt5 videos are every Thursday...
Very helpful, thanks a ton!
Welcome!
Thx a lot! This video really inspires me about how to start my homework!
Glad you enjoyed it!
Sweet. Worked like a charm. How do I add my image that goes with QmainWindow Qpixmap?
awesome vid! Thanks for breaking this down! made me love Python again! :-)
Awesome
Love From India ❤️
Thanks!
Me too
I noticed in this code you are putting "super(UI, self).__init__()" Unless I missed it where did that come from compared to all the previous videos? Why is it needed here?
Very helpful thank you so much I'm now following your every video.
Awesome!
This comment may seem like an ordinary “thank you” but it really really means more than a “thank you” 😅🙏
Glad you enjoyed it!
nice! thats what I was looking for
Happy to hear it!
sir these tutorials are very nice !!!
Thanks! Glad you like them!
I have plot a graph from excel using python code and i have created a gui using qt designer, how can i plot this graph inside qt graphics view of gui .Please suggest
Why are you using the self.findChild method? I can access the objects directly after uic.loadUi with "self.textEdit", "self.pushButton" and so on. No need for creating new variables and setting them with findChild. Maybe I am using a newer version?
Awesome! Thanks!
Welcome!
Amazing video! Thank you very much!
Very welcome!
Do you have a video showing how to open a second window (a different .ui file) from your main py code you are showing in this video?
that , What I'm looking for ,thank you very much , but is there any way to convert python script to GUI ?
It's really easier! Thank you so much!!!
Sure thing!
Hi,why i'm gettiing just a empty frame while i'm running that code?
hey so when i try to make the button clicked thing I get the error "argument 1 has unexpected type 'QPushButton'" but I imported all right so yeah idk what is the problem
Good video! If I want to change the GUI in Qt designer, should I upload the new version of file with ui extension, or everything will be updated automatically since we linked file "loadui" with Python code? So, if I am updating the GUI via Qt designer I merely need to click "save" button to make changes? Then I can run my app with these changes and all previously coded functionality will be working
I mean, it depends on the changes you make in the designer whether or not the code will still work.
For some reason none of the images are showing in my application.
Hello. Trying to understand the connection between the UI file and the PY file. Is it correct that the UI is an XML that gets processed by the Qt package and Qt has a graphic render engine which consumes the XML and creates one form per UI?
If yes, is there a manual of the XML commands?
Thanks. Love this format.
Hi sir, it really helps me out in our project, Thank you so much. Just 1 question Sir how can I convert the final code to .exe file?
I use a module called auto-py-to-exe, it’s very easy to use
Thank you so much.
Very Welcome!
I wish to learn this method before dev lots of pyqt apps.
more clean for managing.
For some reason it does not recognise the .clicked attribute. Any idea?
You typed something wrong somewhere
Thanks for the info! When I first did this (and couple times afterward actually, respecting folder structure) it worked. Not too bad.
However, whenever I move the files to a different folder, it can't find the .ui file.
Even in same folder.
Instead of looking at relative folders like imports do, it instead relies on the folder that vscode is in (terminal at bottom) (haven't tried it with other ide's studios etc)
Is there a cleaner way to tell the py file where to find the ui file?
This can work:
import os
This is supposed to be,
underscore underscore file underscore underscore
But reads it as italicize, sorry it gets around it second time but not this first:
__file__ will refer to the py file's actual directory path (AND name)
But when using the following,
path1 = os.path.dirname(__file__)
this will just refer ONLY to the directory, and not include the file's filename.
As long as both files are kept together in the same subfolder (or ui is in sub-subfolder from your py file), you can refer to the ui file using the above, as a string + ui file's name (or + sub-subfolder/uifile.ui etc)
ie,
fullpath1 = path1 + 'loadui.ui'
This looks like an absolute path technique - it is an absolute path - but is initially relative using the py file's location stored as a variable, which THEN becomes absolute path.
This might also be flexible enough to add portability for your programs (I'm not 100% sure it will work but I'm pretty sure:) ).
i got error
TypeError: ('Wrong base class of toplevel widget', (, 'QDialog'))
what can i do
Is anyone else getting the error where the app crashes on startup with no error? What should I do?
Great video, thanks! What if your GUI contains multiple windows, where each window represented by its own ui file? How would you import to the .py file those multiple ui files?
I guess you have to do the same process for each ui file, and manipulate them with different python files as well (for exemple, if you have a menu.ui, creates a menu.py, if you have register.ui, creates register.py and so on), like the video. So probably you will have to create a "master" python file to call them (like a "main.py"), and makes the transition of each one.
This is what I guess because Im learning too.
Hello, John...
Thank you so much about all your wonderfull gifts: These videoes...
I have a problem running your program:
TypeError: ('Wrong base class of toplevel widget', (, 'QDialog'))
-----
(I did exactly what you did)...
Where that 'QDialog' coming from...?
Hi John, thank you for the great tutorial, I have one question, what i don't understand is if you have both py and ui files in qt creator why do you compleating coding in another editor, is there any problem completing both ui and py file in qt creator ??
We don't have our py file in qt creator...
@@Codemycom sir i i cant import uic module it says module not found im using pycharm and python 3.9.7 how do i can fix this?
@@rahmadbisma Stop using pycharm
I get 3 errors in PyCharm when i run my main.py file. They are 1. "Cannot find reference 'uic' in '__init__py'
2. 'Unresolved reference loadUi'
3. FileNotFoundError: [Errno 2] No such file or directory: '[file_name].ui, self
Any idea how i can fix these errors?
Why I would never use PyCharm
Is there anywhere else that I can go research about this subject? This video works, but is alittle outdated. I used the QtDesigner, all blown out widgets and all, but trying to add them all inside those widgets I made is VERY challenging. Is there a place I can go? Does anyone know?
Yes, further along in this playlist you'll see a solution.
Id like a more ellaborate video with multiple different uses. Such as labels, inputs, notifications etc
@@againstthegrain5914 Yes, of course I do all of that on the playlist.
Hey John, whenever I try "from PyQt5 import uic" I get an error: uic is underlined in red, so when I try to do the uic.loadUi("load.ui", self), I get several errors. As I have been investigating, this seems to be a pretty common issue for lots of people. I have checked my Python and PyQT5 installation/configuration and they seem to be fine. In fact, I can run the line "from PyQt5 import uic" from the Python console with no problem. It is only from within the scrip in PyCharm that I am getting this problem. YOUR HELP WILL BE HIGHLY APPRECIATED!
Don't use pycharm, it sucks.
Make sure the interpreter you configured in PyCharm is the same one which you installed all PyQT5 stuff
@@bardub1 Thanks! Yes, I have it working now...
I did everything you explained using pycharm. But when I got to the part that we pass MainWindow to the second window. I got an error saying:
Ui_SecondWindow.setupUi() missing 1 required positional argument: ‘MainWindow’
But I actually did everything right
You're using pycharm...no clue what pycharm is doing. I would never use that.
How to open a second window with this way?
How to connect two different programs two ui files in two different py program
This is one I am really struggling to figure out. The biggest struggle I am finding with PyQt is using popups or dialogs .
For some reson the window doesn't even show up here
what did you do differently from the video?
i have a resource.qrc file how do i import that
I don't have any videos on that
Done thanks
welcome
thanks!
Teacher how open a live web server ?
I don't know what you mean by opening a live web server
Hi John,
Thanks heaps for you video.
I have a loadUi question relating to a Homepage.py and 2 other windows that load ui files:
Like this:
* HomePage.py (this has a button labelled Goto_Window1.py that loads Window1.ui, and another button Goto_Window2 that loads Window2.ui.
* When clicking on the Goto_Windows1.py it opens the Window1 window (and hides itself ie: HomePage.py) OR when when clicking on the Goto_Windows2.py it opens the Window2 (and hides itself ie: HomePage.py)
* Both Goto_WIndows1.py and Goto_WIndows2.py have a "HOME" button which takes you back to the Homepage.py
Can you please help me get a rough template for such an app.
Upload Daily!
I do!
Heisenberg ?
lol
breaking bad?
John Elder, please make a video how can we control the second window from 1st using *LOAD UI* method.
Please show how can we create responsive gui using PYQT5
He will pin my comment.
Will he?
Do you think?
No, I don't think so
thx
wlcm
Great Python PyQt5 tutorial! Thanks for these!
Feed the algorithm! its free and it helps our favorite creators.
Thanks!