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
3838- QObject subclasses can now inherit from other CXX-Qt generated QObject classes
3939- ` BUILD_WASM ` CMake option to support WebAssembly builds and a book page for building for WASM
4040- 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 ` .
4142
4243### Changed
4344
Original file line number Diff line number Diff line change 55
66#[ cxx:: bridge]
77mod ffi {
8+ #[ cfg( any( cxxqt_qt_version_at_least_7, cxxqt_qt_version_at_least_6_5) ) ]
9+ unsafe extern "C++" {
10+ include ! ( "cxx-qt-lib/qanystringview.h" ) ;
11+ /type QAnyStringView < ' a > = crate :: QAnyStringView < ' a > ;
12+ }
13+
814 unsafe extern "C++" {
915 include ! ( "cxx-qt-lib/qstring.h" ) ;
1016 type QString = crate :: QString ;
@@ -36,6 +42,16 @@ mod ffi {
3642 /// Loads the root QML file located at url.
3743 fn load ( self : Pin < & mut QQmlApplicationEngine > , url : & QUrl ) ;
3844
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+
3955 /// This property holds the directory for storing offline user data
4056 #[ rust_name = "offline_storage_path" ]
4157 fn offlineStoragePath ( self : & QQmlApplicationEngine ) -> QString ;
You can’t perform that action at this time.
0 commit comments