103 points · by jandeboevrie · 3y ago · 88 comments
The Qt Creator bug tracker [1] is bursting at the seams but nobody seems to really care. 5+ years old, very reproducible, very annoying bugs are being ignored by the 100s.
Here's an idea: can we have a feature freeze for like 1 or 2 years and only solve bugs / tech debt? There's no new feature that you could put into Qt Creator that I'd prefer over bugfixes. None.
Eike, or others from the Qt team, if you're reading this, please give it a thought. You have a fantastic IDE and it's painful seeing it degrade so much. Thank you.
Been following the issue for years, apparently it was marked as fixed a few months ago, but the issue is clearly still there. I wonder if this latest Qt Creator update will finally incorporate the fix, or if its not really fixed.
If anyone is willing to maintain a frozen branch (preferably one of those where Designer still worked), I want to know.
If only forking it was a good answer, we'd have solved so many by now.
Either way, there is no mechanism for accountability in open source other than peer pressure or reputation. Qt Company doesn't care about that a lot. They care about making buck first and foremost, operating in the "capitalist" realm. So the solution I propose is using that playbook too.
In a broader view, forking is telling people "you are not our devs any more, we're seizing the means of production", which I think is rather anti-capitalist.
However when actually writing code this stuff is practically magic which was confusing for me to learn about.
I found it much quicker and logical to just write the classes and register your widgets/components in the C++ class constructor than use these magic files which rely on nested XML/JSON. The entire point of these files is to make building an app seem easy (even easier than HTML + JS) but I find the entire thing confusing and overly engineered when you really need to write and reference logic.
https://develop.kde.org/docs/getting-started/kirigami/
https://doc.qt.io/qt-6/qtquickcontrols-index.html
The QML types are pretty extensive, covering most of the Widgets I think:
https://doc.qt.io/qt-6/qmltypes.html
For Widgets-consistent styling:
I'd say this is a fair description of a point in the past, but these days Qt Quick Controls 2 (which is bundled) is fairly well-featured, and they do keep adding new features release-by-release. It's not far from parity with Qt Widgets, and some things it does significantly better (e.g. animation or complex input handling).
Most of the time, QtQuick was meant to target embedded/mobile world, while QtWidgets - desktop. QtQuickControls 1.0 have been a dumpster fire anyway. So we had to write our own for performance reasons. QtQuickControls 2.0 were a bit of a licensing headache iirc. (Most of the companies i worked for stuck with Qt5.6 for licensing reasons).
Magic can be de-obfuscated with documentation but if I can accomplish the same thing in C++ with nearly the same amount of code, then the magic isn’t for me and C++ is a lot more clear and reduces cognitive overhead.
That's not the case when it comes to QML/QtQuick though. It sounds like you were writing a desktop application, So C++/QWidgets were probably a better choice for your use case. But for embedded/mobile use cases, where reactive, smooth animated user interfaces are the norm, QML is on an entirely different league.
Also, with QML I didn't have to worry about the ugly combination of junior engineers and C++ footguns.
The extra feature of the QML engine wrt. a web browser is to provide callbacks and hooks, doing what I guess we could call FFI, allowing for events and function calls to travel between C++ and JS. Complex, but not much sort of magic in there.
As far as I understand, we would draw a parallel between QML and what Tauri does. It just embeds a whole interpreter into your program, in order to be able to draw the markup and run the scripting.
But the interesting question is can something like Qt be fully build in modern c++ without need for such magic?
One day it’ll be in C++ natively. PME (property, method, event) was proposed to the committee in 2002. Modern C++ uses a different approach, but as is common with current additions, it can be argued is far more verbose and clumsy.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n13...
Then of course Microsoft has their property (subset) syntax, Unreal Engine has their macros and build system, Qt has reflection and C++Builder the same via extended RTTI… everyone who needs this, whether it’s Qt, MS, Epic, Embarcadero, etc reinvents their own mostly overlapping wheels. And still in 2023 a solved problem has not made it into the standard. The most powerful in terms of width of features is C++Builder and I often wonder what would happen if Epic adopted a similar or the same pattern instead of using macros and preprocessing. Probably C++ would be forced to either split or adopt support for the features multiple companies need.
Maybe with concepts + if constexpr + traits, if one is willing to open the druids metaprogramming book.
A lot of this stuff gets further promoted in things like Qt Creator which relies on building these kind of meta definition files.
Moc is less of a problem IMO because it’s more related to C++ macros which at least is a language feature.
There is nothing weird about UIC or QML. These are essentially DSLs that help quickly designing and iterating iver user interfaces.
UIC quite literally just generates C++ from a XML description of a Widgets-based UI element. You work over the .ui file with a WYSIWYG editor, save it, and your qmake/CMake project generates the C++ that does what you told it to do.
This is basically the same approach follows by essentially all major GUI frameworks. Microsoft's XAML works like this, React's JSX too, Android has its layout files, etc.
I wonder what approach do you find better suited for the job.
I can't recommend Qt more!
Really wish they would invest in getting QML LSP to a working state. It’s been in development for well over a year now and still not used by Qt Creator itself. qmlls is missing proper formatting support, syntax aware highlighting (although we paid a contributor to land this upstream over a year ago, the PR is still pending). It has unusable latency compared to other LSPs, the list goes on.
I can't remember the last time I saw a new Qt app.
When I tried it a few years ago, it forced some history-based keyboard tab switching, rather than behaving like everything else.
I’d love to see support for Go or Rust. Go seems particularly well suited and would be extremely productive for this kind of programming.
Qt objects have to be heap allocated anyway so you would not be adding much overhead. If you designed a specialized container it could probably be zero overhead.
Shoving Arc everywhere is a great way to leak memory with Rust. No, compiler doesn't prevent that. It is not a safety bug.
The problem is Qt has its own ownership model that goes against Rust's ownership model. It is a prime C++98 era library at its heart and it didn't change that much in the core architecture.
Moreover Qt relies on heavy use of inheritance-based OOP which is Rust also against.
So current Rust GUI libraries using Qt stuff like Slint has to implement a second level of abstraction and state tracking which costs performance.
I think the best way ahead is implementing a GUI library (at least the Widgets layer all the way down until rendering engine) in Rust. However I am not really hopeful. Writing GUI toolkits from scratch could be one of the hardest software engineering problems out there.
The days when benevolent software companies released open source full-featured GUI frameworks with relatively permissive licenses are mostly behind. Nokia didn't have much to gain from releasing Qt as LGPL but they did it anyway. I don't think today's big tech would do the same unless there is a clear, guaranteed way of monetizing it.
Dealing with N dimensional space of multiple OSes with multiple graphics APIs, multimedia engines, high DPI screens and complex text rendering is 90% painful software development. Somebody can do it but I don't think it will be open source, neither cheap.
Compared to the other languages you listed, it demonstrably is. They've been around for over 10 years and aren't used much for the purpose. Maybe Rust and Go just aren't good (let alone great) for building GUI apps.
I'm a bit afraid of the FFI costs but I will look into the nitty gritty later.
There is always possibilities for the electron/tauri/wails route if all else fails.
I’m writing some data exploration/visualization tooling with it.
I really appreciate the permissive licensing vs Qt.
I totally understand that nobody would want to learn C++, of all languages, in order to make their pet music collection manager, or whatever other app. I'd wager for 95% of apps, the fine control over memory and resources is just a premature optimization, and only brings friction by requiring to learn an arguably difficult to master language.
Go would be a great choice for general application development. Of course you might want to use C++ or Rust for a complex video editing package or something demanding like that... but to make the To-Do or Calculator app du jour, having to learn those languages is overkill. I guess that's also why there are so many Electron-based applications.
In general, having a garbage collector is a huge productivity boon, while not having to distribute a runtime interpreter (that's why I didn't mention Python) is also great.
edit: 12.0.0-0.2 appears to be -beta1 on closer look :D