File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
crates/cxx-qt-lib/src/qml Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
38
38
- QObject subclasses can now inherit from other CXX-Qt generated QObject classes
39
39
- ` BUILD_WASM ` CMake option to support WebAssembly builds and a book page for building for WASM
40
40
- Add support for cxx_name and rust_name on qproperty attributes which applies to the QProperty generated as well as functions
41
+ - Add support for loading QML files in ` QQmlApplicationEngine ` from modules with ` loadFromModule ` .
41
42
42
43
### Changed
43
44
Original file line number Diff line number Diff line change 5
5
6
6
#[ cxx:: bridge]
7
7
mod ffi {
8
+ unsafe extern "C++" {
9
+ #[ cfg( any( cxxqt_qt_version_at_least_7, cxxqt_qt_version_at_least_6_5) ) ]
10
+ include ! ( "cxx-qt-lib/qanystringview.h" ) ;
11
+ type QAnyStringView < ' a > = crate :: QAnyStringView < ' a > ;
12
+ }
13
+
8
14
unsafe extern "C++" {
9
15
include ! ( "cxx-qt-lib/qstring.h" ) ;
10
16
type QString = crate :: QString ;
@@ -36,6 +42,16 @@ mod ffi {
36
42
/// Loads the root QML file located at url.
37
43
fn load ( self : Pin < & mut QQmlApplicationEngine > , url : & QUrl ) ;
38
44
45
+ /// Loads the QML type typeName from the module specified by uri.
46
+ /// This function was introduced in Qt 6.5.
47
+ #[ cfg( any( cxxqt_qt_version_at_least_7, cxxqt_qt_version_at_least_6_5) ) ]
48
+ #[ rust_name = "load_from_module" ]
49
+ fn loadFromModule (
50
+ self : Pin < & mut QQmlApplicationEngine > ,
51
+ uri : QAnyStringView ,
52
+ typeName : QAnyStringView ,
53
+ ) ;
54
+
39
55
/// This property holds the directory for storing offline user data
40
56
#[ rust_name = "offline_storage_path" ]
41
57
fn offlineStoragePath ( self : & QQmlApplicationEngine ) -> QString ;
You can’t perform that action at this time.
0 commit comments