My Experience with Qt: Quick and Quick3D

A few years ago, I began to develop applications across multiple platforms written in C++. I wrote mostly on Windows, and the discovery of open-source projects led me to discover the Qt framework. I’ve spent more time than I would care to admit on understanding Qt: it’s IDE, the runtime libraries.

I feel it necessary to mention that a module in Qt is a wide term, as it can include files, headers, C++ classes and associated shared libraries, or static libraries. With Qt Quick, this also includes QML files, and other configuration and resource files.

I’m now moving away from the Qt framework, but I still aim to make software run across multiple platforms. I still write C++ code, and exploit the ubiquity of OpenGL.

Because OpenGL is fairly portable, I’ve taken a hybrid approach by mixing C++ with another language, native to the target platform. For example, I have used Java on Android, to create user interface elements, mixing with native calls. And, it works, as I’ve used this approach for Tuning, achieving the desired traits of performance and size.

Tuning starts in milliseconds compared to a Qt application, which takes seconds. The Qt application on Android also uses Java code, but also relies on loading shared libraries bundled with the application’s package, and this takes time.

The Quick module in Qt is very convenient, as it provides controls and common items as QML components. Quick applications use the QQmlApplication C++ class, which allows loading QML code and rendering it.

The Quick 3D module provides types in QML that allow you to mix 2D and 3D content in the same scene in the form of nodes. This is impressive because Quick prioritized 2D rendering, and although Quick’s internal renderer uses API’s for 3D rendering like OpenGL, you needed to create a custom scene graph class type, accessible as a QML type, that would use 3D API’s directly, which would co-operate with Quick’s scene graph rendering process.

Quick 3D works with a variety of rendering API’s, including desktop and embedded OpenGL, through Qt’s Rendering Hardware Interface. Unfortunately, when I tested my application shown below on Android, it didn’t seem to work with the OpenGL/ES backend, as it showed a black screen.

Luckily, it works on Ubuntu, as it uses OpenGL 4. Here’s a screenshot of my application running on Ubuntu:

A Screenshot of an application mixing 2D and 3D content, using the QML Engine from Qt and additional underlying classes

The latter reason, along with other bugs and also the baggage that Qt carries in the form of shared libraries may have influenced my decision to embrace minimalism more. My project, Car Customizer, may be moving on to using only necessary libraries and source code.

If less is more, than I hope I can achieve the same with less, and possibly more.





Leave a Reply

Your email address will not be published. Required fields are marked *