Skip to content

Instantly share code, notes, and snippets.

@ErichDonGubler
Last active December 1, 2018 09:04
Show Gist options
  • Save ErichDonGubler/c802e066de7068241f0e6e492e6584ed to your computer and use it in GitHub Desktop.
Save ErichDonGubler/c802e066de7068241f0e6e492e6584ed to your computer and use it in GitHub Desktop.

This gist documents Erich's endeavors to get QML working with Rust on his machines, since there's not much in the way of a helpful tutorial.

Windows

WARNING: Work in progress. Definitely not complete!

To get gcc/make/cmake, we'll need to...what? Building qml-rust with the Win-builds version of GCC seems to make the build report gcc as broken (see here).

Install Qt with the open-source license for versions 5.6-5.8 here.

Arch Linux

Make sure you have base-devel and extra enabled in pacman and install the dependencies listed on qml-rust's README.md:

# pacman -S gcc cmake make pkg-config

rust-qml uses Qt 5.7 in the docs, but 5.8 seems to work just fine. Install QML/Qt:

# pacman -S qt5-declarative

We'll need to get C bindings for QML, which in Linux's case is conveniently used as a submodule in the qml-rust repo:

$ git clone 
$ cd qml-rust
$ git submodule update --recursive --init # DOtherSide, the C bindings for QML, are a Git submodule usable for Linux

Run an example in the qml-rust repo (I'll use listmodel) to verify that everything got set up correctly:

$ cargo run --example listmodel

Issues

You may need to disable QML caching for running qml-rust examples through Cargo (i.e., cargo run --example). Thanks to this section of the Arch Repo for this tip:

export QML_DISABLE_DISK_CACHE=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment