Skip to main content

yse_ui/
lib.rs

1//! `yse-ui` binds [`yse_model`] to a retained Qt Widgets tree.
2//!
3//! Components are plain Rust wrappers around a small hand-written C++ shim.
4//! Every component owns its subscriptions through an `Owner` that is tied to
5//! the Qt object lifetime: when the widget is destroyed, all of its bindings
6//! are released automatically.
7
8#![warn(missing_docs)]
9
10mod action;
11mod app;
12mod bridge;
13mod callback;
14mod component;
15mod dsl;
16mod qt_object;
17mod widgets;
18
19pub(crate) use widgets::SelectionBridge;
20
21pub use app::{Application, QtGuiScheduler, QtTimer};
22pub use dsl::{
23    BoolValue, ButtonView, CheckBoxView, ComboBoxView, IntoBoolValue, IntoIntValue, IntoTextValue,
24    LabelView, LayoutView, LineEditView, MountContext, ProgressBarView, SliderView, SpacerView,
25    SpinBoxView, TextValue, Ui, View, button, checkbox, column, combo_box, label, line_edit,
26    progress_bar, row, slider, spacer, spin_box,
27};
28pub use widgets::*;
29
30/// Clone each named binding and move the clones into `body` (typically a
31/// `move` closure), avoiding `let x = x.clone();` boilerplate.
32#[macro_export]
33macro_rules! clone {
34    ($($name:ident),+ => $body:expr) => {
35        {
36            $(let $name = $name.clone();)+
37            $body
38        }
39    };
40}