diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-12-23 01:00:12 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-12-23 01:00:12 +0100 |
commit | dca7fc3e3a0fe428ed97762a44c15e83607e6d28 (patch) | |
tree | 97d33fe2bec52dcbb6c991712bfe39411fbddb91 /src | |
parent | 03b084e6397b990c69028dc2bbf3226e7339c4a5 (diff) | |
parent | c57681bc376d1d912d23b044c48932fa8f7816d7 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I9c3d282c11a556e616c5e1ba1b51e88b741327f6
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/masm/yarr/YarrJIT.cpp | 2 | ||||
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4jsonobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontext.cpp | 17 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontext_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 12 | ||||
-rw-r--r-- | src/quick/handlers/qquickmultipointhandler.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquicklistview.cpp | 13 | ||||
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp | 10 |
10 files changed, 51 insertions, 19 deletions
diff --git a/src/3rdparty/masm/yarr/YarrJIT.cpp b/src/3rdparty/masm/yarr/YarrJIT.cpp index 73c919dd90..98e4ade51f 100644 --- a/src/3rdparty/masm/yarr/YarrJIT.cpp +++ b/src/3rdparty/masm/yarr/YarrJIT.cpp @@ -642,7 +642,7 @@ class YarrGenerator : private DefaultMacroAssembler { subPtr(Imm32(callFrameSizeInBytes), stackPointerRegister); if (callFrameSizeInBytes <= 128) { for (unsigned offset = 0; offset < callFrameSizeInBytes; offset += sizeof(intptr_t)) - storePtr(TrustedImmPtr(0), Address(regT0, -8 - offset)); + storePtr(TrustedImmPtr(0), Address(regT0, -8 - int(offset))); } else { Label zeroLoop = label(); subPtr(TrustedImm32(sizeof(intptr_t) * 2), regT0); diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index b8497937c1..e68a563a45 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -201,8 +201,8 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine) // first locals const quint32_le *localsIndices = compiledBlock->localsTable(); - for (quint32 i = 0; i < compiledBlock->nLocals; ++i) - ic = ic->addMember(engine->identifierTable->asPropertyKey(runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); + for (quint32 j = 0; j < compiledBlock->nLocals; ++j) + ic = ic->addMember(engine->identifierTable->asPropertyKey(runtimeStrings[localsIndices[j]]), Attr_NotConfigurable); runtimeBlocks[i] = ic->d(); } diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 0c5436a0d6..936c032fad 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -739,7 +739,7 @@ QString Stringify::Str(const QString &key, const Value &v) } if (const QV4::VariantObject *v = value->as<QV4::VariantObject>()) { - return v->d()->data().toString(); + return quote(v->d()->data().toString()); } o = value->asReturnedValue(); diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp index cbf5a6e259..3710cee162 100644 --- a/src/qml/qml/qqmlcontext.cpp +++ b/src/qml/qml/qqmlcontext.cpp @@ -640,7 +640,8 @@ void QQmlContextData::destroy() QQmlData *co = contextObjects; contextObjects = contextObjects->nextContextObject; - co->context = nullptr; + if (co->context == this) + co->context = nullptr; co->outerContext = nullptr; co->nextContextObject = nullptr; co->prevContextObject = nullptr; @@ -783,13 +784,17 @@ void QQmlContextData::refreshExpressions() } } -void QQmlContextData::addObject(QObject *o) +void QQmlContextData::addObject(QQmlData *data) { - QQmlData *data = QQmlData::get(o, true); - - Q_ASSERT(data->context == nullptr); + if (data->outerContext) { + if (data->nextContextObject) + data->nextContextObject->prevContextObject = data->prevContextObject; + if (data->prevContextObject) + *data->prevContextObject = data->nextContextObject; + else if (data->outerContext->contextObjects == data) + data->outerContext->contextObjects = data->nextContextObject; + } - data->context = this; data->outerContext = this; data->nextContextObject = contextObjects; diff --git a/src/qml/qml/qqmlcontext_p.h b/src/qml/qml/qqmlcontext_p.h index 290b7fc7ee..7e3cef8e1d 100644 --- a/src/qml/qml/qqmlcontext_p.h +++ b/src/qml/qml/qqmlcontext_p.h @@ -129,7 +129,7 @@ public: void setParent(QQmlContextData *, bool stronglyReferencedByParent = false); void refreshExpressions(); - void addObject(QObject *); + void addObject(QQmlData *data); QUrl resolvedUrl(const QUrl &); diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index c400e9239b..6db43a50eb 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1518,7 +1518,9 @@ void QQmlEngine::setContextForObject(QObject *object, QQmlContext *context) } QQmlContextData *contextData = QQmlContextData::get(context); - contextData->addObject(object); + Q_ASSERT(data->context == nullptr); + data->context = contextData; + contextData->addObject(data); } /*! @@ -1882,6 +1884,8 @@ void QQmlData::destroyed(QObject *object) nextContextObject->prevContextObject = prevContextObject; if (prevContextObject) *prevContextObject = nextContextObject; + else if (outerContext && outerContext->contextObjects == this) + outerContext->contextObjects = nextContextObject; QQmlAbstractBinding *binding = bindings; while (binding) { diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index c181d791f5..68e2c2c928 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -1230,13 +1230,15 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo QQmlContextData *c = ddata->context; while (c->linkedContext) c = c->linkedContext; c->linkedContext = context; - } else - context->addObject(instance); + } else { + ddata->context = context; + } ddata->ownContext = ddata->context; - } else if (!ddata->context) - context->addObject(instance); + } else if (!ddata->context) { + ddata->context = context; + } - ddata->outerContext = context; + context->addObject(ddata); if (parserStatus) { parserStatus->classBegin(); diff --git a/src/quick/handlers/qquickmultipointhandler.cpp b/src/quick/handlers/qquickmultipointhandler.cpp index 2f4e9d45e9..228c99bb12 100644 --- a/src/quick/handlers/qquickmultipointhandler.cpp +++ b/src/quick/handlers/qquickmultipointhandler.cpp @@ -309,6 +309,8 @@ void QQuickMultiPointHandler::acceptPoints(const QVector<QQuickEventPoint *> &po bool QQuickMultiPointHandler::grabPoints(QVector<QQuickEventPoint *> points) { + if (points.isEmpty()) + return false; bool allowed = true; for (QQuickEventPoint* point : points) { if (point->exclusiveGrabber() != this && !canGrab(point)) { diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 908801ce1c..62cbfcef2b 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -2456,7 +2456,18 @@ QString QQuickListView::currentSection() const The default value for the duration properties is -1, i.e. the highlight will take as much time as necessary to move at the set speed. - These properties have the same characteristics as a SmoothedAnimation. + These properties have the same characteristics as a SmoothedAnimation: + if both the velocity and duration are set, the animation will use + whichever gives the shorter duration. + + To set only one property, the other can be set to \c -1. For example, + if you only want to animate the duration and not velocity, use the + following code: + + \code + highlightMoveDuration: 1000 + highlightMoveVelocity: -1 + \endcode \sa highlightFollowsCurrentItem */ diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index ea6d376ce7..ced0acd9ab 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -480,6 +480,10 @@ QQuickPixmapReader::QQuickPixmapReader(QQmlEngine *eng) eventLoopQuitHack->moveToThread(this); connect(eventLoopQuitHack, SIGNAL(destroyed(QObject*)), SLOT(quit()), Qt::DirectConnection); start(QThread::LowestPriority); +#if !QT_CONFIG(thread) + // call nonblocking run ourself, as nothread qthread does not + run(); +#endif } QQuickPixmapReader::~QQuickPixmapReader() @@ -957,8 +961,11 @@ void QQuickPixmapReader::run() processJobs(); exec(); +#if QT_CONFIG(thread) + // nothread exec is empty and returns delete threadObject; threadObject = nullptr; +#endif } class QQuickPixmapKey @@ -1028,7 +1035,8 @@ QQuickPixmapStore::~QQuickPixmapStore() m_timerId = -2; // unreference all (leaked) pixmaps - for (auto *pixmap : qAsConst(m_cache)) { + const auto cache = m_cache; // NOTE: intentional copy (QTBUG-65077); releasing items from the cache modifies m_cache. + for (auto *pixmap : cache) { int currRefCount = pixmap->refCount; if (currRefCount) { #ifndef QT_NO_DEBUG |