Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

Implications of const signals

$
0
0
I noticed that, on occasion, I have need to emit a signal from a const method. I also noticed that there is an easy way to achieve this: You simply make the signal ‘const’ (at least in Qt 4 that works). Later on I realized that I could still connect this const signal to a non-const slot. That also works, but leads to interesting implications: Does the const signal tear a hole in the fabric of const-correctness? It certainly looks like it does. Which makes the use of const signals similar to the use of const_cast: There are times when you need it, but you should really think hard what the consequences are. What are your views on this?

Viewing all articles
Browse latest Browse all 22112

Trending Articles



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