218 if ( QThread::currentThread() == qApp->thread() )
230 QSemaphore semaphoreMainThreadReady( 1 );
235 QSemaphore semaphoreWorkerThreadReady( 1 );
239 semaphoreMainThreadReady.acquire();
240 semaphoreWorkerThreadReady.acquire();
242 const std::function<void()> waitFunc = [&semaphoreMainThreadReady, &semaphoreWorkerThreadReady]()
247 semaphoreMainThreadReady.release();
250 semaphoreWorkerThreadReady.acquire();
253 QMetaObject::invokeMethod( qApp, waitFunc, Qt::QueuedConnection );
257 while ( !semaphoreMainThreadReady.tryAcquire( 1, 100 ) )
259 if ( feedback->isCanceled() )
261 semaphoreWorkerThreadReady.release();
271 semaphoreWorkerThreadReady.release();
274 QMetaObject::invokeMethod( qApp, func, Qt::BlockingQueuedConnection );