File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,33 @@ Window {
59
59
60
60
Requires Qt >= 5.8
61
61
62
+ ## Cargo features
63
+
64
+ Cargo provides a way to enable (or disable default) optional [ features] ( https://doc.rust-lang.org/cargo/reference/features.html ) .
65
+
66
+ ### ` log `
67
+
68
+ By default, Qt's logging system is not initialized, and messages from e.g. QML's ` console.log ` don't go anywhere.
69
+ The "log" feature enables integration with [ ` log ` ] ( https://crates.io/crates/log ) crate, the Rust logging facade.
70
+
71
+ The feature is enabled by default. To activate it, execute the following code as early as possible in ` main() ` :
72
+
73
+ ``` rust
74
+ fn main () {
75
+ qmetaobject :: log :: init_qt_to_rust ();
76
+ // don't forget to set up env_logger or any other logging backend.
77
+ }
78
+ ```
79
+
80
+ ### ` chrono_qdatetime `
81
+
82
+ Enables interoperability of ` QDate ` and ` QTime ` with Rust [ ` chrono ` ] ( https://crates.io/crates/chrono ) package.
83
+
84
+ This feature is disabled by default.
85
+
62
86
## What if a binding for the Qt C++ API you want to use is missing?
63
87
64
- It is quite likely that you would like to call a particular Qt function wich is not wrapped by
88
+ It is quite likely that you would like to call a particular Qt function which is not wrapped by
65
89
this crate.
66
90
67
91
In this case, it is always possible to access C++ directly from your rust code using the cpp! macro.
You can’t perform that action at this time.
0 commit comments