Quantcast
Channel: Active questions tagged qtquick2 - Stack Overflow
Viewing all articles
Browse latest Browse all 137

Is it possible to connect multiple slots to one signal?

$
0
0

I am trying to figure out the best way for a QML object to send out a signal and for many other QML elements to respond to it. Normally, if you create signal mySignal then you have a handler automatically created for you called onMySignal but that handler exists only within the same element that created the signal.

A particularly inelegant solution could be to store an array of QML elements you want updated when a signal occurs, and then in your handler you loop through all those elements and do what you need.

I'd be surprised if there wasn't an easier way. Am I missing an obvious use case of the signal-slot mechanism in QML?


Viewing all articles
Browse latest Browse all 137

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>