slide_obj.rs working

This commit finally has a working basic slide_obj implemented in Rust!
There are likely still some things that need to be tweaked and
massaged in order for things to translate back and forth from QML to
Rust.

The key was to make the old SlideObject written in C++ to act as a
bridge between QML and Rust. QML can't seem to understand CXX-QT's
QMap_QString_QVariant type as a QVariantMap and thus didn't translate
the Javascript object properly. Having the call first go into a C++
class translated it and then was trivial to pass into Rust.
This commit is contained in:
Chris Cochrun 2023-03-24 11:31:18 -05:00
parent 0936490bee
commit 0caadfc5c8
6 changed files with 55 additions and 17 deletions

View file

@ -174,8 +174,8 @@ FocusScope {
Controls.Switch {
id: loopSwitch
text: "Loop"
checked: SlideObject.loop
onToggled: SlideObject.setLoop(!SlideObject.loop)
checked: SlideObject.looping
onToggled: SlideObject.setLooping(!SlideObject.looping)
Keys.onLeftPressed: previousSlideAction()
Keys.onRightPressed: nextSlideAction()
Keys.onUpPressed: previousSlideAction()