QMetaObject crate for Rust
Native Windows GUI
Our great sponsors
QMetaObject crate for Rust | Native Windows GUI | |
---|---|---|
20 | 12 | |
599 | 1,892 | |
2.3% | - | |
6.5 | 0.0 | |
about 2 months ago | 5 months ago | |
Rust | Rust | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
QMetaObject crate for Rust
-
9 years of Apple text editor solo dev
You can use Rust with QML[1].
QML is actually pretty amazing. I've been building my block editor[2] view entirely in QML while the model is in C++. This separation of logic and presentation works great. And yes, there are some crashes sometimes (that I find quite easy to debug thanks to the built-in debugger), but take for example a similar app that's built with Rust and Dart[3], in my testing there were still memory leaks that caused my computer to hang. It's better to know you have a bug than for it to be hidden from you.
I agree with parent commenter, saying these cross-platform frameworks will end up supporting the least common denominator set of features. But I found with external open source libraries, the community is catching up very fast. For example, you want the awesome translucency macOS apps have for your Qt app? Here you go[4]. Many such cases. It's also pretty straightforward to add your own custom OS-dependent code, especially so, if someone already open sourced his approach. I recently wanted to move the traffic light buttons on macOS for my app, but couldn't figure the Objective-C code for that. I ended up looking at either Tauri or Electron source code and found my answer.
[1] https://github.com/woboq/qmetaobject-rs
-
I like rust but want to use Qt.
I just used qmetaobject-rs and my experience with Qt/QML. There's the QML book from Qt if you're just starting, which is pretty nice https://www.qt.io/product/qt6/qml-book
- GUI development with Rust and GTK 4
-
Made my first app in Rust! A notification daemon for Linux :)
qmetaobject is probably the most mature Qt Rust binding at the moment. It uses the cpp crate to embed C++ inline in Rust to create its bindings. There are some people using it and it does get some maintenance, but it's not under active development since the original author is now working on Slint.
- QT for Rust?
-
Using KConfig with Rust
The bindings currently use the git version of qttypes since I had to merge some upstream changes that are needed for these bindings. So they are not ready for prime time just yet.
-
CXX-Qt: safe Rust bindings for Qt
There are a bunch of bindings with different language, but even the ones that are officially supported like PySide will still be second class citizen and awkward to use.
Automated binding generation will never give you idiomatic API in whatever language. And if you want an idiomatic library that wraps Qt, it's going to take a huge amount of work.
Which is why I think restricting to QML makes sense because that's a much smaller API surface. That was the ambition behind my previous crate that exposes QML to rust: https://github.com/woboq/qmetaobject-rs/
But now I've moved on to another GUI project: Slint https://github.com/slint-ui/slint
-
Why does Rust code compile into a single executable binary?
Whisperfish does this with Qt: https://github.com/woboq/qmetaobject-rs/issues/102
-
Announcing Gyroflow - an advanced video stabilization tool written in Rust with GPU acceleration and cross-platform UI
What do you want to know? It's pretty easy thanks to the amazing work of guys behind qmetaobject-rs.
-
Using KI18n with Rust and Qml
This is probably the portion that I found the most difficult. The README of qmetaobject-rs gives us a basic idea of the build script, so I started with that. Here is my starting script
Native Windows GUI
- I have 0 coding experience or knowledge. I used ChatGPT to create code that would automate 80% of my work and I don't know how to deal with this newfound power
-
Which GUI toolkit for Rust today.. few questions...
On windows, I'll probably use https://github.com/gabdube/native-windows-gui or https://github.com/microsoft/windows-rs both of them seem pretty solid.
-
Rust: State of GUI, December 2022 – KAS blog
https://github.com/gabdube/native-windows-gui isn't in the list but is quite a polished option for building Windows specific GUIs.
- Minimum effort Windows GUI choice?
- Tauri – Electron alternative written in Rust
- A light windows GUI toolkit for rust
-
Good Rust System Tray Library?
My crate native-windows-gui supports tray application, if you only care about Windows. Example: https://github.com/gabdube/native-windows-gui/blob/master/native-windows-gui/examples/system_tray_d.rs
-
What's everyone working on this week (15/2021)?
Created a small resident windows program that shows a different icon depending on battery level test how easy using windows-rs and native-windows-gui is. Picked this as an easy learning project after seeing Battery Buddy for macOS.
-
WinSafe: Win32 GUI and related APIs in safe, idiomatic Rust - after 1 year and 5 months of development, first experimental version is finally here
native-windows-ui => https://github.com/gabdube/native-windows-gui
-
The state of gui libraries in rust?
If you only need to support Windows desktop, then let me shill my crate: native-windows-gui. It's super lightweight and it wraps pretty much all the gui stuff provided by win32. Just note that isn't really customizable look-wise.
What are some alternatives?
Slint - Slint is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications. We support multiple programming languages, such as Rust, C++ or JavaScript. [Moved to: https://github.com/slint-ui/slint]
Termion - Mirror of https://gitlab.redox-os.org/redox-os/termion
slint - Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
gtk - DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
wxRust - A Rust binding of the wxWidgets cross platform toolkit.
Azul - Desktop GUI Framework
Rust Qt Binding Generator git - Generate bindings to use Rust code in Qt and QML
tauri - Build smaller, faster, and more secure desktop applications with a web frontend.
ritual - Use C++ libraries from Rust
imgui-rs - Rust bindings for Dear ImGui
conrod - An easy-to-use, 2D GUI library written entirely in Rust.