diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2018-05-08 10:41:46 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2018-05-14 08:22:47 +0000 |
commit | 7e22af4bfdfd736e624321924eaae0e0d36940c7 (patch) | |
tree | b4f46f0ee995b2751022c4ddedb2822e106214c0 /src/quick/items | |
parent | 809d305f938177cfb8488dc7fbfc28bc8eef9d20 (diff) |
webassembly: fix for crash and assert on no thread and wasm builds
This change requires moveToThread change in qtbase
Change-Id: Idf35af4b416f577dabb91f749929dbfe5c88a0f0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickflickable.cpp | 3 | ||||
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 15 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index cefe2de883..9c775f7e93 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -493,9 +493,6 @@ void QQuickFlickablePrivate::fixup(AxisData &data, qreal minExtent, qreal maxExt data.inOvershoot = false; fixupMode = Normal; data.vTime = timeline.time(); -#ifdef Q_OS_HTML5 - QCoreApplication::processEvents(QEventLoop::EventLoopExec); -#endif } static bool fuzzyLessThanOrEqualTo(qreal a, qreal b) diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index f2e055e874..bc8163d53c 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -331,9 +331,18 @@ void QQuickItemView::setModel(const QVariant &m) if (d->model) { d->bufferMode = QQuickItemViewPrivate::BufferBefore | QQuickItemViewPrivate::BufferAfter; - connect(d->model, SIGNAL(createdItem(int,QObject*)), this, SLOT(createdItem(int,QObject*))); - connect(d->model, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*))); - connect(d->model, SIGNAL(destroyingItem(QObject*)), this, SLOT(destroyingItem(QObject*))); + + Qt::ConnectionType type = Qt::AutoConnection; +#ifdef QT_NO_THREAD + // This is needed because the thread affinity of the receiving object + // will be different from the executing thread, when threads are not + // supported + type = Qt::DirectConnection; +#endif + QObject::connect(d->model, SIGNAL(createdItem(int,QObject*)), this, SLOT(createdItem(int,QObject*)), type); + QObject::connect(d->model, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*)), type); + QObject::connect(d->model, SIGNAL(destroyingItem(QObject*)), this, SLOT(destroyingItem(QObject*)), type); + if (isComponentComplete()) { d->updateSectionCriteria(); d->refill(); |