[Interest] Creating Qt Quick controls from C++

Uwe Rathmann Uwe.Rathmann at tigertal.de
Tue Jul 19 12:33:30 CEST 2016


On Tue, 19 Jul 2016 11:10:26 +0200, Benjamin TERRIER wrote:

> * you can't even create ...

As I'm currently working on a library offering Quick Controls with an C++ 
API ( having a QML API as well ) I already have some experience in what 
it means.

The very first thing you will notice is that the Quick classes available 
as private or public headers from the Qt Quick core module have never 
been consequently designed for the C++ use case.

Next you will notice, that this module does not follow concepts you would 
expect, when being used to widgets. This starts with using homebrew 
notification hooks instead of events, continues with having 2 different 
object hierarchies and ends with being inconsistent with QGuiApplication.

Next you will see, that you don't have a powerful layout system. The 
existing implementation for QML builds an API using attached properties.
But this is only a frontend for QGridLayoutEngine and it is not that much 
work to write another one, that offers a C++ API ( my version is around 
1000 lines of code for Grid/Box/Stack layouts ), that can be used like 
the QLayout classes.

So there is a lot of initial work to be done before you are in the 
position to start with implementing Quick Controls in C++. But once you 
have it you can easily outperform the existing QML implementations in 
terms of instantiation times and memory footprint - not to mention that 
you are free to decide to have a pure C++ code base.

More details about my experiment will be presented at: https://
conf.qtcon.org/en/qtcon/public/events/428

Uwe




More information about the Interest mailing list