diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 14:51:40 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 17:24:39 +0200 |
commit | 13374ceb165c44658aa97890c37b206859c9a31c (patch) | |
tree | 562362b196a459ee3449a5a1e60e5216a9dd6984 /src/qml/qml/ftw/qqmlthread.cpp | |
parent | ae47deba4c943c496412530a8d2a5a688ae12038 (diff) | |
parent | b5d18be5a03406d0aac83856dd41e1525fd14a28 (diff) |
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I2963c1209316fb6755f572969f368970450d7991
Diffstat (limited to 'src/qml/qml/ftw/qqmlthread.cpp')
-rw-r--r-- | src/qml/qml/ftw/qqmlthread.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp index 2ef1dc7e93..e961ed3d0d 100644 --- a/src/qml/qml/ftw/qqmlthread.cpp +++ b/src/qml/qml/ftw/qqmlthread.cpp @@ -104,14 +104,18 @@ QQmlThreadPrivate::MainObject::MainObject(QQmlThreadPrivate *p) // Trigger mainEvent in main thread. Must be called from thread. void QQmlThreadPrivate::triggerMainEvent() { +#if QT_CONFIG(thread) Q_ASSERT(q->isThisThread()); +#endif QCoreApplication::postEvent(&m_mainObject, new QEvent(QEvent::User)); } // Trigger even in thread. Must be called from main thread. void QQmlThreadPrivate::triggerThreadEvent() { +#if QT_CONFIG(thread) Q_ASSERT(!q->isThisThread()); +#endif QCoreApplication::postEvent(this, new QEvent(QEvent::User)); } @@ -353,6 +357,12 @@ void QQmlThread::internalCallMethodInThread(Message *message) void QQmlThread::internalCallMethodInMain(Message *message) { +#if !QT_CONFIG(thread) + message->call(this); + delete message; + return; +#endif + Q_ASSERT(isThisThread()); d->lock(); @@ -397,7 +407,9 @@ void QQmlThread::internalPostMethodToThread(Message *message) void QQmlThread::internalPostMethodToMain(Message *message) { +#if QT_CONFIG(thread) Q_ASSERT(isThisThread()); +#endif d->lock(); bool wasEmpty = d->mainList.isEmpty(); d->mainList.append(message); @@ -408,7 +420,9 @@ void QQmlThread::internalPostMethodToMain(Message *message) void QQmlThread::waitForNextMessage() { +#if QT_CONFIG(thread) Q_ASSERT(!isThisThread()); +#endif d->lock(); Q_ASSERT(d->m_mainThreadWaiting == false); |