pub struct QmlDirBuilder { /* private fields */ }Expand description
QML module definition files builder
A qmldir file is a plain-text file that contains the commands
Implementations§
Source§impl QmlDirBuilder
impl QmlDirBuilder
Sourcepub fn new(uri: QmlUri) -> Self
pub fn new(uri: QmlUri) -> Self
Construct a QmlDirBuilder using the give QmlUri for the module identifier
Sourcepub fn write(self, writer: &mut impl Write) -> Result<()>
pub fn write(self, writer: &mut impl Write) -> Result<()>
Writer the resultant qmldir text file contents
Sourcepub fn class_name(self, class_name: impl Into<String>) -> Self
pub fn class_name(self, class_name: impl Into<String>) -> Self
Provides the class name of the C++ plugin used by the module.
This information is required for all the QML modules that depend on a C++ plugin for additional functionality. Qt Quick applications built with static linking cannot resolve the module imports without this information.
Sourcepub fn depend(self, depend: impl Into<QmlUri>) -> Self
pub fn depend(self, depend: impl Into<QmlUri>) -> Self
Declares that this module depends on another
Sourcepub fn depends<T: Into<QmlUri>>(
self,
depends: impl IntoIterator<Item = T>,
) -> Self
pub fn depends<T: Into<QmlUri>>( self, depends: impl IntoIterator<Item = T>, ) -> Self
Declares that this module depends on another
Sourcepub fn plugin(self, name: impl Into<String>, optional: bool) -> Self
pub fn plugin(self, name: impl Into<String>, optional: bool) -> Self
Declares a plugin to be made available by the module.
optional denotes that the plugin itself does not contain any relevant code and only serves to load a library it links to. If given, and if any types for the module are already available, indicating that the library has been loaded by some other means, QML will not load the plugin.
name is the plugin library name. This is usually not the same as the file name of the plugin binary, which is platform dependent. For example, the library MyAppTypes would produce libMyAppTypes.so on Linux and MyAppTypes.dll on Windows.
Only zero or one plugin is supported, otherwise a panic will occur.
Sourcepub fn qml_files(
self,
qml_files: impl IntoIterator<Item = impl Into<QmlFile>>,
) -> Self
pub fn qml_files( self, qml_files: impl IntoIterator<Item = impl Into<QmlFile>>, ) -> Self
Declares a list of .qml files that are part of the module.