Closed flanfly closed 7 years ago
@flanfly I usually do it from the other way around: I connect Rust signals in QML: https://github.com/White-Oak/kefia/blob/master/src/view.qml#L185-L190. In this case you want to connect a signal of Rust's QObject
to a slot of Rust QObject
:
Component.onCompleted: {
rustQobj.some_prop_changed.connect(rustQobj.some_other_slot)
}
Thanks for the fast answer @White-Oak. I guess the meta answer is that connecting to signals in Rust is not possible :smile:. I'll keep using separate slots to write properties in case I need to be notified.
Hey, I have a QObject with a bunch of properties exposed to QML. Now, when the QML side writes one of the properties I want a Rust function to be called. So, how do I do something like
sig.connect(|| { ... })
in Rust?