QmlDirBuilder

Struct QmlDirBuilder 

Source
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

Source

pub fn new(uri: QmlUri) -> Self

Construct a QmlDirBuilder using the give QmlUri for the module identifier

Source

pub fn write(self, writer: &mut impl Write) -> Result<()>

Writer the resultant qmldir text file contents

Source

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.

Source

pub fn depend(self, depend: impl Into<QmlUri>) -> Self

Declares that this module depends on another

Source

pub fn depends<T: Into<QmlUri>>( self, depends: impl IntoIterator<Item = T>, ) -> Self

Declares that this module depends on another

Source

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.

Source

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.

Source

pub fn type_info(self, file: impl Into<String>) -> Self

Declares a type description file for the module that can be read by QML tools such as Qt Creator to access information about the types defined by the module’s plugins. File is the (relative) file name of a .qmltypes file.

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.