213 if ( QThread::currentThread() == qApp->thread() )
225 QSemaphore semaphoreMainThreadReady( 1 );
230 QSemaphore semaphoreWorkerThreadReady( 1 );
234 semaphoreMainThreadReady.acquire();
235 semaphoreWorkerThreadReady.acquire();
237 const std::function<void()> waitFunc = [&semaphoreMainThreadReady, &semaphoreWorkerThreadReady]()
242 semaphoreMainThreadReady.release();
245 semaphoreWorkerThreadReady.acquire();
248 QMetaObject::invokeMethod( qApp, waitFunc, Qt::QueuedConnection );
252 while ( !semaphoreMainThreadReady.tryAcquire( 1, 100 ) )
254 if ( feedback->isCanceled() )
256 semaphoreWorkerThreadReady.release();
266 semaphoreWorkerThreadReady.release();
269 QMetaObject::invokeMethod( qApp, func, Qt::BlockingQueuedConnection );