this post was submitted on 20 Apr 2024
0 points (NaN% liked)
Linux
48230 readers
510 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
even more obvious question, why not Qt?
As someone who is trying to develop my own Linux destkop apps, I can tell you that the day that I switch to Qt is the day Qt provides a feature that works as well as GObject Introspection (GI) does for Gtk. GI creates a cross-platform database of objects, properties, and signals, for auto-generating language bindings, so you can customize your Gtk programs with scripting languages (Python, Lua, Vala, JavaScript, Scheme). It is a relatively simple task to bind any programming language to GObjects thanks to GI.
Qt does have a QMetaObject system which is similar, but C++ is a difficult language to bind to on most operating systems because of how native language functions are labeled in the library code -- names are "mangled", a hack to work around the miss-match between object libraries features (
.so
or.dll
files), which do not provide the ability to "overload" functions, and C++ libraries features, which do provide this ability. The function/method overloading feature is used quite often in any C++ program. But decoding mangled names for language bindings can be very error-prone without the sort of automation that GI provides.As it is now, really the best way to develop Qt apps is to use C++, with Python for scripting, because these languages are the most well-supported by Qt (C++ natively, Python being the most stable and well-maintained "foreign" language for Qt). And I like neither of these two language. Gtk gives you a much larger selection of scripting language choices, even though it is programmed in C, and this is thanks to how well GObject Introspection works.
I think your use case/justification may not be applicable to the majority of GUI app developers. I have been using both professionally for at least 15 years and IMO without a doubt Qt is so much easier to use, read and work with it's not even a comparison. When even Linus Torvalds cannot figure out Gtk or get non-rude useful help on it and jumps ship to Qt instead, I think that says it all. Plus in comparison to Qt there are almost no commercial outfits using Gtk professionally and selling products based on it.