S
S
sddvxd2018-09-14 21:45:36
Qt
sddvxd, 2018-09-14 21:45:36

How to connect a slot to a signal in another thread?

Hello
There are 2 streams - the main and the second. The second one has a slot slotDataChanged()that I'm trying to connect to a signal QClipboard::dataChanged(), it doesn't come out. I understand that it is impossible to take the objects created there from the main thread and connect them in a completely different thread
. In the main thread, you can’t connect for this reason: you will need to disconnect objects in another thread. Please tell me the solution to my problem

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Jacob E, 2018-09-15
@Zifix

Strictly speaking, when using connect , it should not matter to you at all which thread the object lives in - this is why the last default parameter is needed - Qt::AutoConnection .
What does it mean by "doesn't work"?

A
Armenian Radio, 2015-04-02
@frilix

A template class has methods in the header. Transfer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question