pub struct QtBuild { /* private fields */ }Expand description
Helper for build.rs scripts using Qt
let qt_modules = vec!["Core", "Gui"]
.iter()
.map(|m| String::from(*m))
.collect();
let qtbuild = qt_build_utils::QtBuild::new(qt_modules).expect("Could not find Qt installation");Implementations§
Source§impl QtBuild
impl QtBuild
Sourcepub fn new(qt_modules: Vec<String>) -> Result<Self>
pub fn new(qt_modules: Vec<String>) -> Result<Self>
Create a QtBuild automatically determining the QtInstallation depending on enable features
and specify which Qt modules you are linking, ommitting the Qt prefix ("Core"
rather than "QtCore").
Sourcepub fn with_installation(
qt_installation: Box<dyn QtInstallation>,
qt_modules: Vec<String>,
) -> Self
pub fn with_installation( qt_installation: Box<dyn QtInstallation>, qt_modules: Vec<String>, ) -> Self
Create a QtBuild using the given QtInstallation and specify which
Qt modules you are linking, ommitting the Qt prefix ("Core" rather than "QtCore").
Sourcepub fn autorcc_options(
self,
options: impl IntoIterator<Item = impl AsRef<OsStr>>,
) -> Self
pub fn autorcc_options( self, options: impl IntoIterator<Item = impl AsRef<OsStr>>, ) -> Self
Add custom arguments to be passed to the end of the rcc invocation when converting qrc files.
Sourcepub fn cargo_link_libraries(&self, builder: &mut Build)
pub fn cargo_link_libraries(&self, builder: &mut Build)
Tell Cargo to link each Qt module.
Sourcepub fn framework_paths(&self) -> Vec<PathBuf>
pub fn framework_paths(&self) -> Vec<PathBuf>
Get the frmaework paths for Qt. This is intended to be passed to whichever tool you are using to invoke the C++ compiler.
Sourcepub fn include_paths(&self) -> Vec<PathBuf>
pub fn include_paths(&self) -> Vec<PathBuf>
Get the include paths for Qt, including Qt module subdirectories. This is intended to be passed to whichever tool you are using to invoke the C++ compiler.
Sourcepub fn installation(&self) -> &dyn QtInstallation
pub fn installation(&self) -> &dyn QtInstallation
Get the inner QtInstallation implementation
Sourcepub fn register_qml_module(
&mut self,
metatypes_json: &[impl AsRef<Path>],
uri: &QmlUri,
version_major: usize,
version_minor: usize,
plugin_name: &str,
qml_files: &[QmlFile],
depends: impl IntoIterator<Item = impl Into<QmlUri>>,
plugin_type: PluginType,
) -> QmlModuleRegistrationFiles
pub fn register_qml_module( &mut self, metatypes_json: &[impl AsRef<Path>], uri: &QmlUri, version_major: usize, version_minor: usize, plugin_name: &str, qml_files: &[QmlFile], depends: impl IntoIterator<Item = impl Into<QmlUri>>, plugin_type: PluginType, ) -> QmlModuleRegistrationFiles
Generate C++ files to automatically register a QML module at build time using the JSON output from moc.
This generates a qmldir file for the QML module.
The qml_files and qrc_files are registered with the Qt Resource System in
the default QML import path qrc:/qt/qml/uri/of/module/.
When using Qt 6, this will run qmlcachegen to compile the specified .qml files ahead-of-time.
Sourcepub fn qmltyperegistrar(&self) -> QtToolQmlTypeRegistrar
pub fn qmltyperegistrar(&self) -> QtToolQmlTypeRegistrar
Create a QtToolQmlTypeRegistrar for this QtBuild
Sourcepub fn qtpaths(&self) -> QtToolQtPaths
pub fn qtpaths(&self) -> QtToolQtPaths
Create a QtToolQtPaths for this QtBuild