Never write a qmldir
file manually again! This Qbs module generates it automatically.
- (Almost) full support of every kind of declaration for Module Definition
qmldir
Files. - Automatic listing of QML objects and JS resources.
- Detection of singletons via
pragma Singleton
.
DynamicLibrary {
Depends { name: 'Qt.qml' }
Depends { name: 'easy.qmldir' } // depend on the module
name: 'mega-controls-plugin'
files: ['src/plugin.h']
Group {
name: 'QML files'
files: [
'qml/Button.qml',
'qml/Slider.qml',
'qml/Toggle.qml',
]
fileTags: ['easy.qmldir.inputs'] // tag your QML or JavaScript files
}
Qt.qml.importName: 'mega.controls'
Qt.qml.importVersion: '2.0'
easy.qmldir.classname: 'mega::ControlsPlugin' // optionally, specify the class name
// other qmldir facilities are also available (see below)
}
This will produce the following qmldir
file:
module mega.controls
plugin mega-controls-plugin
classname mega::ControlsPlugin
typeinfo plugins.qmltypes
Button 2.0 Button.qml
Slider 2.0 Slider.qml
Toggle 2.0 Toggle.qml
Check the example
folder or simply run this from the repository’s root:
qbs run
Check the documentation for installation and configuration guides.