4 ms·
I've used QML / QtQuick for a while. Here are my thoughts 1. It makes writing UI state machines much simpler since it is declarative. Instead of saying "when t
by Timmmmbob 13y ago
I've used QML / QtQuick for a while. Here are my thoughts
1. It makes writing UI state machines much simpler since it is declarative. Instead of saying "when this information changes, update the UI", you just say "This bit of UI shows this information" and then it updates it does it automatically.
2. Animation is also much easier (and possible at all).
3. Layout is... myeh it is not so good actually. UI files made it really really simple, but QML has a kind of Android-like overcomplication to it. For example I have no idea how to have two buttons above each other with the same width and have that width the minimum required to fit them both. With the old system I didn't even have to think about that.
4. Javascript was a seriously bad choice. Fortunately you don't write that much of it (and the non-javascript parts of QML are well designed). The biggest problem is that you have to run code to have even the vaguest idea that it will work (probably you misspelt a variable). With C++ if it compiles you at least have some idea that it will work. Also there is a lot of hassle converting between C++ values and javascript objects. Particularly for lists/vectors of things which work very badly and... to be honest does not really work.
5. It does force you to separate your logic and UI - kind of like HTML/CSS. This is a good thing generally.
6. Once you've done the hard C++ work, building the UI is much quicker and less verbose than using the old system. It is also easier to change around.
In generally they are going in the right direction. They just made a huge mistake by choosing javascript. They've ended up writing their own javascript VM too, so I don't know why they didn't take the opportunity to use a sane, strongly typed language.
- thomaszander 13y agoThe history of the VMs is that many years before there was QML there was QtScript. A Javascript based engine. This got used for Qt4. In Qt5 the V8 open source engine got used instead. Either way, they ended up picking something that was already there, which would explain why it was easier than creating a brand new langauge.
- alok-g 13y agoIs using Javascript mandatory (for common uses)?
- daliusd 13y agoYou can keep it minimal if you want to. In some situations you can avoid javascript completely (e.g. QML based framework covers all details for you).