Consider how connections could be made in Rust #365
Replies: 1 comment
-
#485 solves this with the route described in #473 which allows for adding a closure to the signal, specifying auto/queued etc, and disconnecting. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
On the Rust side you cannot connect to a signal from the QObject or other QObjects.
Proposed Solution
Use a closure + the signals enum + existing signals ( #286 ) to allow Rust to connect to a signal, then run a closure with the enum of the signal.
Discussion points
SignalsEnum::Signal(...)
as a parameter to the connection so it knows which signals to connect to on the C++ side and which to trigger in Rust?self.my_signal_connect(|| { ... })
? This then means that the C++ side would know which signal to connect to and the Rust side can just take the qobject + signal enum so it can read any argsBeta Was this translation helpful? Give feedback.
All reactions