diff options
Diffstat (limited to 'src')
30 files changed, 576 insertions, 44 deletions
diff --git a/src/3rdparty/masm/yarr/YarrJIT.cpp b/src/3rdparty/masm/yarr/YarrJIT.cpp index e4f2d97759..71123b7be7 100644 --- a/src/3rdparty/masm/yarr/YarrJIT.cpp +++ b/src/3rdparty/masm/yarr/YarrJIT.cpp @@ -468,16 +468,16 @@ class YarrGenerator : private DefaultMacroAssembler { // The operation, as a YarrOpCode, and also a reference to the PatternTerm. YarrOpCode m_op; - PatternTerm* m_term; + PatternTerm* m_term = nullptr; // For alternatives, this holds the PatternAlternative and doubly linked // references to this alternative's siblings. In the case of the // OpBodyAlternativeEnd node at the end of a section of repeating nodes, // m_nextOp will reference the OpBodyAlternativeBegin node of the first // repeating alternative. - PatternAlternative* m_alternative; - size_t m_previousOp; - size_t m_nextOp; + PatternAlternative* m_alternative = nullptr; + size_t m_previousOp = 0; + size_t m_nextOp = 0; // Used to record a set of Jumps out of the generated code, typically // used for jumps out to backtracking code, and a single reentry back diff --git a/src/3rdparty/masm/yarr/YarrParser.h b/src/3rdparty/masm/yarr/YarrParser.h index 8c5d71b5fe..13ffd3a1d6 100644 --- a/src/3rdparty/masm/yarr/YarrParser.h +++ b/src/3rdparty/masm/yarr/YarrParser.h @@ -118,7 +118,7 @@ private: m_state = AfterCharacterClassHyphen; return; } - // Otherwise just fall through - cached character so treat this as Empty. + Q_FALLTHROUGH(); // cached character, so treat this as Empty. case Empty: m_character = ch; @@ -168,6 +168,7 @@ private: case CachedCharacter: // Flush the currently cached character, then fall through. m_delegate.atomCharacterClassAtom(m_character); + Q_FALLTHROUGH(); case Empty: case AfterCharacterClass: @@ -347,9 +348,8 @@ private: delegate.atomPatternCharacter('\\'); break; } - - // Fall-through to handle this as an octal escape. } + Q_FALLTHROUGH(); // Handle this as an octal escape. // Octal escape case '0': @@ -656,7 +656,8 @@ private: } restoreState(state); - } // if we did not find a complete quantifer, fall through to the default case. + } + Q_FALLTHROUGH(); // if we did not find a complete quantifer, fall through to the default case. default: m_delegate.atomPatternCharacter(consume()); diff --git a/src/imports/models/plugins.qmltypes b/src/imports/models/plugins.qmltypes index aa06a2a709..e6d09b76d6 100644 --- a/src/imports/models/plugins.qmltypes +++ b/src/imports/models/plugins.qmltypes @@ -4,10 +4,275 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtQml.Models 2.3' +// 'qmlplugindump -nonrelocatable -noforceqtquick QtQml.Models 2.3' Module { - dependencies: ["QtQuick 2.8"] + dependencies: [] + Component { + name: "QAbstractItemModel" + prototype: "QObject" + Enum { + name: "LayoutChangeHint" + values: { + "NoLayoutChangeHint": 0, + "VerticalSortHint": 1, + "HorizontalSortHint": 2 + } + } + Signal { + name: "dataChanged" + Parameter { name: "topLeft"; type: "QModelIndex" } + Parameter { name: "bottomRight"; type: "QModelIndex" } + Parameter { name: "roles"; type: "QVector<int>" } + } + Signal { + name: "dataChanged" + Parameter { name: "topLeft"; type: "QModelIndex" } + Parameter { name: "bottomRight"; type: "QModelIndex" } + } + Signal { + name: "headerDataChanged" + Parameter { name: "orientation"; type: "Qt::Orientation" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "layoutChanged" + Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } + Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } + } + Signal { + name: "layoutChanged" + Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } + } + Signal { name: "layoutChanged" } + Signal { + name: "layoutAboutToBeChanged" + Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } + Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } + } + Signal { + name: "layoutAboutToBeChanged" + Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } + } + Signal { name: "layoutAboutToBeChanged" } + Signal { + name: "rowsAboutToBeInserted" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "rowsInserted" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "rowsAboutToBeRemoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "rowsRemoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "columnsAboutToBeInserted" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "columnsInserted" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "columnsAboutToBeRemoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { + name: "columnsRemoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "first"; type: "int" } + Parameter { name: "last"; type: "int" } + } + Signal { name: "modelAboutToBeReset" } + Signal { name: "modelReset" } + Signal { + name: "rowsAboutToBeMoved" + Parameter { name: "sourceParent"; type: "QModelIndex" } + Parameter { name: "sourceStart"; type: "int" } + Parameter { name: "sourceEnd"; type: "int" } + Parameter { name: "destinationParent"; type: "QModelIndex" } + Parameter { name: "destinationRow"; type: "int" } + } + Signal { + name: "rowsMoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "start"; type: "int" } + Parameter { name: "end"; type: "int" } + Parameter { name: "destination"; type: "QModelIndex" } + Parameter { name: "row"; type: "int" } + } + Signal { + name: "columnsAboutToBeMoved" + Parameter { name: "sourceParent"; type: "QModelIndex" } + Parameter { name: "sourceStart"; type: "int" } + Parameter { name: "sourceEnd"; type: "int" } + Parameter { name: "destinationParent"; type: "QModelIndex" } + Parameter { name: "destinationColumn"; type: "int" } + } + Signal { + name: "columnsMoved" + Parameter { name: "parent"; type: "QModelIndex" } + Parameter { name: "start"; type: "int" } + Parameter { name: "end"; type: "int" } + Parameter { name: "destination"; type: "QModelIndex" } + Parameter { name: "column"; type: "int" } + } + Method { name: "submit"; type: "bool" } + Method { name: "revert" } + Method { + name: "hasIndex" + type: "bool" + Parameter { name: "row"; type: "int" } + Parameter { name: "column"; type: "int" } + Parameter { name: "parent"; type: "QModelIndex" } + } + Method { + name: "hasIndex" + type: "bool" + Parameter { name: "row"; type: "int" } + Parameter { name: "column"; type: "int" } + } + Method { + name: "index" + type: "QModelIndex" + Parameter { name: "row"; type: "int" } + Parameter { name: "column"; type: "int" } + Parameter { name: "parent"; type: "QModelIndex" } + } + Method { + name: "index" + type: "QModelIndex" + Parameter { name: "row"; type: "int" } + Parameter { name: "column"; type: "int" } + } + Method { + name: "parent" + type: "QModelIndex" + Parameter { name: "child"; type: "QModelIndex" } + } + Method { + name: "sibling" + type: "QModelIndex" + Parameter { name: "row"; type: "int" } + Parameter { name: "column"; type: "int" } + Parameter { name: "idx"; type: "QModelIndex" } + } + Method { + name: "rowCount" + type: "int" + Parameter { name: "parent"; type: "QModelIndex" } + } + Method { name: "rowCount"; type: "int" } + Method { + name: "columnCount" + type: "int" + Parameter { name: "parent"; type: "QModelIndex" } + } + Method { name: "columnCount"; type: "int" } + Method { + name: "hasChildren" + type: "bool" + Parameter { name: "parent"; type: "QModelIndex" } + } + Method { name: "hasChildren"; type: "bool" } + Method { + name: "data" + type: "QVariant" + Parameter { name: "index"; type: "QModelIndex" } + Parameter { name: "role"; type: "int" } + } + Method { + name: "data" + type: "QVariant" + Parameter { name: "index"; type: "QModelIndex" } + } + Method { + name: "setData" + type: "bool" + Parameter { name: "index"; type: "QModelIndex" } + Parameter { name: "value"; type: "QVariant" } + Parameter { name: "role"; type: "int" } + } + Method { + name: "setData" + type: "bool" + Parameter { name: "index"; type: "QModelIndex" } + Parameter { name: "value"; type: "QVariant" } + } + Method { + name: "headerData" + type: "QVariant" + Parameter { name: "section"; type: "int" } + Parameter { name: "orientation"; type: "Qt::Orientation" } + Parameter { name: "role"; type: "int" } + } + Method { + name: "headerData" + type: "QVariant" + Parameter { name: "section"; type: "int" } + Parameter { name: "orientation"; type: "Qt::Orientation" } + } + Method { + name: "fetchMore" + Parameter { name: "parent"; type: "QModelIndex" } + } + Method { + name: "canFetchMore" + type: "bool" + Parameter { name: "parent"; type: "QModelIndex" } + } + Method { + name: "flags" + type: "Qt::ItemFlags" + Parameter { name: "index"; type: "QModelIndex" } + } + Method { + name: "match" + type: "QModelIndexList" + Parameter { name: "start"; type: "QModelIndex" } + Parameter { name: "role"; type: "int" } + Parameter { name: "value"; type: "QVariant" } + Parameter { name: "hits"; type: "int" } + Parameter { name: "flags"; type: "Qt::MatchFlags" } + } + Method { + name: "match" + type: "QModelIndexList" + Parameter { name: "start"; type: "QModelIndex" } + Parameter { name: "role"; type: "int" } + Parameter { name: "value"; type: "QVariant" } + Parameter { name: "hits"; type: "int" } + } + Method { + name: "match" + type: "QModelIndexList" + Parameter { name: "start"; type: "QModelIndex" } + Parameter { name: "role"; type: "int" } + Parameter { name: "value"; type: "QVariant" } + } + } + Component { name: "QAbstractListModel"; prototype: "QAbstractItemModel" } Component { name: "QItemSelectionModel" prototype: "QObject" @@ -119,4 +384,203 @@ Module { } Method { name: "selectedColumns"; type: "QModelIndexList" } } + Component { + name: "QQmlDelegateModel" + defaultProperty: "delegate" + prototype: "QQmlInstanceModel" + exports: ["QtQml.Models/DelegateModel 2.1"] + exportMetaObjectRevisions: [0] + attachedType: "QQmlDelegateModelAttached" + Property { name: "model"; type: "QVariant" } + Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } + Property { name: "filterOnGroup"; type: "string" } + Property { name: "items"; type: "QQmlDelegateModelGroup"; isReadonly: true; isPointer: true } + Property { + name: "persistedItems" + type: "QQmlDelegateModelGroup" + isReadonly: true + isPointer: true + } + Property { name: "groups"; type: "QQmlDelegateModelGroup"; isList: true; isReadonly: true } + Property { name: "parts"; type: "QObject"; isReadonly: true; isPointer: true } + Property { name: "rootIndex"; type: "QVariant" } + Signal { name: "filterGroupChanged" } + Signal { name: "defaultGroupsChanged" } + Method { + name: "modelIndex" + type: "QVariant" + Parameter { name: "idx"; type: "int" } + } + Method { name: "parentModelIndex"; type: "QVariant" } + } + Component { + name: "QQmlDelegateModelAttached" + prototype: "QObject" + Property { name: "model"; type: "QQmlDelegateModel"; isReadonly: true; isPointer: true } + Property { name: "groups"; type: "QStringList" } + Property { name: "isUnresolved"; type: "bool"; isReadonly: true } + Signal { name: "unresolvedChanged" } + } + Component { + name: "QQmlDelegateModelGroup" + prototype: "QObject" + exports: ["QtQml.Models/DelegateModelGroup 2.1"] + exportMetaObjectRevisions: [0] + Property { name: "count"; type: "int"; isReadonly: true } + Property { name: "name"; type: "string" } + Property { name: "includeByDefault"; type: "bool" } + Signal { name: "defaultIncludeChanged" } + Signal { + name: "changed" + Parameter { name: "removed"; type: "QQmlV4Handle" } + Parameter { name: "inserted"; type: "QQmlV4Handle" } + } + Method { + name: "insert" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "create" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "resolve" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "remove" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "addGroups" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "removeGroups" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "setGroups" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "move" + Parameter { type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "get" + type: "QQmlV4Handle" + Parameter { name: "index"; type: "int" } + } + } + Component { name: "QQmlDelegateModelParts"; prototype: "QObject" } + Component { + name: "QQmlListElement" + prototype: "QObject" + exports: ["QtQml.Models/ListElement 2.1"] + exportMetaObjectRevisions: [0] + } + Component { + name: "QQmlListModel" + prototype: "QAbstractListModel" + exports: ["QtQml.Models/ListModel 2.1"] + exportMetaObjectRevisions: [0] + Property { name: "count"; type: "int"; isReadonly: true } + Property { name: "dynamicRoles"; type: "bool" } + Method { name: "clear" } + Method { + name: "remove" + Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "append" + Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "insert" + Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true } + } + Method { + name: "get" + type: "QQmlV4Handle" + Parameter { name: "index"; type: "int" } + } + Method { + name: "set" + Parameter { name: "index"; type: "int" } + Parameter { type: "QQmlV4Handle" } + } + Method { + name: "setProperty" + Parameter { name: "index"; type: "int" } + Parameter { name: "property"; type: "string" } + Parameter { name: "value"; type: "QVariant" } + } + Method { + name: "move" + Parameter { name: "from"; type: "int" } + Parameter { name: "to"; type: "int" } + Parameter { name: "count"; type: "int" } + } + Method { name: "sync" } + } + Component { + name: "QQmlObjectModel" + defaultProperty: "children" + prototype: "QQmlInstanceModel" + exports: [ + "QtQml.Models/ObjectModel 2.1", + "QtQml.Models/ObjectModel 2.3" + ] + exportMetaObjectRevisions: [0, 3] + attachedType: "QQmlObjectModelAttached" + Property { name: "children"; type: "QObject"; isList: true; isReadonly: true } + Method { name: "clear"; revision: 3 } + Method { + name: "get" + revision: 3 + type: "QObject*" + Parameter { name: "index"; type: "int" } + } + Method { + name: "append" + revision: 3 + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Method { + name: "insert" + revision: 3 + Parameter { name: "index"; type: "int" } + Parameter { name: "object"; type: "QObject"; isPointer: true } + } + Method { + name: "move" + revision: 3 + Parameter { name: "from"; type: "int" } + Parameter { name: "to"; type: "int" } + Parameter { name: "n"; type: "int" } + } + Method { + name: "move" + revision: 3 + Parameter { name: "from"; type: "int" } + Parameter { name: "to"; type: "int" } + } + Method { + name: "remove" + revision: 3 + Parameter { name: "index"; type: "int" } + Parameter { name: "n"; type: "int" } + } + Method { + name: "remove" + revision: 3 + Parameter { name: "index"; type: "int" } + } + } + Component { + name: "QQmlObjectModelAttached" + prototype: "QObject" + Property { name: "index"; type: "int"; isReadonly: true } + } } diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp index 60b76deb2e..0d3f78d95d 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp @@ -461,6 +461,7 @@ void QSGD3D12RenderLoop::renderWindow(QQuickWindow *window) data.rc->initialize(nullptr); wd->syncSceneGraph(); + data.rc->endSync(); if (profileFrames) syncTime = renderTimer.nsecsElapsed(); diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp index 11cc257103..120a84566f 100644 --- a/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp +++ b/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp @@ -410,6 +410,7 @@ bool QSGD3D12RenderThread::event(QEvent *e) QQuickWindowPrivate *wd = QQuickWindowPrivate::get(wme->window); rc->initialize(nullptr); wd->syncSceneGraph(); + rc->endSync(); wd->renderSceneGraph(wme->window->size()); *wme->image = engine->executeAndWaitReadbackRenderTarget(); } @@ -545,6 +546,7 @@ void QSGD3D12RenderThread::sync(bool inExpose) rc->initialize(nullptr); wd->syncSceneGraph(); + rc->endSync(); if (!hadRenderer && wd->renderer) { if (Q_UNLIKELY(debug_loop())) diff --git a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp index f7aa704095..d31156f0eb 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp +++ b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp @@ -205,6 +205,7 @@ void QSGOpenVGRenderLoop::renderWindow(QQuickWindow *window) emit window->afterAnimating(); cd->syncSceneGraph(); + rc->endSync(); if (profileFrames) syncTime = renderTimer.nsecsElapsed(); diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index d8cd31de29..e80b9d8ac4 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1425,7 +1425,7 @@ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output, const QV4: } // write objects - quint32 *objectTable = reinterpret_cast<quint32*>(data + qmlUnit->offsetToObjects); + QV4::CompiledData::LEUInt32 *objectTable = reinterpret_cast<QV4::CompiledData::LEUInt32*>(data + qmlUnit->offsetToObjects); char *objectPtr = data + qmlUnit->offsetToObjects + objectOffsetTableSize; for (int i = 0; i < output.objects.count(); ++i) { const Object *o = output.objects.at(i); @@ -1467,7 +1467,7 @@ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output, const QV4: objectToWrite->offsetToNamedObjectsInComponent = nextOffset; nextOffset += objectToWrite->nNamedObjectsInComponent * sizeof(quint32); - quint32 *functionsTable = reinterpret_cast<quint32*>(objectPtr + objectToWrite->offsetToFunctions); + QV4::CompiledData::LEUInt32 *functionsTable = reinterpret_cast<QV4::CompiledData::LEUInt32*>(objectPtr + objectToWrite->offsetToFunctions); for (const Function *f = o->firstFunction(); f; f = f->next) *functionsTable++ = o->runtimeFunctionIndices.at(f->index); @@ -1493,7 +1493,7 @@ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output, const QV4: bindingPtr = writeBindings(bindingPtr, o, &QV4::CompiledData::Binding::isValueBindingToAlias); Q_ASSERT((bindingPtr - objectToWrite->offsetToBindings - objectPtr) / sizeof(QV4::CompiledData::Binding) == unsigned(o->bindingCount())); - quint32 *signalOffsetTable = reinterpret_cast<quint32*>(objectPtr + objectToWrite->offsetToSignals); + QV4::CompiledData::LEUInt32 *signalOffsetTable = reinterpret_cast<QV4::CompiledData::LEUInt32*>(objectPtr + objectToWrite->offsetToSignals); quint32 signalTableSize = 0; char *signalPtr = objectPtr + nextOffset; for (const Signal *s = o->firstSignal(); s; s = s->next) { @@ -1513,7 +1513,7 @@ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output, const QV4: signalPtr += size; } - quint32 *namedObjectInComponentPtr = reinterpret_cast<quint32*>(objectPtr + objectToWrite->offsetToNamedObjectsInComponent); + QV4::CompiledData::LEUInt32 *namedObjectInComponentPtr = reinterpret_cast<QV4::CompiledData::LEUInt32*>(objectPtr + objectToWrite->offsetToNamedObjectsInComponent); for (int i = 0; i < o->namedObjectsInComponent.count; ++i) { *namedObjectInComponentPtr++ = o->namedObjectsInComponent.at(i); } diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 68063c2f71..94abf416a1 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -99,6 +99,7 @@ CompilationUnit::CompilationUnit() , runtimeLookups(0) , runtimeRegularExpressions(0) , runtimeClasses(0) + , constants(nullptr) , totalBindingsCount(0) , totalParserStatusCount(0) , totalObjectCount(0) @@ -238,6 +239,7 @@ void CompilationUnit::unlink() runtimeFunctions.clear(); #if Q_BYTE_ORDER == Q_BIG_ENDIAN delete [] constants; + constants = nullptr; #endif } diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index f7e63437e1..a49388846d 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -337,29 +337,29 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::IR::Function *i function->codeSize = 0; // write formals - quint32 *formals = (quint32 *)(f + function->formalsOffset); + CompiledData::LEUInt32 *formals = (CompiledData::LEUInt32 *)(f + function->formalsOffset); for (int i = 0; i < irFunction->formals.size(); ++i) formals[i] = getStringId(*irFunction->formals.at(i)); // write locals - quint32 *locals = (quint32 *)(f + function->localsOffset); + CompiledData::LEUInt32 *locals = (CompiledData::LEUInt32 *)(f + function->localsOffset); for (int i = 0; i < irFunction->locals.size(); ++i) locals[i] = getStringId(*irFunction->locals.at(i)); // write QML dependencies - quint32 *writtenDeps = (quint32 *)(f + function->dependingIdObjectsOffset); + CompiledData::LEUInt32 *writtenDeps = (CompiledData::LEUInt32 *)(f + function->dependingIdObjectsOffset); for (int id : irFunction->idObjectDependencies) { Q_ASSERT(id >= 0); *writtenDeps++ = static_cast<quint32>(id); } - writtenDeps = (quint32 *)(f + function->dependingContextPropertiesOffset); + writtenDeps = (CompiledData::LEUInt32 *)(f + function->dependingContextPropertiesOffset); for (auto property : irFunction->contextObjectPropertyDependencies) { *writtenDeps++ = property.key(); // property index *writtenDeps++ = property.value(); // notify index } - writtenDeps = (quint32 *)(f + function->dependingScopePropertiesOffset); + writtenDeps = (CompiledData::LEUInt32 *)(f + function->dependingScopePropertiesOffset); for (auto property : irFunction->scopeObjectPropertyDependencies) { *writtenDeps++ = property.key(); // property index *writtenDeps++ = property.value(); // notify index @@ -408,6 +408,8 @@ QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Comp *jsClassDataOffset = nextOffset; nextOffset += jsClassData.size(); + nextOffset = (nextOffset + 7) & ~quint32(0x7); + for (int i = 0; i < irModule->functions.size(); ++i) { QV4::IR::Function *f = irModule->functions.at(i); functionOffsets[i] = nextOffset; diff --git a/src/qml/doc/snippets/code/backend/backend.cpp b/src/qml/doc/snippets/code/backend/backend.cpp index 4a7ee89cec..58f5a15e2a 100644 --- a/src/qml/doc/snippets/code/backend/backend.cpp +++ b/src/qml/doc/snippets/code/backend/backend.cpp @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//! [backend_cpp] #include "backend.h" BackEnd::BackEnd(QObject *parent) : @@ -68,3 +68,4 @@ void BackEnd::setUserName(const QString &userName) m_userName = userName; emit userNameChanged(); } +//! [backend_cpp] diff --git a/src/qml/doc/snippets/code/backend/backend.h b/src/qml/doc/snippets/code/backend/backend.h index 91bb766e1f..fa7ce9eb86 100644 --- a/src/qml/doc/snippets/code/backend/backend.h +++ b/src/qml/doc/snippets/code/backend/backend.h @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//! [backend_header] #ifndef BACKEND_H #define BACKEND_H @@ -73,3 +73,4 @@ private: }; #endif // BACKEND_H +//! [backend_header] diff --git a/src/qml/doc/snippets/code/backend/main.cpp b/src/qml/doc/snippets/code/backend/main.cpp index d7a1bcbd4f..91a012dfda 100644 --- a/src/qml/doc/snippets/code/backend/main.cpp +++ b/src/qml/doc/snippets/code/backend/main.cpp @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//! [main_cpp] #include <QGuiApplication> #include <QQmlApplicationEngine> @@ -64,3 +64,4 @@ int main(int argc, char *argv[]) return app.exec(); } +//! [main_cpp] diff --git a/src/qml/doc/snippets/code/backend/main.qml b/src/qml/doc/snippets/code/backend/main.qml index 3720da8412..fadc9cd768 100644 --- a/src/qml/doc/snippets/code/backend/main.qml +++ b/src/qml/doc/snippets/code/backend/main.qml @@ -47,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +//! [main_qml] import QtQuick 2.6 import QtQuick.Controls 2.0 //![import] @@ -76,4 +76,4 @@ ApplicationWindow { } //![username_input] } - +//! [main_qml] diff --git a/src/qml/doc/src/cppintegration/topic.qdoc b/src/qml/doc/src/cppintegration/topic.qdoc index 22115395b1..183af25297 100644 --- a/src/qml/doc/src/cppintegration/topic.qdoc +++ b/src/qml/doc/src/cppintegration/topic.qdoc @@ -46,13 +46,13 @@ BackEnd, in a QML application: \li Add a new C++ class called \c BackEnd to the project and replace its header file contents with: -\quotefile code/backend/backend.h +\snippet code/backend/backend.h backend_header The \c Q_PROPERTY macro declares a property that could be accessed from QML. \li Replace its C++ file contents with: -\quotefile code/backend/backend.cpp +\snippet code/backend/backend.cpp backend_cpp The \c setUserName function emits the \c userNameChanged signal every time \c m_userName value changes. The signal can be handled from QML using the @@ -61,14 +61,14 @@ The \c setUserName function emits the \c userNameChanged signal every time \li Include \c "backend.h" in \c main.cpp and register the class as a QML type under a import URL as shown below: -\quotefile code/backend/main.cpp +\snippet code/backend/main.cpp main_cpp The BackEnd class is registered as a type, which is accessible from QML by importing the URL, "\c{io.qt.examples.backend 1.0}". \li Replace the contents of \c main.qml with the following code: -\quotefile code/backend/main.qml +\snippet code/backend/main.qml main_qml The \c BackEnd instance lets you access the \c userName property, which is updated when the TextField's \c text property changes. diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index fd516c9815..c0cabe4dd0 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -596,7 +596,7 @@ The following functions are also on the Qt object. \li application.font \endlist - \sa Screen, Window, {QtQuick::Window::screen}{Window.screen} + \sa Screen, Window, {QtQuick.Window::Window::screen}{Window.screen} */ /*! diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index b70db5ed86..1e1fbcf448 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -202,7 +202,6 @@ QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *scope, */ QQmlExpression::~QQmlExpression() { - clearError(); } /*! diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 17cccc0bbd..9d4e46e254 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -111,6 +111,7 @@ QQmlJavaScriptExpression::~QQmlJavaScriptExpression() clearActiveGuards(); clearPermanentGuards(); + clearError(); if (m_scopeObject.isT2()) // notify DeleteWatcher of our deletion. m_scopeObject.asT2()->_s = 0; diff --git a/src/qml/types/qqmlobjectmodel.cpp b/src/qml/types/qqmlobjectmodel.cpp index 2814b9d38f..64d0169f6b 100644 --- a/src/qml/types/qqmlobjectmodel.cpp +++ b/src/qml/types/qqmlobjectmodel.cpp @@ -129,7 +129,7 @@ public: } QQmlChangeSet changeSet; - changeSet.move(from, to, n, -1); + changeSet.move(from, to, n, 0); emit q->modelUpdated(changeSet, false); emit q->childrenChanged(); } diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index 2a567fac8d..90d11e9734 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -554,6 +554,12 @@ void QuickTestResult::stringify(QQmlV4Function *args) result = QString::fromLatin1("Qt.url(%1)").arg(url.toString()); break; } + case QVariant::DateTime: + { + QDateTime dt = v.value<QDateTime>(); + result = dt.toString(Qt::ISODateWithMs); + break; + } default: result = v.toString(); } diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index cbcf945a11..7c7bdbc137 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -171,6 +171,7 @@ available when you import \c QtQuick. \li \l real \c font.letterSpacing \li \l real \c font.wordSpacing \li \l bool \c font.kerning + \li \l enumeration \c font.hintingPreference \endlist Example: @@ -237,6 +238,19 @@ available when you import \c QtQuick. \li Alters the text to be rendered with the first character of each word as an uppercase character. \endtable + Setting the hinting preference only has an effect when using the "NativeRendering" render type. + The property supports the following values: + + \list + \value Font.PreferDefaultHinting - Use the default hinting level for the target platform. + \value Font.PreferNoHinting - If possible, render text without hinting the outlines + of the glyphs. + \value Font.PreferVerticalHinting - If possible, render text with no horizontal hinting, + but align glyphs to the pixel grid in the vertical direction. + \value Font.PreferFullHinting - If possible, render text with hinting in both horizontal and + vertical directions. + \endlist + \sa {QML Basic Types} */ diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp index f2828bbedd..7e995936af 100644 --- a/src/quick/items/qquickrendercontrol.cpp +++ b/src/quick/items/qquickrendercontrol.cpp @@ -284,6 +284,7 @@ bool QQuickRenderControl::sync() QQuickWindowPrivate *cd = QQuickWindowPrivate::get(d->window); cd->syncSceneGraph(); + d->rc->endSync(); // TODO: find out if the sync actually caused a scenegraph update. return true; @@ -383,6 +384,7 @@ QImage QQuickRenderControl::grab() QQuickWindowPrivate *cd = QQuickWindowPrivate::get(d->window); cd->polishItems(); cd->syncSceneGraph(); + d->rc->endSync(); render(); grabContent = qt_gl_read_framebuffer(d->window->size() * d->window->effectiveDevicePixelRatio(), false, false); if (QQuickRenderControl::renderWindowFor(d->window)) { @@ -402,6 +404,7 @@ QImage QQuickRenderControl::grab() softwareRenderer->markDirty(); cd->polishItems(); cd->syncSceneGraph(); + d->rc->endSync(); render(); softwareRenderer->setCurrentPaintDevice(prevDev); } diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 2cb518d691..7ea593fe76 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -432,10 +432,8 @@ void QQuickWindowPrivate::syncSceneGraph() emit q->afterSynchronizing(); runAndClearJobs(&afterSynchronizingJobs); - context->endSync(); } - void QQuickWindowPrivate::renderSceneGraph(const QSize &size) { QML_MEMORY_SCOPE_STRING("SceneGraph"); @@ -3434,7 +3432,7 @@ void QQuickWindow::setRenderTarget(QOpenGLFramebufferObject *fbo) { Q_D(QQuickWindow); if (d->context && QThread::currentThread() != d->context->thread()) { - qWarning("QQuickWindow::setRenderThread: Cannot set render target from outside the rendering thread"); + qWarning("QQuickWindow::setRenderTarget: Cannot set render target from outside the rendering thread"); return; } diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp index 962db20cbc..3f0d1383b9 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp @@ -149,6 +149,7 @@ void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window, bool isNewExpose) emit window->afterAnimating(); cd->syncSceneGraph(); + rc->endSync(); if (profileFrames) syncTime = renderTimer.nsecsElapsed(); diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp index d2186e7cf1..832b69d0cc 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp @@ -330,6 +330,7 @@ bool QSGSoftwareRenderThread::event(QEvent *e) softwareRenderer->setBackingStore(backingStore); rc->initialize(nullptr); wd->syncSceneGraph(); + rc->endSync(); wd->renderSceneGraph(wme->window->size()); *wme->image = backingStore->handle()->toImage(); } @@ -443,6 +444,7 @@ void QSGSoftwareRenderThread::sync(bool inExpose) rc->initialize(nullptr); wd->syncSceneGraph(); + rc->endSync(); if (!hadRenderer && wd->renderer) { qCDebug(QSG_RASTER_LOG_RENDERLOOP, "RT - created renderer"); diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 78f2c86f6c..edee29584c 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -969,9 +969,10 @@ bool Renderer::changeBatchRoot(Node *node, Node *root) void Renderer::nodeChangedBatchRoot(Node *node, Node *root) { if (node->type() == QSGNode::ClipNodeType || node->isBatchRoot) { - if (!changeBatchRoot(node, root)) - return; - node = root; + // When we reach a batchroot, we only need to update it. Its subtree + // is relative to that root, so no need to recurse further. + changeBatchRoot(node, root); + return; } else if (node->type() == QSGNode::GeometryNodeType) { // Only need to change the root as nodeChanged anyway flags a full update. Element *e = node->element(); diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index c11b698a03..4a69b770ed 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -380,6 +380,16 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) bool alsoSwap = data.updatePending; data.updatePending = false; + bool lastDirtyWindow = true; + auto i = m_windows.constBegin(); + while (i != m_windows.constEnd()) { + if (i.value().updatePending) { + lastDirtyWindow = false; + break; + } + i++; + } + if (!current) return; @@ -407,6 +417,8 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) emit window->afterAnimating(); cd->syncSceneGraph(); + if (lastDirtyWindow) + rc->endSync(); if (profileFrames) syncTime = renderTimer.nsecsElapsed(); diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 7d77e52b5f..1e5e61e43b 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -425,6 +425,7 @@ bool QSGRenderThread::event(QEvent *e) qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- sync scene graph"; QQuickWindowPrivate *d = QQuickWindowPrivate::get(ce->window); d->syncSceneGraph(); + sgrc->endSync(); qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- rendering scene graph"; QQuickWindowPrivate::get(ce->window)->renderSceneGraph(ce->window->size()); diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index e16f7ea966..e10e52d95e 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -445,6 +445,14 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window) } } + bool lastDirtyWindow = true; + for (int i=0; i<m_windows.size(); ++i) { + if ( m_windows[i].pendingUpdate) { + lastDirtyWindow = false; + break; + } + } + d->flushFrameSynchronousEvents(); // Event delivery or processing has caused the window to stop rendering. if (!windowData(window)) @@ -464,6 +472,8 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window) RLDEBUG(" - syncing"); d->syncSceneGraph(); + if (lastDirtyWindow) + m_rc->endSync(); QSG_RENDER_TIMING_SAMPLE(QQuickProfiler::SceneGraphRenderLoopFrame, time_synced, QQuickProfiler::SceneGraphRenderLoopSync); diff --git a/src/quick/util/qquickvalidator.cpp b/src/quick/util/qquickvalidator.cpp index 93f414fe80..c3ce149dcf 100644 --- a/src/quick/util/qquickvalidator.cpp +++ b/src/quick/util/qquickvalidator.cpp @@ -228,9 +228,15 @@ void QQuickDoubleValidator::resetLocaleName() \list \li A list of numbers with one to three positions separated by a comma: + \badcode /\d{1,3}(?:,\d{1,3})+$/ + \endcode + \li An amount consisting of up to 3 numbers before the decimal point, and - 1 to 2 after the decimal point: \li /(\d{1,3})([.,]\d{1,2})?$/ + 1 to 2 after the decimal point: + \badcode + /(\d{1,3})([.,]\d{1,2})?$/ + \endcode \endlist */ diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 2e8623f508..2c3c72d5f1 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -913,9 +913,9 @@ void QQuickWidget::createFramebufferObject() d->offscreenWindow->setGeometry(globalPos.x(), globalPos.y(), width(), height()); if (d->useSoftwareRenderer) { - const QSize imageSize = size() * devicePixelRatio(); + const QSize imageSize = size() * devicePixelRatioF(); d->softwareImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied); - d->softwareImage.setDevicePixelRatio(devicePixelRatio()); + d->softwareImage.setDevicePixelRatio(devicePixelRatioF()); return; } @@ -960,7 +960,7 @@ void QQuickWidget::createFramebufferObject() format.setInternalTextureFormat(GL_SRGB8_ALPHA8_EXT); #endif - const QSize fboSize = size() * devicePixelRatio(); + const QSize fboSize = size() * devicePixelRatioF(); // Could be a simple hide - show, in which case the previous fbo is just fine. if (!d->fbo || d->fbo->size() != fboSize) { @@ -1181,7 +1181,7 @@ void QQuickWidget::resizeEvent(QResizeEvent *e) // Software Renderer if (d->useSoftwareRenderer) { needsSync = true; - if (d->softwareImage.size() != size() * devicePixelRatio()) { + if (d->softwareImage.size() != size() * devicePixelRatioF()) { createFramebufferObject(); } } else { @@ -1191,7 +1191,7 @@ void QQuickWidget::resizeEvent(QResizeEvent *e) // during hide - resize - show sequences and also during application exit. if (!d->fbo && !d->offscreenWindow->openglContext()) return; - if (!d->fbo || d->fbo->size() != size() * devicePixelRatio()) { + if (!d->fbo || d->fbo->size() != size() * devicePixelRatioF()) { needsSync = true; createFramebufferObject(); } @@ -1607,10 +1607,12 @@ void QQuickWidget::paintEvent(QPaintEvent *event) //Paint everything painter.drawImage(rect(), d->softwareImage); } else { + QTransform transform; + transform.scale(devicePixelRatioF(), devicePixelRatioF()); //Paint only the updated areas const auto rects = d->updateRegion.rects(); for (auto targetRect : rects) { - auto sourceRect = QRect(targetRect.topLeft() * devicePixelRatio(), targetRect.size() * devicePixelRatio()); + auto sourceRect = transform.mapRect(QRectF(targetRect)); painter.drawImage(targetRect, d->softwareImage, sourceRect); } d->updateRegion = QRegion(); |