154 points · by ingve · 10y ago · 32 comments
Qt5 is really underused for how good it is. It's a really good platform for making native apps and it even has bindings for many different languages.
And since it can be used for IOS&Android apps it's a great competitor to React Native. It is reactive and declarative like React but with way less boilerplate and everything is so much easier to do, and it supports more platforms. The only thing React Native has on it is native looking widgets for IOS, but if you plan on using your own design anyway, that's not a problem.
You get the productivity of a modern reactive framework with the completeness of Qt. It has things like a GUI builder that modifies and generates code for you, and the code it outputs is close to what a human would write, so you aren't locked into it.
The QML bindings for other languages don't have to cover much surface area though. They look minimal but most of them are eminently usable because all the UI logic is in the QML+JS, all you need in a binding is a way to pass data in and out.
D, Rust, Go, Ruby, Python, etc... all have good enough bindings, that work for now and even if they do need some patching, aren't that big or hard to patch yourself. I've never used them myself (I just use C++, but I plan on using D for a QML app someday), but I know some other projects that do like https://github.com/limetext/lime
Something to do while snowed in.
The only really complete bindings for Qt 5 are PyQt5 but its not compiled so its out for me. There are solid qml bindings for go and the rust ones worked fine last time I tested. Im not really a big fan of QML though. Its really much different than using widgets and Im not a Javascript dev by any means.
The QML side of things I've never tried, and the QML based bindings to other languages in general seem less mature than the C/C++ bindings. I'm keeping an eye on go-qml though.
I wonder if PyQt works with Cython. That could be interesting.
You write a declarative description of how you want your app to look given a source of data, and then the UI updates when the data changes and you can bind UI elements to change the data. When the data changes, the UI automatically updates.
React does this by generating the whole UI in a tree from a bunch of data and then diffing. QML does this by binding signals that trigger the UI to change whenever the data does.
Yes they fundamentally work a different way, but the way you write applications and think about them is the same.
It was less work to use Java, C++/CX and plain C++ than having to mimic native widgets with QML and having do my own OS wrappers. Plus the additional 30 MB.
Also the C++ widgets either didn't work on mobile or were 1:1 like the desktop version, e.g. file selector.
From the documentation, it doesn't seem it has improved much.
"It’s important to note that these styles are not claiming to be native, but instead a 100% cross-platform implementation of the Material and Universal design guidelines. For example, the Material style does not adapt to any Sony or Samsung theme on Android. You can run these styles on any platform and they will look more or less identical."
I still have to do style all the standard widgets myself or build them from scratch. I don't want them to be more or less identical, they should be what the user has on their handset.
For example where is the toast, FAB, file picker, recycler view, notification..?
iOS support is still not a thing, apparently from the comments.
Also where are the OS bindings for resources, background services, IPC between apps, OS state notifications?
Currently on the mobile space, Qt adds little value over using C++ with boost and similar libraries for the portable business logic and using the platform's main language for the UI.
At least with Xamarin I have a very good coverage for the wrapped APIs and mobile widgets per platform, updated quickly after each new OS release.
From the submission title, I assumed it was a non-free, dead tree book.
I don't say they are wrong to say the book is about Qt5. I am just baffled by how a Qt5 book would not even mention such things.
Just check the videos of the conferences.
Does anyone have a path out of this mess?