2 * \file InGuiThread.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InGuiThread.h"
17 #include <QApplication>
23 IntoGuiThreadMover::IntoGuiThreadMover()
25 moveToThread(QApplication::instance()->thread());
26 connect(this, SIGNAL(triggerCall()), this, SLOT(doFunctionCall()),
27 Qt::QueuedConnection);
31 void IntoGuiThreadMover::callInGuiThread()
33 if (QThread::currentThread() == QApplication::instance()->thread()) {
34 synchronousFunctionCall();
37 connect(this, SIGNAL(called()), &loop, SLOT(quit()));
44 void IntoGuiThreadMover::doFunctionCall()
46 synchronousFunctionCall();
51 } // namespace frontend