Skip to content

Commit e480e7a

Browse files
committed
More docs
1 parent d296748 commit e480e7a

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

qttypes/README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,17 @@ want to use Qt's C++ API:
1313
- `DEP_QT_INCLUDE_PATH`: The include directory to give to the `cpp_build` crate to locate the Qt headers
1414
- `DEP_QT_LIBRARY_PATH`: The path containing the Qt libraries.
1515

16-
See the [crate documentation](https://docs.rs/qttypes) for more info.
16+
See the [crate documentation](https://docs.rs/qttypes) for more info.
17+
18+
## Philosophy
19+
20+
The goal of this crate is to expose a idiomatic Qt API for the core value type classes.
21+
The API is manually generated to expose required feature in the most rust-like API, while
22+
still keeping the similarities with the Qt API itself.
23+
24+
It is not meant to expose all of the Qt API exhaustively, but only the part which is
25+
relevant for the usage in other crate.
26+
If you see a feature missing, feel free to write a issue or a pull request.
27+
28+
Note that this crate concentrate on the value types, not the widgets or the
29+
the `QObject`. For that, there is the `qmetaobject` crate.

qttypes/src/lib.rs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3131
//! - `DEP_QT_LIBRARY_PATH`: The path containing the Qt libraries.
3232
//! - `DEP_QT_FOUND`: set to 1 when qt was found, or 0 if qt was not found and the `mandatory` feature is not set
3333
//!
34+
//! ## Philosophy
35+
//!
36+
//! The goal of this crate is to expose a idiomatic Qt API for the core value type classes.
37+
//! The API is manually generated to expose required feature in the most rust-like API, while
38+
//! still keeping the similarities with the Qt API itself.
39+
//!
40+
//! It is not meant to expose all of the Qt API exhaustively, but only the part which is
41+
//! relevant for the usage in other crate.
42+
//! If you see a feature missing, feel free to write a issue or a pull request.
43+
//!
44+
//! Note that this crate concentrate on the value types, not the widgets or the
45+
//! the `QObject`. For that, there is the `qmetaobject` crate.
46+
//!
3447
//! ## Usage with the `cpp` crate
3548
//!
36-
//! Here is an example that make use of the types exposed by this crate in combinaition with the `cpp` crate
37-
//! to call native API:
49+
//! Here is an example that make use of the types exposed by this crate in combinaition
50+
//! with the [`mod@cpp`] crate to call native API:
3851
//!
3952
//! In `Cargo.toml`
4053
//! ```toml
@@ -44,9 +57,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4457
//! cpp = "0.5"
4558
//! #...
4659
//! [build-dependencies]
47-
//! cpp_build = "0.5.4"
60+
//! cpp_build = "0.5"
4861
//! ```
4962
//!
63+
//! Note: It is importent to depend directly on `qttype`, it is not enough to rely on the
64+
//! dependency coming transitively from another dependencies, otherwie the `DEP_QT_*`
65+
//! environment variables won't be defined.
66+
//!
5067
//! Then in the `build.rs` file:
5168
//! ```ignore
5269
//! fn main() {
@@ -66,14 +83,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6683
//! ```
6784
//!
6885
//! You will find a small but working example in the
69-
//! [qmetaobject reporisoty](https://github.com/woboq/qmetaobject-rs/tree/master/examples/graph)
86+
//! [qmetaobject-rs reporisoty](https://github.com/woboq/qmetaobject-rs/tree/master/examples/graph)
87+
//!
88+
//! ## Cargo Features
7089
//!
71-
//! ## Features
7290
//! - **`mandatory`**: When this feature is enabled (the default), the build script will panic with an error
7391
//! if Qt is not found. Otherwise, when not enabled, the build will continue, but any use of the classes will
7492
//! panic at runtime
7593
//! - **`chrono`**: enable the conversion between [`QDateTime`] related types and the types from the `chrono` crate.
76-
//! - **`qtquick`**, **`qtwebengine`**: link against these modules
94+
//! - **`qtquick`**, **`qtwebengine`**: link against these Qt modules
95+
//!
7796
7897
#![cfg_attr(no_qt, allow(unused))]
7998

0 commit comments

Comments
 (0)