How To Open A Second Window - PyQt5 GUI Thursdays #24

  Рет қаралды 66,206

Codemy.com

Codemy.com

Күн бұрын

In this video I'll show you how to create and open a second window in your PyQT5 app.
We'll create a second window using the designer, and then open that second window by clicking a button in our main window.
I'll also show you how to open a dialog box without buttons using the same method.
#pyqt5 #codemy #JohnElder
Timecodes
0:00​​ - Introduction
1:00 - Create Main Window In Designer
1:58 - Create Second Window In Designer
2:38 - Rename Second Window
3:50 - Create Dialog Box Without Buttons In Designer
4:55 - Convert UI Files To Python
6:04 - Create Function To Open Second Window
8:04 - Import Second Window To Python File
8:28 - Call Function When Button Clicked
9:08 - Test It Out!
9:36 - Open Dialog Box Window
12:40 - Conclusion

Пікірлер: 108
@Codemycom
@Codemycom 3 жыл бұрын
▶️ Watch Entire PyQt5 GUI Thursdays Playlist ✅ Subscribe To My KZbin 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
@codeKeshav
@codeKeshav 3 жыл бұрын
Sir, John Double click on the widgets to change the text or to write. No need to scroll in search of it...
@Lux1431996
@Lux1431996 2 жыл бұрын
Your videos are saving weeks or months of search for my diploma thesis. Thank you so much for that!! Your explanations are insane and so effective fro learning. Probably finally a worthy book and online course to buy soon :)
@Codemycom
@Codemycom 2 жыл бұрын
Happy to hear it!
@RyanDanielG
@RyanDanielG 2 жыл бұрын
Great Python PyQt5 tutorial! Thanks for these! Feed the algorithm! its free and it helps our favorite creators.
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@bogdannowak6624
@bogdannowak6624 Жыл бұрын
Thank you very much. In this video, I found what I couldn't find anywhere else.
@Codemycom
@Codemycom Жыл бұрын
Happy to hear it!
@adri8926
@adri8926 2 жыл бұрын
the best video i have found on the subject of opening windows.
@Codemycom
@Codemycom 2 жыл бұрын
Glad you liked it!
@Tetianaoutdoors
@Tetianaoutdoors 4 ай бұрын
Love this series. Thanks SO much.
@Codemycom
@Codemycom 4 ай бұрын
Welcome! Happy to hear it!
@Gamer-sd1uo
@Gamer-sd1uo 2 жыл бұрын
You are the greatest man in the world you saved my life i was finding it and i know your tutorial will work so i watched it it is soososososoo great you are the greatest
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@riadhidriskhodja6825
@riadhidriskhodja6825 2 жыл бұрын
you're a life saver thank you !
@Codemycom
@Codemycom 2 жыл бұрын
Welcome!
@codeKeshav
@codeKeshav 3 жыл бұрын
I was waiting for this particular video for many days....
@Codemycom
@Codemycom 3 жыл бұрын
cool
@user-vc7is1mc6d
@user-vc7is1mc6d 5 ай бұрын
thank you so much your tutorials are invaluable
@Codemycom
@Codemycom 5 ай бұрын
Welcome!
@abrarmulla1196
@abrarmulla1196 3 жыл бұрын
Less goooo Thanks for making a video about this.
@Codemycom
@Codemycom 3 жыл бұрын
sure thing!
@joaopaulodasilva4912
@joaopaulodasilva4912 Жыл бұрын
You help us a lot with PySide. Thank you so much
@Codemycom
@Codemycom Жыл бұрын
I have no videos on PySide.
@laurentreynaud4404
@laurentreynaud4404 3 жыл бұрын
Thank you very much!
@Codemycom
@Codemycom 3 жыл бұрын
Very welcome!
@shabane
@shabane 2 жыл бұрын
you are awesome, thank you so much.
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@ProximityGaming_PM
@ProximityGaming_PM 3 жыл бұрын
Awesome video!! Would love a video on how to implement another python script into the interface we make, such that it even shows results 🔥🔥🔥
@Codemycom
@Codemycom 3 жыл бұрын
Just do it in the normal way you integrate any additional python script into a python file.
@chien5486
@chien5486 2 жыл бұрын
This is helpful. Thanks god for created u. Much love.
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@kitten5351
@kitten5351 Жыл бұрын
thanks a lot sir .. god bless you
@Codemycom
@Codemycom Жыл бұрын
Welcome!
@Python12321
@Python12321 3 жыл бұрын
Thank You!
@Codemycom
@Codemycom 3 жыл бұрын
You're welcome!
@arminamini658
@arminamini658 2 жыл бұрын
Thanks a lot!
@Codemycom
@Codemycom 2 жыл бұрын
You're welcome!
@maotykevin
@maotykevin Жыл бұрын
Thx you very much Sir , God bless u 💖💖
@Codemycom
@Codemycom Жыл бұрын
welcome
@user-gd4uk5tg6y
@user-gd4uk5tg6y 11 ай бұрын
I luv ur video man I luv it
@Codemycom
@Codemycom 11 ай бұрын
thanks!
@kyletayzon1459
@kyletayzon1459 2 жыл бұрын
very nice
@garyt2185
@garyt2185 2 жыл бұрын
Your videos are fantastic. I'm not understanding why the need to convert the ui files to py files. Any changes to the ui file with QtDesigner will require another conversion and any added code to the py file is lost. Why not control all the window operations in a main py file?
@galawa5926
@galawa5926 2 жыл бұрын
Hmm I have a question 🤔 how can we modify a window size from a button that’s on an other window ? (updating the window from an other window) thank you for the video ☺️
@conorman75
@conorman75 2 жыл бұрын
Great video , as usual. I have a question, how do I pass data from window2, back to window1? I'm tearing my hair out with this one, I just cannot get my head around navigating the classes.
@jhamdare
@jhamdare Жыл бұрын
Good video and explanation, how can we pass the parameters and receive them from other window.? Can you send a link if any video exist.
@meme567dtfc
@meme567dtfc Жыл бұрын
شرح راااااائع ❤️❤️❤️❤️
@Codemycom
@Codemycom Жыл бұрын
Thanks!
@kiritosaonline7217
@kiritosaonline7217 3 жыл бұрын
Sir please do python opencv tutorials in the future :) thank you wish you all the best
@andresfelipechaconalonso1930
@andresfelipechaconalonso1930 Жыл бұрын
Hi, I have a question, how can I return to MainWindow? I was trying with the import but causes a circular problem, moreover I was trying to send MainWindow as a paremater in the setupUI, but I can't figure it out how to return. I really appreciate your advices. The video is AWESOME!
@shyamrathod1536
@shyamrathod1536 2 жыл бұрын
I m really Appreciate sir
@Codemycom
@Codemycom 2 жыл бұрын
Happy to hear it
@mustaphachenine848
@mustaphachenine848 2 жыл бұрын
thank you
@Codemycom
@Codemycom 2 жыл бұрын
Welcome
@yasharfarzizadeh
@yasharfarzizadeh 10 ай бұрын
I very very tried to do this but I couldn't do this your video helped me for do. thank you very much for helping me👌👌👍👍😁😁
@Codemycom
@Codemycom 10 ай бұрын
welcome
@HunterzWorld
@HunterzWorld 10 ай бұрын
I want to close the first window and after that open second window what should i do for that
@abrarmulla1196
@abrarmulla1196 3 жыл бұрын
I have a question How do you hide the first Window after opening the second window?? and If we have a input field then how do we pass the data in the other screens??
@niklaskras5498
@niklaskras5498 Жыл бұрын
In the method where you open you second window you can write nameofyourmainwondow.hide(). To pass on data you can get the data from your input depending on the input widget with .value() or .text() or whatever and then just make a variable in your second window with secondwindow.variablename = thedata.
@StalkedByLosers
@StalkedByLosers 2 жыл бұрын
Will this make the parent window freeze up? Suppose there is data streaming into window 1 to a textEdit window and the second window pops up. Would the stream freeze?
@ender3530
@ender3530 2 жыл бұрын
If you need to do that but from a main, how do you do it? Whatever I do it says I can't import the window in py form, and copy and pasting is useless
@bytewasd
@bytewasd Жыл бұрын
you just saved my project+++++++++++++:
@Codemycom
@Codemycom Жыл бұрын
Happy to hear it
@korayalkankarakoc5238
@korayalkankarakoc5238 Жыл бұрын
Thanks man!
@Codemycom
@Codemycom Жыл бұрын
Welcome!
@khunden
@khunden 2 жыл бұрын
Could you show us how to create dialog boxes by loading the dialog ui directly?
@Crazy_octo
@Crazy_octo 5 ай бұрын
man like Walter White ahahaha thx man
@black__knightyt7252
@black__knightyt7252 Жыл бұрын
How do you open a third window, if you pressed a button in window 2?
@metinkarakus322
@metinkarakus322 3 жыл бұрын
Awesome content! Thank you so much. However there is something i need to ask: Let's say we built the gui and and converted it to python file. After some coding we noticed a flaw in the gui and we need it to be an .ui file again to make the necessary adjustments. How do you convert it back to make adjustments?
@Codemycom
@Codemycom 3 жыл бұрын
Yeah, I need to do a video on this topic..
@metinkarakus322
@metinkarakus322 3 жыл бұрын
@@Codemycom It would be awesome. Thank you!
@houimelfiras302
@houimelfiras302 Жыл бұрын
i want to hide the first mainwindow where i open the second mainwindow and i want to hide the second main window where i open the third mainwindow but i can't i don't how to fix it help me please
@pheebslira
@pheebslira Жыл бұрын
What if I had three windows, how would I close the second window?
@jimgana3916
@jimgana3916 7 ай бұрын
Hi, I realy like your videos, I learned a lot with them , thank you very muche and keep the good job. I need your help if u can help of course. I have a main window that i load with the 'loadUi' fonction', and I have a process under a function called 'upload_DB_to_remote' that takes some time to terminate , and when this function is started , the main Window does not show up until the told function have terminated its job, and this is really frustrating and non professionnal. My question is : how is it possible to make the mainwindow show up even if the function is still running. Because when this function is running , the user do not have any information on the screen, and does not know what is happening until it terminates, and displays a pop up message stating of the process status. If you have already done a video on this case, can you give me the link please !!! If not, could you do it and send me the link ? This will be really appreciated. Thank you again and have a nice day ! Kader D.
@Codemycom
@Codemycom 7 ай бұрын
Look into threading with python
@portinho199
@portinho199 2 жыл бұрын
Hi John, what's up? Man, I have a question about .ui file converter to .py. I having used the Designer from PySide6 and the command that you used to convert yours code not work in my version, so I have to use the follow command: pyside6-uic mainwindow.ui > ui_mainwindow.py The problem is that in final convertion, the .py file have not the lasted lines as your code: if __name__ == '__main__':... etc In my case, the final lines from .py file are: def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) self.pushButton.setText(QCoreApplication.translate("MainWindow", u"Chama 2\u00ba Tela", None)) # retranslateUi Have you any solution or alternative to my conversion works as yours? Thank you very much for these videos. Regards from Brazil
@Codemycom
@Codemycom 2 жыл бұрын
Sorry, Pyside6 is a completely different thing
@faishalichal8934
@faishalichal8934 Жыл бұрын
if i i give the button in second window and give the function of the button, how to combine betweet first and second gui?? i already tried it but still failed? can yu help me? or do you have discord channel?
@Ybby999
@Ybby999 2 жыл бұрын
Why do you convert from .ui to .py files? I've been loading them and working with .ui files without issue. Pretty sure the conversion isn't needed!
@Codemycom
@Codemycom 2 жыл бұрын
You can do it that way as well. We do that later in the playlist, I like to teach all ways.
@leventefarkas4163
@leventefarkas4163 2 жыл бұрын
@@Codemycom which video is that sir?
@Codemycom
@Codemycom 2 жыл бұрын
@@leventefarkas4163 Check the playlist yourself.
@leventefarkas4163
@leventefarkas4163 2 жыл бұрын
@@Codemycom I have 3 ui files one is the main window and the other two are needed for a very long list, so I wondering if i can open a second window with a ui file in the same program without usin MDI area. Your answer will de butch appreciated sir.
@binukraihaan
@binukraihaan 2 жыл бұрын
What is the terminal that you are using in this video?
@Codemycom
@Codemycom 2 жыл бұрын
git-scm.com
@michaelelder5336
@michaelelder5336 Жыл бұрын
Is there a way to call the windows as the .ui files instead of having to convert them to .py?
@talitajames7652
@talitajames7652 Жыл бұрын
I doubt that, the .ui files are stored as XML, so its defiantly easier to convert to .py
@michaelelder5336
@michaelelder5336 Жыл бұрын
@@talitajames7652 I actually found a video by this same guy that shows how to do it, but I don't know enough about python yet to use it to open up anything other than the main window of my gui.
@Karol30011
@Karol30011 Жыл бұрын
Hello, i have a problem. When i want to open second window i csnt use it. I can only use main window
@RajGupta-sg7jn
@RajGupta-sg7jn Жыл бұрын
same issue
@Karol30011
@Karol30011 Жыл бұрын
@@RajGupta-sg7jn setwindowmodality to applocationmodal or other
@-ff958-4
@-ff958-4 2 жыл бұрын
Yo mr white started programming now
@Codemycom
@Codemycom 2 жыл бұрын
lol
@ojector
@ojector Жыл бұрын
it closing while i am trying to run it
@Codemycom
@Codemycom Жыл бұрын
Check your code for errors.
@frikbrits6335
@frikbrits6335 2 жыл бұрын
Opening these two windows from a menu is quite something else that does not work.
@Atonix99
@Atonix99 2 жыл бұрын
My window just crashes when I clicked it…
@leventefarkas4163
@leventefarkas4163 2 жыл бұрын
same here, but i loaded the ui for the firs window
@Ybby999
@Ybby999 2 жыл бұрын
Why would you convert .ui files to .py files? They work fine as .ui files! There's no need to convert them...
@Codemycom
@Codemycom 2 жыл бұрын
No, you're mistaken.
@jopayobik
@jopayobik 10 ай бұрын
doesnt work gets an error thanks
@Codemycom
@Codemycom 10 ай бұрын
you typed something wrong then
@Ybby999
@Ybby999 2 жыл бұрын
Hey man, are you removing my comments? I've responded to an earlier question but my comment keeps getting deleted
@Codemycom
@Codemycom 2 жыл бұрын
No clue what you're talking about
@dedpihto680
@dedpihto680 Жыл бұрын
lol guys dont use pyuic5 window1.ui. i just use loadUI(windows.ui, self) in my python code
@samrusso8259
@samrusso8259 2 жыл бұрын
Hi John, Thanks so much for the video. I've been struggling to get a very similar app working where the only difference is that the 2 windows are not compiled QTdesigner.ui files to py files, but rather each py file has a ui file it loads. 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. It makes more sense to me to work with ui files as then you can go back to change them only if you need to modify the interface without wrecking python code.
Pass Data Between Windows - PyQt5 GUI Thursdays #25
10:27
Codemy.com
Рет қаралды 28 М.
File Dialog Boxes With QFileDialog - PyQt5 GUI Thursdays #29
12:47
Опасность фирменной зарядки Apple
00:57
SuperCrastan
Рет қаралды 12 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 22 МЛН
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 110 МЛН
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 208 МЛН
Introduction to GUIs in Python with PyQt5
26:10
Clear Code
Рет қаралды 84 М.
Build a Calculator With PyQT5 Designer - PyQt5 GUI Thursdays #8
21:20
How To Load PYQT5 Designer UI File - PyQt5 GUI Thursdays #27
15:29
Qt Tutorials For Beginners 9 - How to Show Another Window From MainWindow in QT
13:01
PyQt5 Tutorial - QMessageBox and Popup Windows
9:13
Tech With Tim
Рет қаралды 151 М.
QtDesigner and PyQt5:  The right and wrong way to use them together
37:16
Alan D Moore Codes
Рет қаралды 107 М.
Creating Your Own Qt Applications...It's Easy!
15:27
DistroTube
Рет қаралды 36 М.
Опасность фирменной зарядки Apple
00:57
SuperCrastan
Рет қаралды 12 МЛН