is custom Struct used as param of connect efficient? pass by value, not pointer, because signal and slot are not in the same thread
is custom Struct used as param of connect effiecnt?pass by value, not pointer, because signal and slot are not in the same thread
Yes, why not? Unless it is some huge behemoth, CPU will handle parameter copying without an issue.
Depending on its content and use you can make it implicitly shared using QSharedDataPointer and thus make the "read only" copy faster.
@SGaist actually the non-mainThread is respond for get the data from the internet, and mainThread is read the data and show it in Qt-ui.
so QSharedDataPointer is much faster and precice than pass-by value?
why QMetaObject::invokeMethod pass custom-type called Twice custom-type's copy constructor...
As already written by @sierdzio, it's about the size of your object. If speed is that critical for you, then benchmark your code.