291 if ( QThread::currentThread() == qApp->thread() )
303 QSemaphore semaphoreMainThreadReady( 1 );
308 QSemaphore semaphoreWorkerThreadReady( 1 );
312 semaphoreMainThreadReady.acquire();
313 semaphoreWorkerThreadReady.acquire();
315 const std::function<void()> waitFunc = [&semaphoreMainThreadReady, &semaphoreWorkerThreadReady]() {
319 semaphoreMainThreadReady.release();
322 semaphoreWorkerThreadReady.acquire();
325 QMetaObject::invokeMethod( qApp, waitFunc, Qt::QueuedConnection );
329 while ( !semaphoreMainThreadReady.tryAcquire( 1, 100 ) )
331 if ( feedback->isCanceled() )
333 semaphoreWorkerThreadReady.release();
343 semaphoreWorkerThreadReady.release();
346 QMetaObject::invokeMethod( qApp, func, Qt::BlockingQueuedConnection );