aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-07-04 15:20:33 +0200
committerLiang Qi <liang.qi@qt.io>2017-07-04 15:22:47 +0200
commit39888db8b34767974d4a443bfe40b9e84fed315a (patch)
tree2133759c6c2e91ff65b886c70093f4f52c7bbba5 /src/qml
parentfd295c5047095806db2015a978ed593a140ff373 (diff)
parent5c221826025276aea5ee19275f350a28e02db254 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: .qmake.conf src/quick/doc/src/qmltypereference.qdoc Change-Id: Ia58f1c5a98309c32ef8d8e5c893faf261215f19f
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp8
-rw-r--r--src/qml/compiler/qv4compileddata.cpp2
-rw-r--r--src/qml/compiler/qv4compiler.cpp12
-rw-r--r--src/qml/doc/snippets/code/backend/backend.cpp3
-rw-r--r--src/qml/doc/snippets/code/backend/backend.h3
-rw-r--r--src/qml/doc/snippets/code/backend/main.cpp3
-rw-r--r--src/qml/doc/snippets/code/backend/main.qml4
-rw-r--r--src/qml/doc/src/cppintegration/topic.qdoc8
-rw-r--r--src/qml/qml/qqmlengine.cpp2
-rw-r--r--src/qml/qml/qqmlexpression.cpp1
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp1
-rw-r--r--src/qml/types/qqmlobjectmodel.cpp2
12 files changed, 28 insertions, 21 deletions
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();
}