Комментарии:
After some 12 years of professional Qt development, I cannot emphasize it louder: For God's sake never ever start with QtDesigner. I beg you, avoid it like plague. That tool is total crap and has so many limitations which you will find too late after investing so much time. It is always much much easier to create your UI in code. QtDesigner makes your code much harder to maintain and much slower to write.
There are only two usecases where QtDesigner is justifiable:
a) used by a complete beginner who is just exploring what Qt framework can do
b) someone who designs a STATIC form AND wants to customize it with lots of stylesheets and want to see the result in a kind of WYSIWYG editor
In all other cases it is much better to write widgets in code.
Qt designer is not free
Ответить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.
what kinda OS are you using ?
Ответитьyou and your custom linux are fuking amazing.
ОтветитьHello DT. Is your code on line on your gitlab? 😊
Ответить"Python is a real language". :P :P :P
ОтветитьWhat was the rufi them u where using for your search. Loved the sound effect too
Ответить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!
ОтветитьYou don't need to connect the signal and the slot, if you name your function "on_<object>_<signal>" 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.
Ответить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!
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.
Ответить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.
ОтветитьThis should be a series.
ОтветитьReally nice video DT!
Ответить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 😀
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...
Ответитьu mean dtos spin not distro
Ответить