diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-14 01:01:06 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-14 11:24:11 +0100 |
commit | 8a22c92b55b5d015e372fe5be0633c3935af4218 (patch) | |
tree | 02ad52cf1e7c3ed35b10156dd250d3cc7f6b7068 /src/qml/qml/qqmlengine.cpp | |
parent | 3ca659657ccaf0d850e661c9312e0f98e153c9ff (diff) | |
parent | 3dc5b937c4e9acf83ee54e870390c22f341c29c8 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
src/imports/folderlistmodel/plugin.cpp
src/imports/layouts/plugin.cpp
src/imports/localstorage/plugin.cpp
src/imports/models/plugin.cpp
src/imports/particles/plugin.cpp
src/imports/qtqml/plugin.cpp
src/imports/qtquick2/plugin.cpp
src/imports/shapes/plugin.cpp
src/imports/statemachine/plugin.cpp
src/imports/testlib/main.cpp
src/imports/wavefrontmesh/plugin.cpp
src/imports/window/plugin.cpp
src/imports/workerscript/plugin.cpp
src/qml/jsruntime/qv4sequenceobject.cpp
src/qml/qml/qqmlengine.cpp
src/qmlmodels/qqmlmodelsmodule.cpp
src/qmlmodels/qqmlmodelsmodule_p.h
src/qmlworkerscript/qqmlworkerscriptmodule.cpp
src/qmlworkerscript/qqmlworkerscriptmodule_p.h
src/quick/items/qquickitemsmodule.cpp
Change-Id: I5f1fbc3d00e8f583d2c89afc5389de84d68633a7
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 51a5cc1db4..84f56eb051 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -197,25 +197,6 @@ int qmlRegisterUncreatableMetaObject(const QMetaObject &staticMetaObject, bool QQmlEnginePrivate::qml_debugging_enabled = false; bool QQmlEnginePrivate::s_designerMode = false; -void QQmlEnginePrivate::defineModule() -{ - const char uri[] = "QtQml"; - - qmlRegisterTypesAndRevisions< - QObjectForeign, -#if QT_CONFIG(qml_animation) - QQmlTimer, -#endif -#if QT_CONFIG(qml_locale) - QQmlLocale, -#endif - QQmlComponent, - QQmlBind, - QQmlConnections, - QQmlLoggingCategory - >(uri, 2); -} - bool QQmlEnginePrivate::designerMode() { return s_designerMode; @@ -783,10 +764,12 @@ void QQmlData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int in // QQmlEngine to emit signals from a different thread. These signals are then automatically // marshalled back onto the QObject's thread and handled by QML from there. This is tested // by the qqmlecmascript::threadSignal() autotest. - if (ddata->notifyList && - QThread::currentThreadId() != QObjectPrivate::get(object)->getThreadData()->threadId.loadRelaxed()) { + if (!ddata->notifyList) + return; - if (!QObjectPrivate::get(object)->getThreadData()->thread.loadAcquire()) + auto objectThreadData = QObjectPrivate::get(object)->threadData.loadRelaxed(); + if (QThread::currentThreadId() != objectThreadData->threadId.loadRelaxed()) { + if (!objectThreadData->thread.loadAcquire()) return; QMetaMethod m = QMetaObjectPrivate::signal(object->metaObject(), index); @@ -818,7 +801,7 @@ void QQmlData::signalEmitted(QAbstractDeclarativeData *, QObject *object, int in QQmlThreadNotifierProxyObject *mpo = new QQmlThreadNotifierProxyObject; mpo->target = object; - mpo->moveToThread(QObjectPrivate::get(object)->getThreadData()->thread.loadAcquire()); + mpo->moveToThread(objectThreadData->thread.loadAcquire()); QCoreApplication::postEvent(mpo, ev.take()); } else { @@ -1013,7 +996,7 @@ QQmlEngine::~QQmlEngine() // we do this here and not in the private dtor since otherwise a crash can // occur (if we are the QObject parent of the QObject singleton instance) // XXX TODO: performance -- store list of singleton types separately? - QList<QQmlType> singletonTypes = QQmlMetaType::qmlSingletonTypes(); + const QList<QQmlType> singletonTypes = QQmlMetaType::qmlSingletonTypes(); for (const QQmlType &currType : singletonTypes) d->destroySingletonInstance(currType); |