You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I have a QObject that basically boils down to this:
use std::pin::Pin;#[cxx_qt::bridge]pubmod qobject {extern"RustQt"{#[qobject]typeService = super::RustService;}}structRustService{timer: cxx::UniquePtr<qobject::QTimer>}
(where I added some bindings for QTimer)
Now, on construction I want to connect the timeout signal to some functionality on the Service. First I tried this:
Now this works, but the self.qt_thread() feels a little funny when there are no threads involved here. Is there a better way that I'm missing here, or is this the best that can be done for now?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So I have a QObject that basically boils down to this:
(where I added some bindings for
QTimer)Now, on construction I want to connect the
timeoutsignal to some functionality on theService. First I tried this:This complains that the
QTimer(I think) isn'tSend, which is fair, but it's unfortunate when I know that I'm always on the same thread here.Anyway, then I discovered
cxx_qt::Threading, which lead me to do this:Now this works, but the
self.qt_thread()feels a little funny when there are no threads involved here. Is there a better way that I'm missing here, or is this the best that can be done for now?Beta Was this translation helpful? Give feedback.
All reactions