chore: initial commit

Initial commit
This commit is contained in:
2026-04-16 17:15:42 -05:00
commit f8ed47acff
16 changed files with 1863 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
pub mod my_object;
+31
View File
@@ -0,0 +1,31 @@
#[cxx_qt::bridge]
pub mod qobject {
unsafe extern "C++" {
include!("cxx-qt-lib/qstring.h");
type QString = cxx_qt_lib::QString;
}
extern "RustQt" {
#[qobject]
#[qml_element]
#[qproperty(i32, counter)]
type CounterLogic = super::CounterLogicRust;
#[qinvokable]
fn increment(self: Pin<&mut Self>);
}
}
use core::pin::Pin;
#[derive(Default)]
pub struct CounterLogicRust {
counter: i32,
}
impl qobject::CounterLogic {
pub fn increment(self: Pin<&mut Self>) {
let new_val = *self.counter() + 1;
self.set_counter(new_val);
}
}