is custom Struct used as param of connect efficient? pass by value, not pointer, because signal and slot are not in the same thread
Unsolved
General and Desktop
-
Yes, why not? Unless it is some huge behemoth, CPU will handle parameter copying without an issue.
-
Hi,
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...
https://forum.qt.io/topic/102915/qmetaobject-invokemethod-pass-custom-type-called-twice-custom-type-s-copy-constructor