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.
11 #include "InGuiThread.h"
15 #include <QApplication>
21 IntoGuiThreadMover::IntoGuiThreadMover()
23 moveToThread(QApplication::instance()->thread());
24 connect(this, SIGNAL(triggerCall()), this, SLOT(doFunctionCall()),
25 Qt::QueuedConnection);
29 void IntoGuiThreadMover::callInGuiThread()
31 if (QThread::currentThread() == QApplication::instance()->thread()) {
32 synchronousFunctionCall();
35 connect(this, SIGNAL(called()), &loop, SLOT(quit()));
42 void IntoGuiThreadMover::doFunctionCall()
44 synchronousFunctionCall();
49 } // namespace frontend