Where/how to start then, any recommended link/book/videolist please? (for Qt on Linux w KDE)
I haven't yet seen a good one.
Qt seemed the way to go, for having a forms designer, and for being a mature product with many developers and big community. It is not exactly FOSS
Bullshit. KDE desktop is completely based on the Qt toolkit. Because you are using KDE, you are already using Qt, based on the GPL and LGPL licenses.
Tough love follows.
Start with this:
Install
qttools5-dev-tools. This provides Qt Designer (at
/usr/lib/qt5/bin/designer), which you can use to create the user interface. It's user manual is
here. Do not confuse it with Qt Quick, Qt QML, or Qt Design Studio, which are a completely different thing. Do not use it to generate code, simply save the user interface as an XML
.ui file. Ignore anything that talks about code and code generation. Make sure you create each interactive element an unique ID (using only ASCII letters, followed by ASCII letters, digits, or underscore; case sensitive), because that way, we can associate your event handlers with the correct UI objects just by using our own naming scheme and resolver.
If you like that, then install
libpyside2-py3-5.15,
python3-pyside2.qtcore,
python3-pyside2.qtgui,
python3-pyside2.qtsvg,
python3-pyside2.qtuitools,
python3-pyside2.qtxml,
python3-pyqt5,
python3-pyqt5.qtsvg. This gives you both PySide2 and PyQt5 bindings for Python3, so that you can test and write your Python3-Qt5 application that selects whichever is installed at run time.
If you used a Gtk+-based desktop instead of KDE, also install
qt5-gtk-platformtheme, which helps Qt apps look more like Gtk+ apps on Gtk+-based desktops.
If you don't like that, install
glade. This is the Gtk+ UI designer, the Gtk+ equivalent to Qt Designer. It's user manual is
here. The same thing applies: ignore anything related to code generation, make sure you give each of your interactive UI elements an unique descriptive ID (using only ASCII letters, followed by ASCII letters, digits, or underscore, case sensitive), and save the UI as an XML
.ui file.
If you like that, then install
python3-gi,
python3-gi-cairo,
gir1.2-gtk-3.0,
libgtk-3-0,
libgtk-3-bin,
libgtk-3-common,
libgtk-3-dev,
libgtk-3-doc (this will provide HTML documentation under
/usr/share/gtk-doc/html/gdk3/ you can browse locally). This gives you Gtk+ Python bindings via GI (gobject introspection, sometimes written as gir).
If you're not happy with either, there is also
wxWidgets and
wxGlade and
wxFormBuilder. In line with my suggestions above, use XRC for the code generation in wxGlade and wxFormBuilder, to get an XML resource file that can be instantiated at run time.
The steps forward from that point depend on which way you pick. Gtk+ can also be used from C, if you're more comfortable with C than Python.
Qt requires C++. One might consider using Lua with wxWidgets, although C++ and Python also work.
When you make a GUI only once or twice a year, you won't remember anything from last time.
Tough. The same thing applies to every single technical task. Dumbing down the tools is not a viable solution; it leads to "blunt scissors" tools that are designed to not cut anything, because otherwise those who like to eat glue and stuff crayons up their nose might hurt themselves with them.
What you need to do, is document yourself better.
As an example, whenever I switch to a new Linux distro or desktop environment, I record the list of packages I end up liking, as well as make notes on the changes I make. (For example, I like to use a variant of the Oblivion Gtk+ theme, except replace the gray backgrounds with true black.) It is not worth it to try and automate this, because just jotting the details down in a plain text file in a dedicated location, say your home directory, takes less time than any effort in automating this. It is a habit you have to adopt, if you want to survive without permanent brain damage from constant frustrations.
This way, I do not need to
rediscover what I like; I already have the basis I need to continue my day-to-day stuff, within an hour or so if I have to switch computers. Which is also why I every day consider whether I created anything I would be upset about if lost, and back them up if I did.
It looks like nobody is considering LTS in software development (long term support).
I disagree. It is true that things
change – for the exact same reason why the Linux kernel does not have stable internal APIs: having that would stifle innovation and limit what kind of things could be changed. That change is a necessity for things to develop at all, because human developers are just not getting paid or their dopamine kicks from maintaining existing code; they need to create something new to benefit.
Python 2/3 and changes in 3.x wrt. Windows support is a bitch; very true. I don't like that at all.
While Gtk4 and Python6 are "current"/"development"/"head", I personally target Gtk+ 3 and Qt 5, and can install all necessary libraries from standard repos to run my Gtk+2, Gtk 4, Qt 4, and Qt 6 code. That is, I have zero issues running my years-old code, because I always known this will happen, and prepared for it beforehand.
If you install Gtk3 support, and then run
pkg-config --libs gtk+-3.0, it will tell you the libraries C code linked against Gtk+ 3.0 needs:
libgtk-3,
libgdk-3,
libpangocairo-1.0,
libpango-1.0,
libharfbuzz,
libatk-1.0,
libcairo-gobject,
libcairo,
gdk_pixbuf-2.0,
libgio-2.0,
libgobject-2.0,
libglib-2.0, all dynamically (
.so). Alternatively, you can run your native program via
strace -e openat -o logfile program [args...] to log all files it accesses. Using your package manager, you can find their owner packages, and list the package names required to run the application. Some of these will pull in additional packages, of course.
To distribute software in native Linux packages, you need to package them as
.deb/
.rpm/etc., and thus record their dependencies. This is done using the package names. This is crucial, so that installing an application will automatically ensure its dependencies are present. This has to be done by the developer, so if you intend to ever distribute anything you created yourself in a native package, you
have to learn to track the package dependencies. Fortunately, it isn't hard, it is just something you have to spend the time to learn.
(If you also have a snapshot of a VM of a pristine install of the distributions and desktop environments you target, it is very easy and fast to verify the dependencies are sufficient. Verifying they are
correct, i.e. even if someone
removes packages included in the default installs, is a bit more complicated; your snapshot must be a minimal install then, and you'll also end up testing the dependencies of the entire package tree up to your own package, which will be slow. Unless you use a local SSD as the repository, in which case it is not that slow. And you generally only need to do that once, or when you add a dependency on a new library or other. For basic Python3 + Gtk/Qt applications, none of that is necessary; it's easy to just list the few root packages as dependencies. Mine above includes SVG support, but excludes multimedia, webkit (browser), and OpenGL widget support.)
A shortcut to distributing software is using Snap, Flatpack, etc. application images. Essentially, all the required libraries (and the services those libraries depend on) are provided with the application image.
An intermediate version of those is what I suggest for the cases when one wishes to distribute proprietary software. The software is installed system-wide, but for each user, a configuration directory (under their home directory) is used, populated with symlinks to the actual libraries the binaries will be using. This covers e.g. LGPL library update requirements, as long as the mechanism is described to the users and actually works. This includes the exact interpreter used, with the system-wide application "binary", say
/usr/bin/your-proprietary-app, is actually a shell script that ensures the configuration symlink directory exists for the current user (perhaps populating it if necessary), and executes the user-specific interpreter via the symlink, with dynamic library resolution order (
LD_LIBRARY_PATH and so on; see
man ld.so). For many-many-users environments, if there is no user-specific directory, a global default directory can be used instead, to reduce disk space use. (Although symlinks don't take up much disk space at all.)
The only way to span a project over many years is to make a virtual machine for each project.
It is the easiest way, yes, but definitely not the only way. I personally don't need to do that, and can run stuff I wrote a decade ago right now without modifications –– might need to install a couple of libraries in some cases, but I tend to have those requirements listed, or they are obvious (as in Gtk+-2.0, or Qt 4 with PyQt4 bindings).
Even my embedded C code tends to be impervious to compiler version changes, because of my practical approach towards the standard and language implementation. The Python 2 vs 3 did bite me slightly (mostly just
str vs
bytes), but not enough to bother me too much.
There is no other way, and even this one is fading away fast (i.e. current Arduino 2 IDE only has online help, which is stupid no matter how free it is).
It may apply to Arduino and the proprietary world, but I definitely don't see that in the Linux distributions I use. Applications and projects –– including LibreOffice –– that use browser-based help files store them in
/usr/share/doc/package/ just like they always have. (The only annoying thing is that if they use UTF-8, they need to explicitly state that with
<meta charset="utf-8"> or
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">, because although all text files on my system are UTF-8, I cannot set my browser default character set to UTF-8, because someone decided only legacy character sets can be the default character set and the only non-legacy character set is UTF-8.
)
My Arduino IDE is still 1.8.19, as that works fine with Teensyduino 1.59.