Movatterモバイル変換


[0]ホーム

URL:


Qt applications with Cargo

2018-10-30

This blog shows how Qt applications can be built with Cargo. The goalis to make compiling them as simple as installing Qt and running

qrep andmailmodel areexamples. You can tryqrep with

RustQt Binding Generator repository.

Why Cargo?

Inpreviousblogs we built applications with CMake. CMake is probably the mostwidely used tool to compile Qt software. CMake uses Cargo to build theRust parts.

CMake is a familiar tool for Qt developers, but not for Rustdevelopers. For them, CMake is an unneeded hurdle. Rust Qt BindingGenerator can be used with only Cargo. To do so you use the Rust way ofbuilding C++ code:build.rs.

build.rs

build.rs contains Rust code that is compiled and run byCargo to build an application. Here is a simplebuild.rsfile:

here.

Comments

Post a comment


[8]ページ先頭

©2009-2025 Movatter.jp