Hi all,

I've connected a main thread's signal to the same slot of many objects (of same type) that all live in their own thread. I'm using QueuedConnection. The signal transports a potentially large argument (QJsonObject).

Qt Code:
  1. signals:
  2. /*! Signal signature. */
  3. void sendData(QJsonObject o);
To copy to clipboard, switch view to plain text mode 

Actually, only one thread is the receiving thread and all the other threads simply ignore the message.

From my understanding of Qt, the payload of the signal is copied over into the target thread's memory where it can be accessed from the target thread's slot without any locking mechanism.
If I now copy the payload needlessly to many threads (all but one discard the message), I create an unnecessary overhead.

Questions:
1. is my expectation on Qt's behavior regarding copying of payload during queuing of the signal correct?
2. is there an alternative design which allows me to emit the signal such, that it is only send to one of the connected threads? (i.e. connecting the target thread before emit and disconnecting afterwards would work, but has an overhead as well, right?)

Thanks for any insights,
Andreas