How to write a qt_method that accepts a reference to a QObject-derived object? #297
Unanswered
pgeorgiev98
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have two QObject-derived classes (let's call them
Foo
andBar
) and I'm trying to implement a method inBar
that takes a reference to aFoo
object as an argument. My idea is for that method to be called from QML. Is there any way to do this?I noticed that if I use
QVariant
for the type my function gets called with the variant type set to 39 (QObject*
), but I couldn't find a way to convert that to a Rust type.I understand that I can make
Bar
ownFoo
with aRefCell<Foo>
property, but I'm trying to simplify the example code.Beta Was this translation helpful? Give feedback.
All reactions