214 if ( QThread::currentThread() == qApp->thread() )
226 QSemaphore semaphoreMainThreadReady( 1 );
231 QSemaphore semaphoreWorkerThreadReady( 1 );
235 semaphoreMainThreadReady.acquire();
236 semaphoreWorkerThreadReady.acquire();
238 const std::function<void()> waitFunc = [&semaphoreMainThreadReady, &semaphoreWorkerThreadReady]()
243 semaphoreMainThreadReady.release();
246 semaphoreWorkerThreadReady.acquire();
249 QMetaObject::invokeMethod( qApp, waitFunc, Qt::QueuedConnection );
253 while ( !semaphoreMainThreadReady.tryAcquire( 1, 100 ) )
255 if ( feedback->isCanceled() )
257 semaphoreWorkerThreadReady.release();
267 semaphoreWorkerThreadReady.release();
270 QMetaObject::invokeMethod( qApp, func, Qt::BlockingQueuedConnection );