[Interest] QML vs Widgets, 20202 Q1 edition (was "Is there a good alternative to the QML [...]")

Rui Oliveira ruilvo at hotmail.com
Mon Feb 21 21:33:52 CET 2022

QML/Quick on the desktop is clearly a hot topic.

I've asked about this little under a year ago [1]. Interesting 
discussion, worth a read.

In the meanwhile, I've been asking questions around, like what do /r/cpp 
redditors like to use [2]. Results are interesting and the comments are 
as well.

I've been looking at other ecosystems with some envy, namely the growing 
cross-platform C# frameworks [3, 4, 5].
Albeit they tend to the "modern" styles, like Fluent and Material, it's 
worth noting how actually surprisingly integrated with the underlying 
platform some of these are, via the use of "templated controls" that 
ultimately are "system" ones.

Then, there's a *lot* of people that tell me "just use a web-stack", 
like Electron, of neutralino.js [6] and code your UIs with HTML+JS.

Personally, my interest in C++ has been as a hobbyist so far. My pet 
projects involve real-time application, requiring also relatively 
performant visualizations. I'm interested in the desktop, and 
particularly, I'm interested in /high density/ desktop UIs. Not 
Fluent/Material stuff, designed for fat fingers, I want 
information-dense UIs and I want to interact with them with my keyboard 
and mouse.

With this context, what have I learned in the last year? Nothing. I'm 
more confused than ever as to what to use for new projects, and there 
are so many pros and cons.

Widgets are solid for this type of application. And while they are 
considered a "solved problem", sometimes I feel like they are more 
"labeled" as a solved problem. QTBUG-6864 is 12 years old, has 47 votes, 
and I know about it because it affected me personally [7], just to name 
an example.
I also wish we had QRhiWidget, even without the possibility for the 
QPainter API.
Truth is that it seems the reward/effort ratio for this stuff is just 
too low considering the size of the desktop market, especially the size 
of the desktop market in C++.
I know QWidgets are maintained. But honestly, sometimes it does feel 
like picking up deadware to start new projects.
The other day I needed a quick UI for a python thing, and used Qt 
Designer for the first time (I usually just write the widgets in C++) 
and it was a serious adventure trying to copy/paste elements).
On the pros, like some have said, there is quite the nice community 
around QWidgets in the open-source world. Some even used by Qt itself, 
like githubuser0xFFFF/Qt-Advanced-Docking-System [8].

Regarding QML/Qt Quick... Well, it doesn't feel like a desktop 
framework, honestly. It's improving slowly, like the introduction of 
"native"-ish desktop look-and-feel in Qt 6. But there are some things 
that are really big turn-offs. First, even said "native" look-and-feel, 
or the fusion look don't feel that great. Honestly, and funnily enough, 
personally, I feel widgets "snappier" than QML. For real, try the "Text 
Editor" examples both in Quick [9] and QWidgets versions [10] (both 
available in Qt Creator) and tell me what you like more (once you ignore 
the 2000s cartoonish icons on the latter). Plus some things really annoy 
me, like QTBUG-93084 [11].

So, at the current time, I personally feel that I have one option that's 
not future-proof, and another one that's not present-ready... I honestly 
can't decide.

This comments of mine are just a personal opinion, and there is a lot of 
nuance and details and arguments that I can't remember all at once while 
writing an email.

Good coding,

[1] https://lists.qt-project.org/pipermail/interest/2021-April/036763.html
[3] https://docs.microsoft.com/en-us/dotnet/maui/what-is-maui
[4] https://avaloniaui.net/
[5] https://platform.uno/
[6] https://neutralino.js.org/
[7] https://bugreports.qt.io/browse/QTBUG-6864
[8] https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System
[9] https://doc.qt.io/qt-6/qtquickcontrols-texteditor-example.html
[10] https://doc.qt.io/qt-6/qtwidgets-mainwindows-application-example.html
[11] https://bugreports.qt.io/browse/QTBUG-93084

Às 15:42 de 21/02/2022, Mark Gaiser escreveu:
> Hi,
> I'm facing so many bugs in QML Controls in Qt6 (they used to be 
> Controls V2 in the Qt 5.x days) that I don't want to use them at all 
> anymore. They are bugged beyond repair and downright unusable for 
> native desktop integration purposes.
> Is there another good open source component set out there that 
> integrates with the desktop. Specifically with Windows but preferably 
> also with Linux (kde and gnome) and Mac.
> Using QWidgets should not be an alternative as it slows down 
> development a lot. But given the crap that QML Controls is makes me 
> consider switching to QWidgets instead.
> Best regards,
> Mark
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220221/c9d9675a/attachment.htm>

More information about the Interest mailing list