Skip to content

easyQML/easy.qmldir.qbs

Repository files navigation

easy.qmldir for Qbs

Made by Ukrainian License

Never write a qmldir file manually again! This Qbs module generates it automatically.

Features

  1. (Almost) full support of every kind of declaration for Module Definition qmldir Files.
  2. Automatic listing of QML objects and JS resources.
  3. Detection of singletons via pragma Singleton.

Example

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

Looking for more?

Check the example folder or simply run this from the repository’s root:

qbs run

Documentation

Check the documentation for installation and configuration guides.