From ceb0e377b11c6d1b5cf3961901c8bb72d2020d91 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 30 Aug 2018 18:02:45 +1000 Subject: nothread: add exit function to QThread stub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows QtDeclarative examples to build. Change-Id: Icd20304f76f8ba15c94eaf01b9fcd7b151b16146 Reviewed-by: Morten Johan Sørvig --- src/corelib/thread/qthread.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/corelib/thread') diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 05bc064005..b023ae9ed2 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -818,6 +818,16 @@ void QThread::quit() } +void QThread::exit(int returnCode) +{ + Q_D(QThread); + d->data->quitNow = true; + for (int i = 0; i < d->data->eventLoops.size(); ++i) { + QEventLoop *eventLoop = d->data->eventLoops.at(i); + eventLoop->exit(returnCode); + } +} + bool QThread::wait(unsigned long time) { Q_UNUSED(time); -- cgit v1.2.3