diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2019-01-08 08:18:11 +0200 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2019-01-08 08:18:11 +0200 |
commit | c2c012f79438d207cc95237c90b692121acc4876 (patch) | |
tree | 39064e5a58161a7edb4e0c63f2d43e386d1f4059 /src | |
parent | 5208b2a671010b11b78312f9c4fe3c3098d253b4 (diff) | |
parent | 5ed082ea4ce3580134a9a0c83e6fdb81a6231c8e (diff) |
Merge 5.12 into 5.12.1
Change-Id: Ic746fbce93430867e2eda4bc7155d34e20a4aa2b
Diffstat (limited to 'src')
39 files changed, 198 insertions, 62 deletions
diff --git a/src/3rdparty/masm/yarr/YarrJIT.cpp b/src/3rdparty/masm/yarr/YarrJIT.cpp index 9a9ab581e8..0655bb0a70 100644 --- a/src/3rdparty/masm/yarr/YarrJIT.cpp +++ b/src/3rdparty/masm/yarr/YarrJIT.cpp @@ -640,7 +640,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/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp b/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp index e45b79706b..b5f6b39c60 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp +++ b/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.cpp @@ -174,7 +174,7 @@ void QSGOpenVGRectangleNode::render() } -QSGOpenVGImageNode::QSGOpenVGImageNode() +QSGOpenVGImageNode::QSGOpenVGImageNode() : m_texture(nullptr), m_owns(false) { // Set Dummy material and geometry to avoid asserts setMaterial((QSGMaterial*)1); @@ -184,9 +184,8 @@ QSGOpenVGImageNode::QSGOpenVGImageNode() QSGOpenVGImageNode::~QSGOpenVGImageNode() { - if (m_owns) { - m_texture->deleteLater(); - } + if (m_owns) + delete m_texture; } void QSGOpenVGImageNode::setRect(const QRectF &rect) @@ -212,6 +211,8 @@ QRectF QSGOpenVGImageNode::sourceRect() const void QSGOpenVGImageNode::setTexture(QSGTexture *texture) { + if (m_owns) + delete m_texture; m_texture = texture; markDirty(DirtyMaterial); } @@ -321,7 +322,7 @@ void QSGOpenVGImageNode::render() } -QSGOpenVGNinePatchNode::QSGOpenVGNinePatchNode() +QSGOpenVGNinePatchNode::QSGOpenVGNinePatchNode() : m_texture(nullptr) { // Set Dummy material and geometry to avoid asserts setMaterial((QSGMaterial*)1); @@ -329,8 +330,14 @@ QSGOpenVGNinePatchNode::QSGOpenVGNinePatchNode() } +QSGOpenVGNinePatchNode::~QSGOpenVGNinePatchNode() +{ + delete m_texture; +} + void QSGOpenVGNinePatchNode::setTexture(QSGTexture *texture) { + delete m_texture; m_texture = texture; markDirty(DirtyMaterial); } diff --git a/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h b/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h index 8e12c27824..e1cd3063a1 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h +++ b/src/plugins/scenegraph/openvg/qsgopenvgpublicnodes.h @@ -118,6 +118,7 @@ class QSGOpenVGNinePatchNode : public QSGNinePatchNode, public QSGOpenVGRenderab { public: QSGOpenVGNinePatchNode(); + ~QSGOpenVGNinePatchNode(); void setTexture(QSGTexture *texture) override; void setBounds(const QRectF &bounds) override; diff --git a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp index 9493920100..c41dfd7400 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp +++ b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp @@ -43,6 +43,7 @@ #include <QtCore/QCoreApplication> #include <QtCore/QElapsedTimer> +#include <private/qquickanimatorcontroller_p.h> #include <private/qquickwindow_p.h> #include <private/qquickprofiler_p.h> @@ -94,6 +95,8 @@ void QSGOpenVGRenderLoop::windowDestroyed(QQuickWindow *window) } else if (vg && window == vg->window()) { vg->doneCurrent(); } + + delete d->animationController; } void QSGOpenVGRenderLoop::exposureChanged(QQuickWindow *window) diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 9021fd0284..2421e8c1ea 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1835,8 +1835,9 @@ JSCodeGen::JSCodeGen(const QString &sourceCode, QV4::Compiler::JSUnitGenerator * , _scopeObject(nullptr) , _qmlContextSlot(-1) , _importedScriptsSlot(-1) - , m_globalNames(globalNames) { + m_globalNames = globalNames; + _module = jsModule; _fileNameIsUrl = true; } @@ -2306,15 +2307,10 @@ QV4::Compiler::Codegen::Reference JSCodeGen::fallbackNameLookup(const QString &n return Reference::fromQmlContextObject(base, data->coreIndex(), data->notifyIndex(), capturePolicy); } } - - Reference r = Reference::fromName(this, name); - if (m_globalNames.contains(name)) - r.global = true; - return r; #else Q_UNUSED(name) - return Reference(); #endif // V4_BOOTSTRAP + return Reference(); } #ifndef V4_BOOTSTRAP diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h index d1e2b17bb7..3dde929cc4 100644 --- a/src/qml/compiler/qqmlirbuilder_p.h +++ b/src/qml/compiler/qqmlirbuilder_p.h @@ -640,7 +640,6 @@ private: QQmlPropertyCache *_scopeObject; int _qmlContextSlot; int _importedScriptsSlot; - QSet<QString> m_globalNames; }; struct Q_QML_PRIVATE_EXPORT IRLoader { diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 8ec730a33d..f570af4819 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -102,6 +102,62 @@ Codegen::Codegen(QV4::Compiler::JSUnitGenerator *jsUnitGenerator, bool strict) jsUnitGenerator->codeGeneratorName = QStringLiteral("moth"); } +const char *globalNames[] = { + "isNaN", + "parseFloat", + "String", + "EvalError", + "URIError", + "Math", + "encodeURIComponent", + "RangeError", + "eval", + "isFinite", + "ReferenceError", + "Infinity", + "Function", + "RegExp", + "Number", + "parseInt", + "Object", + "decodeURI", + "TypeError", + "Boolean", + "encodeURI", + "NaN", + "Error", + "decodeURIComponent", + "Date", + "Array", + "Symbol", + "escape", + "unescape", + "SyntaxError", + "undefined", + "JSON", + "ArrayBuffer", + "SharedArrayBuffer", + "DataView", + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", + "Int16Array", + "Uint16Array", + "Int32Array", + "Uint32Array", + "Float32Array", + "Float64Array", + "WeakSet", + "Set", + "WeakMap", + "Map", + "Reflect", + "Proxy", + "Atomics", + "Promise", + nullptr +}; + void Codegen::generateFromProgram(const QString &fileName, const QString &finalUrl, const QString &sourceCode, @@ -118,6 +174,18 @@ void Codegen::generateFromProgram(const QString &fileName, _module->fileName = fileName; _module->finalUrl = finalUrl; + if (contextType == ContextType::ScriptImportedByQML) { + // the global object is frozen, so we know that members of it are + // pointing to the global object. This is important so that references + // to Math etc. do not go through the expensive path in the context wrapper + // that tries to see whether we have a matching type + // + // Since this can be called from the loader thread we can't get the list + // directly from the engine, so let's hardcode the most important ones here + for (const char **g = globalNames; *g != nullptr; ++g) + m_globalNames << QString::fromLatin1(*g); + } + ScanFunctions scan(this, sourceCode, contextType); scan(node); @@ -2336,6 +2404,8 @@ Codegen::Reference Codegen::referenceForName(const QString &name, bool isLhs, co Reference r = Reference::fromName(this, name); r.global = useFastLookups && (resolved.type == Context::ResolvedName::Global); + if (!r.global && m_globalNames.contains(name)) + r.global = true; return r; } diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h index 289728f505..3f96afc7c2 100644 --- a/src/qml/compiler/qv4codegen_p.h +++ b/src/qml/compiler/qv4codegen_p.h @@ -708,6 +708,11 @@ public: return *_returnLabel; } + void setGlobalNames(const QSet<QString>& globalNames) { + m_globalNames = globalNames; + } + + protected: friend class ScanFunctions; friend struct ControlFlow; @@ -730,6 +735,7 @@ protected: bool inFormalParameterList = false; bool functionEndsWithReturn = false; bool _tailCallsAreAllowed = true; + QSet<QString> m_globalNames; ControlFlow *controlFlow = nullptr; 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/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf index 40acc7c13f..ba4155c08b 100644 --- a/src/qml/doc/qtqml.qdocconf +++ b/src/qml/doc/qtqml.qdocconf @@ -33,7 +33,7 @@ qhp.QtQml.subprojects.qmltypes.sortPages = true tagfile = ../../../doc/qtqml/qtqml.tags -depends += qtcore qtgui qtquick qtdoc qtlinguist qmake qtscript qtwidgets +depends += qtcore qtgui qtquick qtdoc qtlinguist qmake qtscript qtwidgets qtxmlpatterns qtquickcontrols headerdirs += .. \ ../../imports/models diff --git a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc index f0ad2b7767..b643f18154 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/signals.qdoc @@ -52,8 +52,8 @@ object, the object definition should declare a signal handler named letter capitalized. The signal handler should contain the JavaScript code to be executed when the signal handler is invoked. -For example, the \l [QtQuick.Controls2]{Button} type from the -\l{Qt Quick Controls 2}{Qt Quick Controls} module has a \c clicked signal, which +For example, the \l [QtQuickControls]{Button} type from the +\l{Qt Quick Controls} module has a \c clicked signal, which is emitted whenever the button is clicked. In this case, the signal handler for receiving this signal should be \c onClicked. In the example below, whenever the button is clicked, the \c onClicked handler is invoked, applying a random diff --git a/src/qml/jsruntime/qv4alloca_p.h b/src/qml/jsruntime/qv4alloca_p.h index 1e9f83a90e..65c3e4d65a 100644 --- a/src/qml/jsruntime/qv4alloca_p.h +++ b/src/qml/jsruntime/qv4alloca_p.h @@ -89,7 +89,7 @@ public: Qt_AllocaWrapper() { m_data = 0; } ~Qt_AllocaWrapper() { free(m_data); } void *data() { return m_data; } - void allocate(int size) { m_data = malloc(size); } + void allocate(int size) { m_data = malloc(size); memset(m_data, 0, size); } private: void *m_data; }; 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/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index f80db86be5..7bbef3335e 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -241,6 +241,7 @@ Script *Script::createFromFileOrCache(ExecutionEngine *engine, QmlContext *qmlCo QmlIR::Document::removeScriptPragmas(sourceCode); auto result = new QV4::Script(engine, qmlContext, /*parseAsBinding*/false, sourceCode, originalUrl.toString()); + result->contextType = QV4::Compiler::ContextType::ScriptImportedByQML; result->parse(); return result; } diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp index e5b8894fb1..c53b13f64d 100644 --- a/src/qml/parser/qqmljslexer.cpp +++ b/src/qml/parser/qqmljslexer.cpp @@ -884,7 +884,7 @@ int Lexer::scanString(ScanStringMode mode) scanChar(); while (_codePtr <= _endPtr) { - if (_char == mode) { + if (_char == quote) { scanChar(); if (_engine) { 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/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 8a0d60a092..57bbf7465d 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -350,7 +350,7 @@ void QQmlDelegateModel::componentComplete() {QAbstractItemModel} subclass or a simple list. Models can also be created directly in QML, using a \l{ListModel} or - \l{XmlListModel}. + \l{QtQuick.XmlListModel::XmlListModel}{XmlListModel}. \sa {qml-data-models}{Data Models} */ diff --git a/src/qmltest/doc/src/qtquicktest-index.qdoc b/src/qmltest/doc/src/qtquicktest-index.qdoc index 15ea33d06a..48b41d4f0a 100644 --- a/src/qmltest/doc/src/qtquicktest-index.qdoc +++ b/src/qmltest/doc/src/qtquicktest-index.qdoc @@ -151,17 +151,18 @@ \li Name \li Purpose \row - \row \li void applicationAvailable() \li Called right after the QApplication object was instantiated. Use this function to setup everything that is not related to QML directly. + \row \li void qmlEngineAvailable(QQmlEngine*) \li Called when the QML engine is available. Any \l {QQmlEngine::addImportPath}{import paths}, \l {QQmlEngine::addPluginPath}{plugin paths}, and \l {QQmlFileSelector::setExtraSelectors}{extra file selectors} will have been set on the engine by this point. + \row \li void cleanupTestCase() \li Called right after the test execution has finished. Use this function to clean up before everything will start to be destructed. diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf index 94bc80bf93..b1268097fc 100644 --- a/src/quick/doc/qtquick.qdocconf +++ b/src/quick/doc/qtquick.qdocconf @@ -37,7 +37,7 @@ qhp.QtQuick.subprojects.examples.selectors = fake:example tagfile = ../../../doc/qtquick/qtquick.tags -depends += qtcore qtqml qtqmltest qtgui qtlinguist qtquickcontrols qtquickcontrols2 qtdoc qtquickdialogs qtsensors qtwidgets qmake qtmultimedia qtgraphicaleffects qtsql +depends += qtcore qtqml qtqmltest qtgui qtlinguist qtquickcontrols1 qtquickcontrols qtdoc qtquickdialogs qtsensors qtwidgets qmake qtmultimedia qtgraphicaleffects qtsql qtxmlpatterns headerdirs += ..\ ../../quickwidgets diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc index a849a30b4e..e4d837112f 100644 --- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc +++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc @@ -331,9 +331,7 @@ signal after saving the changes. Unlike the C++ item views such as QListView or QTableView, the \c setData() method must be explicitly invoked from QML delegates whenever appropriate. This is done -by simply assigning a new value to the corresponding model property. For example, -on the \l[QML]{TextField::}{editingFinished}() or \l[QML]{TextField::}{accepted}() -signal of \l[QtQuickControls]{TextField}. +by simply assigning a new value to the corresponding model property. \qml ListView { diff --git a/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc b/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc index 0c6aaecf42..04dbf1cf20 100644 --- a/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc +++ b/src/quick/doc/src/concepts/modelviewsdata/modelview.qdoc @@ -226,7 +226,7 @@ To visualize data, bind the view's \c model property to a model and the \section2 XML Model XmlListModel allows construction of a model from an XML data source. The roles - are specified via the \l XmlRole type. The type needs to be imported. + are specified via the \l [QML]{XmlRole} type. The type needs to be imported. \code import QtQuick.XmlListModel 2.0 diff --git a/src/quick/doc/src/examples.qdoc b/src/quick/doc/src/examples.qdoc index 39fc7f27eb..77475e9812 100644 --- a/src/quick/doc/src/examples.qdoc +++ b/src/quick/doc/src/examples.qdoc @@ -77,9 +77,7 @@ steps such as use cases and introductory material. For more information about Qt \b{Development Environment} \list \li \l{Qt Creator: Creating Qt Quick Projects}{Creating Qt Quick Projects} - \li \l{Qt Creator: Using Qt Quick Designer}{Using Qt Quick Designer} \li \l{Qt Creator: Creating Components}{Creating Components} - \li \l{Qt Creator: Creating Screens}{Creating Screens} \li \l{Qt Creator: Exporting Designs from Graphics Software}{Exporting Designs from Graphics Software} \li \l{Qt Creator: Using QML Modules with Plugins}{Using QML Modules with Plugins} \endlist diff --git a/src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc b/src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc index 5f00abc193..0669ec06c8 100644 --- a/src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc +++ b/src/quick/doc/src/guidelines/qtquick-toolsnutilities.qdoc @@ -108,6 +108,5 @@ integrating 3rd party tools such as QmlLive and GammaRay. \section2 Related Information \list \li \l{Qt Creator Manual} -\li \l{Qt Creator: Integrating 3rd Party Tools} \endlist */ diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index ddf90f88d9..04682c9f33 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -49,7 +49,7 @@ information about the concepts which are central to \c QtQuick. Qt Quick includes several submodules which contain additional types. \list - \li \l{Qt Quick XmlListModel QML Types}{XML List Model} - contains types + \li \l{Qt Quick XmlListModel QML Types}{Xml List Model} - contains types for creating models from XML data \li \l{Qt Quick Local Storage QML Types}{Local Storage} - a submodule containing a JavaScript interface for an SQLite database diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp index aa66c16007..48f0599284 100644 --- a/src/quick/handlers/qquickdraghandler.cpp +++ b/src/quick/handlers/qquickdraghandler.cpp @@ -82,7 +82,7 @@ Q_LOGGING_CATEGORY(lcDragHandler, "qt.quick.handler.drag") and thus can be used to adjust some other feature independently of the usual pinch behavior: for example adjust a tilt transformation, or adjust some other numeric value, if the \c target is set to null. But if the - \l target is an Item, \l centroid is the point at which the drag begins and + \c target is an Item, \c centroid is the point at which the drag begins and to which the \c target will be moved (subject to constraints). At this time, drag-and-drop is not yet supported. diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp index 6a106b5464..de21537f27 100644 --- a/src/quick/handlers/qquickhandlerpoint.cpp +++ b/src/quick/handlers/qquickhandlerpoint.cpp @@ -282,8 +282,6 @@ void QQuickHandlerPoint::reset(const QVector<QQuickHandlerPoint> &points) This property holds the keyboard modifiers that were pressed at the time the event occurred. - - \sa MouseArea::modifiers */ /*! 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/handlers/qquickpointhandler.cpp b/src/quick/handlers/qquickpointhandler.cpp index 3bc1c06a1a..6d6ba07f5c 100644 --- a/src/quick/handlers/qquickpointhandler.cpp +++ b/src/quick/handlers/qquickpointhandler.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE occurs within the bounds of the \l {PointerHandler::parent}, and no sibling PointHandler within the same \l {PointerHandler::parent} has yet acquired a passive grab on that point, and if the other - constraints such as \l {SinglePointHandler::acceptedButtons}, + constraints such as \l[QML]{SinglePointHandler::acceptedButtons}, \l {PointerDeviceHandler::acceptedDevices} etc. are satisfied, it's eligible, and the PointHandler then acquires a passive grab. In this way, the \l {PointerHandler::parent} acts like an exclusive diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index bae76ddd94..f24b2bfd7e 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -107,6 +107,10 @@ static bool dragOverThreshold(const QQuickEventPoint *point) bool QQuickTapHandler::wantsEventPoint(QQuickEventPoint *point) { + if (!point->pointerEvent()->asPointerMouseEvent() && + !point->pointerEvent()->asPointerTouchEvent() && + !point->pointerEvent()->asPointerTabletEvent() ) + return false; // If the user has not violated any constraint, it could be a tap. // Otherwise we want to give up the grab so that a competing handler // (e.g. DragHandler) gets a chance to take over. 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/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 4d4540bc36..dd7fbccff5 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -2082,6 +2082,8 @@ void QQuickText::resetMaximumLineCount() \code <b></b> - bold + <del></del> - strike out (removed content) + <s></s> - strike out (no longer accurate or no longer relevant content) <strong></strong> - bold <i></i> - italic <br> - new line diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 83a1268d1d..dd5960e925 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2246,13 +2246,14 @@ QQuickPointerEvent *QQuickWindowPrivate::queryPointerEventInstance(QQuickPointer { // Search for a matching reusable event object. for (QQuickPointerEvent *e : pointerEventInstances) { - // If device can generate native gestures (e.g. a trackpad), there might be two QQuickPointerEvents: - // QQuickPointerNativeGestureEvent and QQuickPointerTouchEvent. Use eventType to disambiguate. + // If device can generate native gestures (e.g. a trackpad), there might be multiple QQuickPointerEvents: + // QQuickPointerNativeGestureEvent, QQuickPointerScrollEvent, and QQuickPointerTouchEvent. + // Use eventType to disambiguate. #if QT_CONFIG(gestures) - if (eventType == QEvent::NativeGesture && !qobject_cast<QQuickPointerNativeGestureEvent*>(e)) + if ((eventType == QEvent::NativeGesture) != bool(e->asPointerNativeGestureEvent())) continue; #endif - if (eventType == QEvent::Wheel && !qobject_cast<QQuickPointerScrollEvent*>(e)) + if ((eventType == QEvent::Wheel) != bool(e->asPointerScrollEvent())) continue; // Otherwise we assume there's only one event type per device. // More disambiguation tests might need to be added above if that changes later. diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp index bd0698be6c..20286a03d5 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp @@ -156,10 +156,11 @@ void QSGSoftwareNinePatchNode::setTexture(QSGTexture *texture) QSGSoftwarePixmapTexture *pt = qobject_cast<QSGSoftwarePixmapTexture*>(texture); if (!pt) { qWarning() << "Image used with invalid texture format."; - return; + } else { + m_pixmap = pt->pixmap(); + markDirty(DirtyMaterial); } - m_pixmap = pt->pixmap(); - markDirty(DirtyMaterial); + delete texture; } void QSGSoftwareNinePatchNode::setBounds(const QRectF &bounds) diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp index b400473128..f5a41410ee 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp @@ -45,6 +45,7 @@ #include <private/qquickwindow_p.h> #include <QElapsedTimer> +#include <private/qquickanimatorcontroller_p.h> #include <private/qquickprofiler_p.h> #include <private/qsgsoftwarerenderer_p.h> #include <qpa/qplatformbackingstore.h> @@ -98,6 +99,8 @@ void QSGSoftwareRenderLoop::windowDestroyed(QQuickWindow *window) if (m_windows.size() == 0) { rc->invalidate(); } + + delete d->animationController; } void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window, bool isNewExpose) diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 0dd2a88ca1..dc8bed8125 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -471,6 +471,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() @@ -948,8 +952,11 @@ void QQuickPixmapReader::run() processJobs(); exec(); +#if QT_CONFIG(thread) + // nothread exec is empty and returns delete threadObject; threadObject = nullptr; +#endif } class QQuickPixmapKey @@ -1019,7 +1026,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 diff --git a/src/quick/util/qquickstyledtext.cpp b/src/quick/util/qquickstyledtext.cpp index 762d49f2d2..5e1aaf121e 100644 --- a/src/quick/util/qquickstyledtext.cpp +++ b/src/quick/util/qquickstyledtext.cpp @@ -50,6 +50,8 @@ QQuickStyledText supports few tags: <b></b> - bold + <del></del> - strike out (removed content) + <s></s> - strike out (no longer accurate or no longer relevant content) <strong></strong> - bold <i></i> - italic <br> - new line @@ -379,8 +381,16 @@ bool QQuickStyledTextPrivate::parseTag(const QChar *&ch, const QString &textIn, format.setFontWeight(QFont::Bold); return true; } - } else if (tag == QLatin1String("strong")) { - format.setFontWeight(QFont::Bold); + } else if (char0 == QLatin1Char('s')) { + if (tagLength == 1) { + format.setFontStrikeOut(true); + return true; + } else if (tag == QLatin1String("strong")) { + format.setFontWeight(QFont::Bold); + return true; + } + } else if (tag == QLatin1String("del")) { + format.setFontStrikeOut(true); return true; } else if (tag == QLatin1String("ol")) { List listItem; @@ -511,7 +521,13 @@ bool QQuickStyledTextPrivate::parseCloseTag(const QChar *&ch, const QString &tex return true; } else if (tag == QLatin1String("font")) { return true; - } else if (tag == QLatin1String("strong")) { + } else if (char0 == QLatin1Char('s')) { + if (tagLength == 1) { + return true; + } else if (tag == QLatin1String("strong")) { + return true; + } + } else if (tag == QLatin1String("del")) { return true; } else if (tag == QLatin1String("ol")) { if (!listStack.isEmpty()) { |