O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a QML module

In what follows, we will develop our QML components in the gui sub-project, and then import these into our ccpanels application project as a QML module. A QML module is a bundle of QML documents that share a namespace. It exposes a list of QML and JS files as types and resources, with specific version numbers. For introductory information about QML modules, check out: http://doc.qt.io/qt-5.9/qtqml-modules-topic.html.

Defining a QML module requires the presence of a qmldir file in the folder containing the types to be exposed. We go ahead and create this file in the gui folder by making use of Qt Creator's Empty File template (New File or Project > Files and Classes > General > Empty File). We then add it to gui.pri

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required