Learn Python GUI Development for Desktop - PySide6 and Qt Tutorial
HTML-код
- Опубликовано: 28 июл 2024
- Learn how to use Qt for Python using PySide6 to build cross platform desktop apps for Windows, Mac and Linux.
💻 Source code: github.com/rutura/Qt-For-Pyth...
✏️ Course developed by Daniel Gakwaya. Check out his RUclips channel: / @learnqtguide
🐦 Twitter: / learnqtguide
🔗 Want more from Daniel? www.learnqt.guide/udemy-disco...
🔗 Join Daniel's discord server for support: / discord
⭐️ Course Contents ⭐
Part 1:
⌨️ (0:00:00) Intro
⌨️ (0:05:50) Welcome
⌨️ (0:16:54) Get the most
⌨️ (0:19:55) Python and PySide6 Install
⌨️ (0:28:41) Understanding the code
⌨️ (0:35:40) Organizing the code in classes
⌨️ (0:50:57) Signals and Slots
⌨️ (1:08:47) Intro to Widgets
⌨️ (1:09:21) Using QWidget
⌨️ (1:22:02) QMainWindow
⌨️ (1:48:02) QMessageBox
⌨️ (2:06:46) QPushButton
⌨️ (2:12:31) QLabel and QLineEdit
Part 2:
⌨️ (2:24:33) QTextEdit
⌨️ (2:42:11) QLabel and Images
⌨️ (2:47:29) Size Policies and Stretches
⌨️ (3:02:10) QGridLayout
⌨️ (3:09:42) QCheckBox and QRadioButton
⌨️ (3:25:45) QListWidget
⌨️ (3:37:32) QTabWidget
⌨️ (3:45:35) QComboBox
⌨️ (3:52:22) Qt Designer : Introduction & Install
⌨️ (3:59:41) Using Qt Designer
⌨️ (4:08:40) Qt Designer and QUiLoader
⌨️ (4:17:48) Wrapping loader object into ui class
⌨️ (4:24:11) Compiling User Interfaces to Python
⌨️ (4:39:57) Working with resources manually : Qt Designer
⌨️ (4:56:41) Loading resources from Qt Designer
⌨️ (5:04:05) QMainWindow : Putting it all together!
⌨️ (5:18:01) Farewell
🎉 Thanks to our Champion and Sponsor supporters:
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Erdeniz Unvan
👾 Justin Hual
👾 Agustín Kussrow
👾 Otis Morgan
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news
Wow, 15 minutes into this course, already so hyped. I cannot believe this is for free. I thank you so much guys for sharing your knowledge. I really had to pause this video and appreciate the moment, again, thank you so much guys! The presenter is also super awesome and easy to follow, awesome structure etc. Amazing job, greetings from Lithuania
Incredible tutorial! It's awesome that you explain the details and not just make us memorise the codes.
Thank you for this. I wanted to take a deeper dive into GUI development with Python, and this course was great!
Been trying to learn Qt for a month from their own tutorials and examples and have been banging my head against a wall trying to separate out the code into classes / instances. This tutorial series is exactly what i needed. Clear, concise and actionable examples. Thank you so much.
I have not looked at the documentation but I really despise when libraries are over-bloated and do not provide good examples. Making it so you have to have a PHD in their docu before you can create a simple window. Excellence is always simplicity, not the opposite.
The more I watch this, the more I'm impressed by this video. Covers so much but well organised and clearly explained. Thank you!! 🙏
Indeed !
Thank you! I've done all kinds of crazy things using what I learned from this video!
I really love "you can do every kind of crazy things", truly amazing teacher
Thank you so much, what a wonderful course, keep going brother.
If you are on MacOS at 1:27:00 you need to add this line after self.setWindowTitle("Custom Window")
self.menuBar().setNativeMenuBar(False)
Great presentation. Very informative. Clear and very understandable. Thank you.
Amazing course! Thank you so much, you are helping a lot of people
00:00:00 Intro
00:00:24 Welcome
00:15:48 Get the most
00:18:39 Python and PySide6 Install
00:26:50 Understanding the code
00:33:22 Organizing the code in classes
00:47:39 Signals and Slots
01:04:19 Intro to Widgets
01:04:51 Using QWidget
01:16:41 QMainWindow
01:40:59 QMessageBox
01:58:30 QPushButton
02:03:53 QLabel and QLineEdit
02:24:32 QTextEdit
02:41:01 QLabel and Images
02:45:58 Size Policies and Stretches
02:59:41 QGridLayout
03:06:45 QCheckBox and QRadioButton
03:21:45 QListWidget
03:32:46 QTabWidget
03:40:16 QComboBox
03:46:37 Qt Designer : Introduction & Install
03:53:28 Using Qt Designer
04:01:52 Qt Designer and QUiLoader
04:10:24 Wrapping loader object into ui class
04:16:21 Compiling User Interfaces to Python
04:31:05 Working with resources manually : Qt Designer
04:46:45 Loading resources from Qt Designer
04:53:40 QMainWindow : Putting it all together!
05:06:40 Farewell
Thank you for being the only people that have a real tutorial for this, among other things
Exactly what I wanted!! Thanks 🙏
Thank you Daniel and thank you freeCodeCamp for the amazing course. I love how you explain things and I learned a lot from this course. Thank you again.
Thanks FCC for everything!!
In the support world I live in, customers try to grow a brain and cause problems. I feel I am doing the same thing: For this code:
if ret == QMessageBox.Ok :
print("User chose OK")
else :
print ("User chose Cancel")
Couldn't we define a method and save having to A) Type all this more than once(even copy/paste it) and B) maintain it later? Am about 40% through and just LOVING this!!!! Thank you for all your had work!!
nice demonstration. appreciate your work!
Excellent course, I learned a lot there are additional files in the source that seem to reference other tutorials as well
thank GOD!! I have just been doing a big project in PyQt5 and I really missed a tutorial on this channel about this amazing library, couldn't have been in a better moment, thank you for the knowledge!
EDIT: also... what about Qt Quick? I think is a very powerful module and a valuable resourse
thank you so much for this. I'm impressed by the clear explanations, and this fundamental is what I'm looking for. this video might help to change my life. lol.
Great video, thank you so much.
Very well explained and well documented
Just finished your C++ course. Looking forward to this!
The 30+ hours one? 😮
@@m.b3191 30 hours is less than a week at school
@@m.b3191 link please
Wonderful tutorials. Thanks for your explanation and time.
Thank you very much! It's so useful.
really helpful! Thank you so much~!
i love this channel!!
And I was thinking of this today 😊
finally a course about this! Thank you so much freecodecamp :)
Amazing tutorial!***** I highly recommend this tutorial to anyone who wants to learn how to use Qt for Python using PySide6. It is perfect for beginners who want to learn how to build cross-platform desktop apps. The tutorial is well-structured and covers all the important topics in a clear and concise manner. Thanks a lot.
Hello.I looked into thios course.I like it but does it explain things like hopw to change the backgropund color of a main window.I can search it but I am curious if it has this.I made 1 hour of the course
For Macbook users, I was only able to get the action to work by doing:
```py
# Create the menu bar
menubar = QMenuBar(self)
menubar.setNativeMenuBar(True)
self.setMenuBar(menubar)
# Create the Quit menu
quit_menu = QMenu("\0Options", self)
menubar.addMenu(quit_menu)
# Create the Quit action
quit_action = QAction(" &Quit", self)
quit_action.setShortcut("Ctrl+Q")
quit_action.triggered.connect(self.close)
quit_menu.addAction(quit_action)
```
Amazing course!
Amazing tutorial! My only recommendation would be to put some acoustic panels on the walls to reduce the echo/resonance in the video - it makes it kind of hard to hear.
Hello, first of all thanks for such a nice lecture.
I would like to know if we can make two QTextEdit in one QMainWindow and use one of the window for input and another one for output purpose, also if we can keep the source text while pasting the data on input window. For eg PowerShell ISE.
I learned a lot with this video and this is really cool!
Tank you so much for this course, please make a class only about QT Creator, i want to learn Qt Creator
Thanks , is very helpful.
Thanks for these contents
Thank You That was great!!!!
always find things that I want to learn in freecodecamp, excellent!!!
Thank you so much for this lessons... very very valuble. And can you uplaod project development video using Pyside... Thank you so much
From QLineEdit documentation:
" When editing is finished, either because the line edit lost focus or Return/Enter is pressed the editingFinished() signal is emitted. Note that if focus is lost without any changes done, the editingFinished() signal won’t be emitted. "
Losing focus happens when the user TABs to another widget or clicks at another widget (and maybe in other ways also).
I wish you could have touched on pyqt MVC, it has always been challenging to me
amazing!
Thanks for this one, really need another tutorial on building a more graphical application with QT and pyside like an inventory manager or something like, it'll be awesome
i use pyqt5 (just because it was out before pyside6 and pyqt6 and haven't switched over.) however, a tutorial on how to make say custom buttons that use an image or an image as a button or say adding 3D models that you can rotate using a renderer qt widget or using a draw scene widget would be VERY helpful. Figuring that stuff out took me a LONG time , even with using stackoverflow.... there just doesn't seem to be a lot of information on it. So I feel you, i managed to figure it out, but it was difficult as the information for how to do that stuff is pretty scattered. I made a program that uses pythonocc with PyQt5 to display 3D models in a viewer that also uses Qt's animation methods,. It also dynamically adds animated buttons depending on what options are picked in the program and also dynamically adds images that double as buttons and it also dynamically draws lines in a graphics scene. It took me quite awhile to figure out.
@@resresres1 hey i am a student at an university and I'm doing a similar project as the phase 0. 3d viewer basically. Can you please send me your source code, if you are comfortable.
the exec method runs on local app variable but inside some functions are being called on app instance variable
Thank's Sir very very Much
may Allah keep Your Always ☺ ☺ Happy
Watching this brilliant tutorial on a big TV and got to 1:41:05 and felt sure my TV had crashed!
nice! so many thing to learn. so less time
This is really cool :)
Thank you.
This is what I m looking for
I really like to see the next QT topic Events, Graphics View Framework, Networks, Databased, and Threads? from where I can learn? or another plan for the code camp course?
for the Qlabel and Images part , can you explain how can we resize the image please ?
Thanks for creating wonderful content I was waiting for it eagerly. But as far as I know QT Widgets are not open source most of them are propitiatory. Also is there is any report writer available like crystal report I mean we can build table CRUD is possible but the have to create many reports for that table. I mean doing it from scratch is really scary something like dynamic report where you can group columns, sort orders and condition beside this export to PDF, Excel functionality I mean any rapid report generator tool available for Python will be turning point for me to move from PowerBuilder to Python. Thanks in advance.
It'll be awesome if you guys could do a video course on the Full Stack Open course.
Super awsome..... could you please create the course for Haskell or Purescript tutorials.
Hi! First of all, thank you.
I have a question: why would/should one choose PySide over PyQt ?
Pyside is made and supported and documented by the Qt company, PyQt is made by a third party. I Heard the API is similar to identical, but the licensing is different (which is why the 2 exist). I think it makes more sense to go with the official PySide, but do some research on what I previously mentioned to decide
@@rblorre thanks!
awesome tutorial
I just started this course, and I'm very excited... But I already ran into a problem :( I did everything in the setup, and it reacted exactly like in the video, with one exception. I copied the sourcecode for testing if the install was succesful, but I get an importerror - even though everything is satisfied when I run the pip3 install pyside6 in the terminal - both in VS and in my regular terminal.
The exception is that when I write python in my terminal, it refers to python 2. something (I'm on a mac), but if I write python3 in the terminal it refers to python 3.11.3. Is this the reason for my problem, or should I look elsewhere?
I will wait for the next video with qml
Awesome Course
Thank you so much
Finished Organizing the code in class and started signals and slots
Tailwind styles are NOT being applied to any components in my components folder i.e example Hero.js why?
Im interested in Threading, do you have some tuts? Thanks
Very excited with this but Sir my problem is after the development I suggest you make a video on how to convert it into sutup that runs on (Kali Linux)
Can you make a Powershell scripting tutorial?
Like the Powershell in windows (preferably Powershell 7).
i watched the 5 hours full video but still don't know how to build a simple calculator using pyside6. i only learned how to make buttons and windows but that's not helping me create a fully functional GUI application like a calculator. so i am not sure if i should buy his course!! because in that course he might just teach how to create buttons but not show how to use them to make a fully functional app.
At about 1:26:29
when he asks to first show the menu bar it doesn't work at least on a Mac. I had to add menu_bar.setNativeMenuBar(False) to get it to show up at first.
Daniel, Great presentation! Retired assy/C Engineer here. I’ve been playing with Python and followed your course all the way through. I began implementing your code to get a feel of my environment (Mac/VSCode) and have had a problem. I reduced my code to a main window and a menu bar (verbatim from your lecture) with one FILE selection. When I run the code no errors result but only a skeleton window shows up without the menu bar. I’ve messed with this for a few hours looking for possible problems without result. Any suggestions either from you or any of your viewers? Thanks!
I have subsequently had some success with menubars in macOS, after adding the "addAction" method. and discovered that "settings" re-routed to the "preferences" submenu, on the macOS platform
I had this same issue. I found a solution on StackOverflow where you add this line of code just below your menu_bar variable:
menu_bar.setNativeMenuBar(False)
This will force the menu_bar to be placed inside the application, instead of trying to use the native mac menu.
@@adpt_music Thx for that line of code. It fixed it! At first I thought it might have been me running the dark window on mac, so I'm glad I didn't start looking for that. You saved me time. Thx again!
Thanks
THANK YOU THANK YOU THANK YOU I LOVE YOU
Hello! Please help me how to correctly solve the administration problem, for example, use Python,QT, PostgreSQL. Please recommend an algorithm for organizing an access level for adesktop application where different interface components are included in different access classes, and when a new user is added, he will be included in one of these classes, and for him there will be Only components that are included in this access class are accessible. The question is, in order to implement this, what algorithm can be supported, or if there is documentation that can help resolve this issue. Thank you very much in advance!
Hi, I’m new here and looking to begin leaning CS. Any recommendations on which video, or playlists to watch first?
Hi Alexis. Im Victoria! I’m looking to begin too. Would you be interested in being each other’s accountability partner? I’ve done quit a bit of research, I plan on starting with Python.
Having sweet heaven I'm just now this right moment looking for pyqt tutorial and then that's right moment god send me you
Is there any cheat sheet for pyside6 please? by the way, great video, and thanks a lot .
Hi may anyone help me please. I'm unable to use the python-uic ... command. The error says "'pyside6-uic' is not recognized as an internal or external command,''pyside6-uic'' is not recognized as an internal or external command,operable program or batch file."
I've already insatalled pyside6 for all the requirements are said to be satisfied
ty very much 🌹🌷🙏🏻
Thank you very much for the time to put together such a good tutorial. I have an issue that the icon does not show on the toolbar menu. I'm using Windows 10 Pro. Does anyone have the same problem? Thanks.
I had this issue on Windows 11 and Fedora 37. When a directory is opened in VSCode, it is set to the current working directory when a Python Script launches. For simplicity call this directory "top".
If you create a subdirectory called "sub" and place your main.py and icon.png in it. Running the main.py will not change the current working directory from "top" to "sub".
Therefore VSCode it is looking for the icon.png within "top" and ignoring the icon.png within "sub". The easiest solution is to close all open folders within VSCode and then open "sub" directly within VSCode. It should work in this case. If you still have issues, you can attempt to use a raw string r"C:/Users/Philip/Documents/Tutorial6/icon.png" to specify the full file path but this solution isn't ideal as you application won't work if you move it to a folder in another computer.
@@philipyip1988 Thanks Phil, I actually used the full path instead to resolve the issue. If you use the VS Code and follow the tutorial, the icon will not show up as you cannot specify your resources for the project, like what you can do in the Qt Creator. Hence, the relative path will not work, you need to use the full path, the absolute path.
How to use Asyncio with pyside6? I have a GUI designed by pyside6 (and Qt), behind the GUI I have intensive serial communication done by Pyserial and asyncio....can I share the same event loop required by GUI and asyncio?
Thanks for this course, but the timeline seems wrong, could anyone fix it please?
5 hours this is amazing content for free......
I would of like to see Qt Creator with Qt Designer. I don't use Visual Code. There was a lot of cuts about Qt Creator on this video. On Qt Creator their was mis opportunity to clarify Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out and no instance of QPyDesignerCustomWidgetCollection.
Hi , is psoible to update the cupon offer for udemy, i want to see the rest of the course.
Can someone help me? I cannot understand what the QtCore and QtCore.Qt are used for.
I have a long process to do with my UI.I am using QThread for that but i am getting "qobject: cannot create children for a parent that is in a different thread" this error can any one help.
on which minute can i see like an example of how the app will look like?
but sir i have run into many courses but no one tells us to how to connect the interface with backend, means to put functions or to firebase. also I have another query that how to us a single GUI for the multiple data Pyside6, example: if you see the healthcare monitoring app there are multiple patient data shown in the single window, insuch a way when the patient 1 button is pressed then its data is shown in the GUI, but when the patient 2 button is pressed the data of patient 2 is shown, but the pervious patient1 data still there streaming in those components. please I have the screenshot of an interface please guide me how to make is
Can this be used to develop webapps and phone apps too?
How do you deploy a program? Sorry looked at the end of the video and i dont see that part
good tutorial,... demonstrated every pieces of GUI design, but manipulating with sub-window under the main window. how to create it work on it and delete it while remain the main window.
hey i need help with this i am creating a project i need to make a box wich contain dynamically box which are clickable and on each button call a function to show card list something like a filter functioning with box card which show cards and i need to place my filter cards and to selecttion card which are clickable in differrent widget for better ui any one with a slightly idea how to achieve this i sincerly need help with this plz plz
I have problems with qt designer, using W11, when I open the design layout to edit grafically the window, it crashes and closes itself. I've already tried using older versions of qt creator, if anyone knows how to solve it
i have this error when load ui file to python using quiloader
qt.pysideplugin: No python files found in '.'.
qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
any solutions for this problem?
Does pyqt jobs available in job market, bcz i didnt find it at any platform out there.
Can we make a vlc media player like application with pyside also can we build android apps?
You can make simple media player applications easily with Qt/Pyside (not quite like VLC) and Android Apps via QML provided you have the SDK/NDK installed.
@@squarerootof2 can your share a useful resource.
my antivirus detected my python program as a virus on window desktop. how do i fix this?
With this channel and other free resources on RUclips, I don't know why there are still people waste money to join coding bootcamp!