Creating Your Own Qt Applications...It's Easy!
Вставка
- Опубліковано 1 жов 2024
- I've done some videos in the past creating GTK apps, but today I'm creating my very first Qt app using 'Qt Designer' and 'pyqt5'. Creating a Qt app with these tools is shockingly simple.
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.youtube.co...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/...
DONATE CRYPTO:
💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ
DT ON THE WEB:
🕸️ Website: distrotube.com/
📁 GitLab: gitlab.com/dwt1
🗨️ Mastodon: fosstodon.org/...
👫 Reddit: / distrotube
📽️ LBRY/Odysee: odysee.com/@Di...
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🎵 Tenacity: github.com/ten...
💻 VirtualBox: www.virtualbox...
🗒️ Doom Emacs: github.com/hli...
Your support is very much appreciated. Thanks, guys!
Now THIS is very useful information for users who would like to dip their toes into the world of coding, but has been seemingly overwhelmed. Please keep 'em coming DT.
This is not useful. That's the worst possible example of how to use designer with pyqt !
@@essetee It's a starting point. The usage may be wrong or industry-standards may be different but made me encouraged.
You should never edit the py files generated with pyuic, it's always expressly warned about both in PyQt and PySide. Always inherit/compose in a separate file.
Qt itself is fantastic. Basic applications are easy but the different models and mappings for data can get quite complex. It's extremely powerful, more so than any other native frontend builder.
probably best not to use pyuic at all.
@@robertfletcher8964 There's a performance penalty if you don't. Best practice is to do everything in Designer as much as possible, not modify the pyuic generated file and do additional things in your app file.
Yes bro we need this kind of video it will help us to contribute in linux
Great... here come more "distros" now with a welcome screen lol
I love PyQt, its great!
This isn’t too different that how things were done back many years ago in Visual Basic and other languages with the difference being that qt designer seems to be just a form designer without having the language included. Here the language is separate. Personaly I have never gotten into visual languages, but those who have should feel right at home with the designer. Thanks dt for showing this.
Hey DT, why are you such a Qutty?!?
I would definitely be interested in more programming videos, especially if they are in Rust or C#.
Couple of things. First, 0:28 When you create the main window, use the "Main Window" not the "Dialog". Second, don't use PyQt, Use Pyside, Pyside is the official Qt python implementation (There is nothing wrong with PyQt perse, it's just that its license is not the same as Qt and with licenses, the less you mix the better). Third, don't edit the file generated by pyuic.
On the point of QT, neovim qt which comes by default in windows while installing neovim takes really looooooooooooooooooooooo opening up dry start is longer than Emacs.
Awsome👏👏👏👏 Thank you DT Great video only second to Bash Commands! OMG you made me so happy! Please make more of these videos. Wish I were wealthy I would become a Patreon of such a project
My python scripts never runs, they just crash on start :(
Say how about interviewing the creater of Slackware?
As a longtime Slackware user, I'm definitely in favor of that.
I much prefer qt over gtk, gtk is basically run by the gnome project, and we all know what those guys are like, now if only someone would port firefox or librewolf to qt
@@d4r1us_drk Because gtk basically serves the needs of gnome now, I believe budgie is moving away from gtk because gtk4 did not live up to the expectations of the developers due to the continued focus only on the needs of the gnome project, the developers of which do not listen to the opinions of alternative projects and do not want to take their needs into account.
Gnome used to be a good desktop until they decided to turn it into a tablet interface, they also dumbed it down by removed a bunch of customization options, yet at the same time making customization possible by third party extensions that break whenever they release a new version.
Also the gnome project is run by a bunch of woke racists, who for some reason think there needs to be more non white people in software, more woman in software, more gay or trans people in software, which is why they created the program outreachy, where they give grants to people that I mentioned above, so if you're a white man who wants to get into software don't bother applying for a grant at outreachy because you're the wrong skin color and the wrong gender, and that makes you privileged.
Hey DT, thanks for this video. Please do more of this kind of stuff. It is great and you are a very good teacher. 🙂
Put another box inside the group box and then edit the buttons to make them all change.
This is giving major Visual Basic vibes, even more than Gambas, but more modern. Totally takes me back to my VB4 /VB5 days-- this is awesome! Now my family is wondering why I'm grunting like those monkeys in Space Odyssey 2001, but they're not geeks and just won't understand. LoL
I remember that. And an "Access" backend lol.
Can you generate binary files this way? Like with plain QT?
no
yes, but you need to do it on C++.
I've been literally looking for a video like this yesterday and this comes up now on my feed, couldn't ask for a better timing!
I stopped at the Python part. I thought (and hoped) you'd do C++.
Nice choice of topic though. These GUI Projects are always the best✨
Cheers
What's happening if you need to do changes in the qt layout and already had adjusted code in the py file? There should be a way to preserve the code alterations, shouldn't it?
Excellent jump start into Qt chap. Suddenly seems less daunting. thank you
Thats great. Can you do similar video for GTK app ?
+1 to this.
+7 to that. I decided theres 6 more of me.
Thanks DT, perfect timing for this, i am learning Python and i am set with Qtile, it helped me improve my setup a lot, this type of application is just what i needed to further improve.
DTOS is gradually becoming a unique non-iso distribution
Thanks! Good job and info! Appreciate the work.
This reminded me of Microsoft Visual Basic
👍That's exactly what I was going to say!
DT: builds a qt application
Also DT: "I am not a programmer"
Are going to explore QML at some point? Because that would be awesome!
this is rlly cool
Hi there, It would be helpful if you linked to the sites where you could download these tools in your description
how can we contact you for cooperation?
You can just drop all your widgets at once, selecte them, and use the buttons at the top to put them in a layout. If you have nothing selected then those buttons set the root layout iirc
Can you make one with C?
Using GTK instead of Qt? That would be good too.
Moore Betty Anderson Robert Moore Michelle
What QT Designer version is this? I cannot find anywhere on the internet information how you can save projects as *.ui. I have QT 4.3.1 and only save option is to *.ui.qml...
Would this be similar if I wanted to use a different language such as JavaScript, Ruby, or C?
I know the default language for Qt if you use their main tool, QtCreator (different from designer) is C++, but I’m not a fan of C++.
Damn... another cool and interesting video from DT. I definitely try this one. I can see myself very busy in the next few weeks... I think I start to hate you DT :-)
is the code available somewhere please?
👍Thanks.
You should do one for C++ using kdevelop. Would be quite useful for anyone wanting to get into games development. Also, is it supposed to be pronounced "cute" or "cutie", because I've always treated it like an acronym and said Q.T. as "cutie". Is that wrong?
This feels like Visual basic used for designing Windows apps when bill gates not even born
Its always been easy just dont be a baby lol ;P
Reminds me of Visual Basic 6
How do qt applications scale with DPI settings?
Gambas and Lazarus are also cool IDEs to play with!
Is there a doc with a good explanation of the design approach?
I am following all this, I get my .ui converted to .py; I go to run it but all I get is a command line message that there were no errors. I did not get my ui showing up anywhere on my screen. I am sure I missing something simple.
I did import sys and subprocess as shown in the video.
This helped me in my University project. Our Lab Professor told us to make a graphical app which can compute people's Grades. We were given a junior class's actual result which was a .csv file. Whats funny is the university never taught us how to build graphical apps. Thanks to Qt designer and pyQt I was able to complete it. There is just one thing that I could not figure out. How can I make the app dynamic or responsive like in websites. Different resolutions made the app look very small or very big.
use multi threading, that way the computation happens in a separate thread and the UI remains responsive
thank youuuuuuu
I tried Qt in the past. It's functionally really good but the problem is the forced LGPL dual licensing and how vague they are with it. You either release your program for free, pay a massive license fee that no solo dev/small team will be able to pay, or do some weird dynamically linking stuff that they aren't specific about at all. I like Qt but understand why companies usually just use Electron
The licensing is not a major issue. Much of what you use on Linux is (L)GPL anyway. Anything you write _using_ qt, so long as it is not statically linked to qt, is fine. It can even be statically linked, and under a restrictive license, so long as you make object code or source code available so the recepient can swap in their own version of the qt portion. This is the same as any other LGPL project, and not an issue at all.
What the alternate qt license allows is companies to ship _modified qt_ libraries, where they apply some secret patches to qt itself, without publishing those patches anywhere. Given the flexibility and feature state of qt, this is basically not _required_ for anything, but it does let you ship a single-file-executable that embeds qt, without needing to worry about library versions or if the end user has qt installed.
For anyone actually supporting linux, instead of just looking for a toolkit that can run anywhere, requiring the user to have qt installed from their distro is not a significant issue. Just list (py)qt (or pyside) in your package's deps, and move on. Or embed the qt .so files in your appimage and move on.
@@yellingintothewind Agreed. While I hate the GPL and refuse to use it for my own projects, it's not a huge issue to use libraries under it. Also, the fact that they have two licenses actually makes it a good thing for a business because they can basically pay to avoid the GPL altogether.
@@anon_y_mousse Exactly. For a project like qt, the GPL is a good choice specifically because it is mildly annoying to use for a few things. If you fall into those few things, then you'll be happy to pay them to just forget about it.
thanks
Thank you.
Very cool!
you are qute
Hey DT
lets gooo
Yes, more of this.
Have you checked out Ragnar WM?
A new tiled WM, based on example code. Always nice with programming package you can quickly reach impressive results.
I was hoping to get a tutorial on Qt 🎉 thanks
It's the wrong way to use Designer. And for your icons you need to create a resource file. You put all your buttons wherever you want. Choose 1 button. Hold down the ctrl key and choose other buttons. Then click in the top bar on the layout you want. Do this for all your items. If you choose your groupbox, choose button 1 and 2 and choose H layout. Then the second row. Then click in your groupbox and choose V layout. That way if you change the size of your window, all with follow. Never change the pyuic file ! You have to do the layout in Designer. This is a very bad video to show how to use Designer and PyQt. You create a dialog and you remove the buttons. Choose the right one from the create menu!
The way we are moving ahead with the videos, DTOS doesn't seem very fictional. You may try to do it keeping the default Arch repos, just saying out loud what all your viewers are thinking. ❤
Distrotube race was black yesterday..... But today he is white what happend?
Deepfake?
He was black engineer
He faced too much legal trouble
No need for Qt etc. Now we have web technologies like electron, making a UI with CSS is so much easy thanks to tailwind and bootstrap, if performance matters then you have web assembly.
Yikes