Can i use reference in signal slots
-
It is creating two temporary memory addresses .
So it will causes the time complexity problem. -
Well, you are using QueuedConnections, so don't be surprised.
I still fail to see any problem here, possibly I am too dumb for this. Or maybe it's the weekend-brain ;-)
-
Hi,
If you use a queued connection, Qt will copy your signal arguments. You don't need to worry about memory management (unless your argument is a pointer).
-
So is it good or bad using references in signal /slot
-
[quote author="praneeth007" date="1405928051"]So is it good or bad using references in signal /slot [/quote]
In case of most of non-QObject classes: it is good and recommended practice.
-
Just use const refernces. Qt makes it work :-)
-
why const compulsory
-
[quote author="praneeth007" date="1406010712"]why const compulsory [/quote]
Without it, you would keep modifying the original string.
-
I want to modify those
-
[quote author="praneeth007" date="1406016204"]I want to modify those[/quote]You can't do that through signals and slots.