if display() signal is emitted, display() slot will be executed.
so now i want the display() slot to block the program until it returns.
how do i do that?
Your program will block as long as display() does not return.
There is no need to do something special to block your program, even if it sounds strange why you want it to block.
I tested it, it doesnt block the program
qDebug() << "Message received!";
contents of display() slot
ive search around while waiting for answers in this thread.
can you tell me the use of Qt::BlockingQueuedConnection?
Emitting a signal in a single thread is basically calling a function, so it is blocking. The output you have can happen if "server" and "this" objects live in different threads. Is that the case?
Qt::BlockingQueuedConnection is only useful if sender and receiver live in different threads. It makes the sender block on emit until receiver executes the slot. In a single threaded execution this is how emit behaves out of the box.
my sender and receiver is in different thread.
I see! you hit all the bullseye!
and i now understand the Qt::BlockingQueuedConnection