Qt Quick and C++
Thus far, we have been using standard Qt Quick items or creating new ones by compositing existing element types in QML. But there is a lot more you can do if you interface QML and C++ using the technologies Qt has to offer. Essentially, QML runtime does not differ much in its design from Qt Script, which you read about in the previous chapter of this book. In the following paragraphs, you will learn how to gain access to objects living in one of the environments from within the other one, as well as how to extend QML with new modules and elements.
Until now, all the example projects we did in this chapter were written with just QML and because of that, the project type we were choosing was Qt Quick UI, which let us quickly see the Qt Quick scene we modeled by interpreting it with the qmlscene
tool. Now, we will want to add C++ to the equation and since C++ is a compiled language, we will need to do some proper compilation to get things working. Therefore, we will be using...