As a long time C++ and Python (PyQt) Qt developer, I have been observing the Qt project's move towards Javascript/ECMA script with a mixture of contempt and dismay. Since the early days of Qt4, every dot release of Qt included some new Javascript module or feature that would supposedly shift every paradigm. However, to be quite frank, the included examples for the latest Qt Javascript features were low quality hello-world type applications with glaring bugs. Nothing in the mosh pit of QtScript, QtDeclarative, QtQuick, and/or QML seemed appealing, and nobody anywhere seemed to be using it for anything.
However, that is beginning to change. Wanting to fix some issues I encountered in KDE5/plasma, I discovered that it's largely QML. Even the start-menu/kicker thingy is QML. In order to make that menu taller, which was a simple click-drag operation in KDE4 (drag the top right corner to resize as if it were a window), KDE5 required me to edit a QML file. Needing to edit a file rather than simply click-dragging is moronic, but, in any case, I had manipulated my first QML file, and that QML file represents a GUI thing that I use quite often.
My interest piqued, I spent an hour here and there over the course of the following weeks familiarizing myself with QML, Qt Quick2, the Qt Quick 2 scene graph, Javascript, interfacing C++ and QML, doing OpenGL in Javascript in QML, exposing QAbstractItemModel derivatives implemented in C++ to QML, and the like.
My impression at this point:
- I like the ability to bind a Q_PROPERTY exposed by a C++ QObject derivative to fields in a user interface element declared in QML such that the GUI field updates when the property changes and the property is updated when the GUI field changes. Furthermore, it's awesome that simple expressions combining multiple such properties can be bound. There should be a way to do these things with Qt in C++ without connecting a billion signals and slots.
- The anchor-based layout system is nice. There should be something like it in the Qt C++ API.
- The provided Quick2 widgets are entirely worthless to me because their C++ implementations are all "private", so they can't be extended in useful way.
- More generally, the C++ implementations of all of everything QML-related are "private", except for a few base classes, making all of everything QML-related entirely useless. Want to extend QML's integrated models? Not happening. Want to extend QML's anything what-so-fucking-ever? You can't.
In other words, as I write this, it's my opinion that QML and the entire Qt Javascript effort has been a complete waste of time whose only significant impact has been to cause the useful C++ parts of Qt to go essentially unmaintained for the last five years. For example, Qt 5.5.1 still doesn't support mouse event compression on X11, making it unsuitable for anything where mouse movement can cause computation that takes more than 1/60th of a second. Things so basic that they can't not work... don't work. And nobody cares, because javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript javascript.
Nonetheless, it is conceivably possible that I've had a rough time with QML simply because I'm thrashing about, ignorantly trying to do simple things in impossibly stupid ways that go against the flow. Maybe I would have a fine time if I just read the documentation, worked through a few tutorials, and gave up my hidebound C++-centric ways. So, I'm doing exactly that, and part 2 will detail my rebirth and first fresh steps with Jesus QML.
Post a Comment