Skip to content

Commit

Permalink
Book: Update CXX-Qt dependencies to 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonMatthesKDAB committed Nov 17, 2023
1 parent aaee74e commit 5dfdeab
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 85 deletions.
39 changes: 5 additions & 34 deletions book/src/tutorial/qt-gui/build-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,47 +38,18 @@ ApplicationWindow {
✅ Add dependencies to the `Cargo.toml` file
```toml
[dependencies]
rustagram2="*"
rustagram2 = "*"
image-manipulation = { path = "../image-manipulation" }

cxx="1.0.95"
cxx-qt = { git="https://github.com/LeonMatthesKDAB/cxx-qt", branch="qimage" }
cxx-qt-lib = { git="https://github.com/LeonMatthesKDAB/cxx-qt", branch="qimage" }
cxx = "1.0.95"
cxx-qt = "0.6"
cxx-qt-lib = "0.6"

[build-dependencies]
# The "link_qt_object_files" is required when using Cargo to link to Qt statically.
cxx-qt-build = { git="https://github.com/LeonMatthesKDAB/cxx-qt", branch="qimage", features = [ "qt_qml", "link_qt_object_files" ] }
cxx-qt-build = { version = "0.6", features = [ "qt_qml", "link_qt_object_files" ] }
```

```diff
- At the time of writing (17.11.2023), CXX-Qt 0.6 hasn't been released yet.
- To keep the training material up-to-date with the new API introduced in version 0.6,
- we'll use the version from Github for now.
- The training material on Github will be updated as soon as version 0.6 is released!

- Do note that the public documentation for CXX-Qt is still for version 0.5.
- You should wait before following this tutorial until version 0.6 is
- released in the coming weeks.
```

<details>
<summary> Future imports once CXX-Qt 0.6 is released </summary>

```toml
[dependencies]
rustagram2="*"
image-manipulation = { path = "../image-manipulation" }

cxx="1.0.95"
cxx-qt="0.6"
cxx-qt-lib="0.6"

[build-dependencies]
# The "link_qt_object_files" is required when using Cargo to link to Qt statically.
cxx-qt-build = { version="0.6", features = [ "qt_qml", "link_qt_object_files" ] }
```
</details>

CXX-Qt is split up into multiple crates.
* CXX-Qt - Allows you to create QObjects from Rust and to interact with existing QObjects
* CXX-Qt-lib - Library of bindings to Qt types like `QString`, `QApplication`, etc.
Expand Down
42 changes: 28 additions & 14 deletions crates/qt-gui-qquickpainteditem/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/qt-gui-qquickpainteditem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"

[dependencies]
cxx = "1.0.95"
cxx-qt = { git = "https://github.com/LeonMatthesKDAB/cxx-qt", branch = "qimage" }
cxx-qt-lib = { git = "https://github.com/LeonMatthesKDAB/cxx-qt", branch = "qimage" }
cxx-qt = "0.6"
cxx-qt-lib = "0.6"

[build-dependencies]
cxx-qt-build = { git = "https://github.com/LeonMatthesKDAB/cxx-qt", branch = "qimage", features = [ "qt_qml", "link_qt_object_files" ] }
cxx-qt-build = { version = "0.6", features = [ "qt_qml", "link_qt_object_files" ] }
42 changes: 28 additions & 14 deletions crates/qt-hello-world/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/qt-hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cxx-qt = { git="https://github.com/kdab/cxx-qt" }
cxx-qt-lib = { git="https://github.com/kdab/cxx-qt" }
cxx-qt = "0.6"
cxx-qt-lib = "0.6"

[build-dependencies]
cxx-qt-build = { git="https://github.com/kdab/cxx-qt", features = [ "qt_qml", "link_qt_object_files" ] }
cxx-qt-build = { version = "0.6", features = [ "qt_qml", "link_qt_object_files" ] }
35 changes: 21 additions & 14 deletions crates/with-workspace/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/with-workspace/qt-gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ rustagram2="*"
image-manipulation = { path = "../image-manipulation" }

cxx = "1.0.95"
cxx-qt = { git = "https://github.com/LeonMatthesKDAB/cxx-qt", branch = "qimage" }
cxx-qt-lib = { git = "https://github.com/LeonMatthesKDAB/cxx-qt", branch = "qimage" }
cxx-qt = "0.6"
cxx-qt-lib = "0.6"

[build-dependencies]
cxx-qt-build = { git = "https://github.com/LeonMatthesKDAB/cxx-qt", branch = "qimage", features = [ "qt_qml", "link_qt_object_files" ] }
cxx-qt-build = { version = "0.6", features = [ "qt_qml", "link_qt_object_files" ] }

0 comments on commit 5dfdeab

Please sign in to comment.