Working With Qt Designer's UI Files And PyQt

  Рет қаралды 18,189

DistroTube

DistroTube

Күн бұрын

Пікірлер: 26
@hexisXz
@hexisXz Жыл бұрын
This should be a series.
@jackkeifer
@jackkeifer Жыл бұрын
1st Class tutorial. Nicely done Derek! Qt & I go back well over 15 years (C++ & Qt Creator), and pyQt maybe 8 years give or take... it just never gets old!
@fcolecumberri
@fcolecumberri Жыл бұрын
You don't need to connect the signal and the slot, if you name your function "on__" in this case "on_one_btn_clicked" qt connect them automatically, this is nice because enforces consistency among multiple programmers and avoid bloat on the code.
@johanngambolputty5351
@johanngambolputty5351 Жыл бұрын
I did not know this, this is nice.
@ZeStig
@ZeStig Жыл бұрын
Really nice video DT!
@merthyr1831
@merthyr1831 Жыл бұрын
If you want a python script to run in headless mode (w/o console output) you can change the extension to .pyw instead of .py. Obvs your xmonad hides that stuff anyway but might be good for hiding your script's console output from your users.
@ThrowAway-t3m
@ThrowAway-t3m Жыл бұрын
I like to name like this: (assuming a button) btn_button_name. That way if I forget what the button is called it's very easy to bring up the autocomplete and see a list of every button just by typing "btn". I find it much easier to remember the type of control I'm looking for instead of the name and once I narrow down the lists to types it's usually pretty obvious which specific buttons (or other types) I'm looking for.
@griffon2-6
@griffon2-6 Жыл бұрын
12:14 if you are feeding script to python executable like that, chmod +x does nothing in that case
@DigitalMetal
@DigitalMetal Жыл бұрын
He needs to add the Shebang to his script. It drives me crazy when people don't have a shebang in their scripts.
@KR1ML0N
@KR1ML0N Жыл бұрын
​@@DigitalMetalagreed I feel thr same
@munir2010able
@munir2010able Жыл бұрын
What was the rufi them u where using for your search. Loved the sound effect too
@rawmaterials3909
@rawmaterials3909 Жыл бұрын
I'm trying to dig into python and qt because I want to write an application. So, to sum it up... this method is preferred because: 1) you don't generate a bloated ui file 2) you can make changes on the fly without having to rebuild the ui file is that correct? so, does the method DT showed in the previous video has its advantages? Btw, thanks as always for your videos DT, you're the best!
@johanngambolputty5351
@johanngambolputty5351 Жыл бұрын
That is correct, I don't think the previous method has any advantages, you can still add custom widgets in a dynamic way if you like after loadUI. For instance, I leave empty frames in designer then I add matplotlib plots to them in init.
@sausix
@sausix Жыл бұрын
Why not using PySide which is an official Qt project and probably has more maintainers? The interface and syntax is similar and even more pythonic. Loading ui files directly is easier. Only disadvantage is not having a py file for type hints and annotations. But do vim users even know what they're missing 😀
@bechirzouaoui5821
@bechirzouaoui5821 Жыл бұрын
what kinda OS are you using ?
@leontalkdaliy5894
@leontalkdaliy5894 Жыл бұрын
you and your custom linux are fuking amazing.
@neotwenty-nineBzH
@neotwenty-nineBzH Жыл бұрын
Hello DT. Is your code on line on your gitlab? 😊
@_..-_-.._
@_..-_-.._ Жыл бұрын
u mean dtos spin not distro
@jcugnoni
@jcugnoni Жыл бұрын
qt designer and PyQt are great; but I don't really like using pyuic and prefer to import .ui files at runtime. Indeed, it gives a better separation between the UI and the code and is simpler to maintain over time. Of course, this is only usefull if we use Qt Designer.. Direct coding the ui in PyQt is also a option but I usually find it frustrating...
@ThrowAway-t3m
@ThrowAway-t3m Жыл бұрын
I made a separate python script that calls pyuic and compiles all the files in a specified directory into a different output directory in my project. This way the python code is available in the editor (VS code in my case) allowing it to offer autocomplete on widgets names defined within the UI. This saves me a lot of time/effort because I don't have to meticulously make sure I got the object name right, I choose it from a list and the editor makes it match verbatim! I usually create a controller script for each UI that handles separating the UI from the logic. The controller is also a good place to make slight tweaks to the UI that the designer doesn't allow for (like setting window flags). All I have to do when tweaking the UI is edit the ui file in designer then call my compile script and my app is ready to go (granted deleting things or changing object names may mean you have to make alterations to the controller but your main logic will be unaffected)
@essetee
@essetee Жыл бұрын
just rename your buttons the other way. btn_one ... With intellisense when you hit bt all your buttons are grouped together to choose the one you want.
@ThrowAway-t3m
@ThrowAway-t3m Жыл бұрын
Unfortunately using the uncompiled .ui file means that no editor will actually be able to give the type hints. That said if you are using the .py compiled version starting with 'btn_' is the way to go!!!
@PANDURANG99
@PANDURANG99 Жыл бұрын
Qt designer is not free
@vladimirkraus1438
@vladimirkraus1438 10 ай бұрын
Of course it is free. It is such a crap that no one would pay for it.
@fir3w4lk3r
@fir3w4lk3r Жыл бұрын
"Python is a real language". :P :P :P
Creating Your Own Qt Applications...It's Easy!
15:27
DistroTube
Рет қаралды 43 М.
3. Python   PyQt Containers and Layouts
12:07
PanoPython
Рет қаралды 3,7 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
A basic PySide6 and Qt Designer tutorial.
1:33:05
Jason Codes Qt
Рет қаралды 48 М.
25 FREE and Open Source Software in (2025)
9:47
anyDev
Рет қаралды 6 М.
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 114 М.
How to use Qt Layouts
19:18
Velcode
Рет қаралды 100 М.
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 214 М.
Convert GUI App to Real Program -  Python to exe to setup wizard
23:27
Python Simplified
Рет қаралды 565 М.
Browse Files Dialog with PyQt5 [use file explorer]
11:30
Code First with Hala
Рет қаралды 53 М.
PyQt5 Tutorial - How to Use Qt Designer
10:53
Tech With Tim
Рет қаралды 834 М.
QtDesigner and PyQt5:  The right and wrong way to use them together
37:16
Alan D Moore Codes
Рет қаралды 109 М.