diff options
author | Liang Qi <liang.qi@qt.io> | 2018-03-28 08:27:57 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-03-28 08:27:57 +0200 |
commit | 198409ba76e18587526e9e1ec84fdb432c671937 (patch) | |
tree | 2d06c052272ddfd1c9b34b863e342826a31d20b9 /src | |
parent | 9a98d16d9e49395a24cd733ca8f65b2f82ebba94 (diff) | |
parent | e696a6b7bff04d1581cf59b4d96ecb5508f54169 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
tests/auto/qml/qjsengine/tst_qjsengine.cpp
Change-Id: I8276669e257f35a76768ef7f8795a8605cf4c9bc
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/masm/yarr/YarrInterpreter.cpp | 1 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp | 15 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h | 3 | ||||
-rw-r--r-- | src/qml/debugger/qqmlprofiler_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4global_p.h | 5 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlexpression.cpp | 5 | ||||
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression.cpp | 14 | ||||
-rw-r--r-- | src/quick/designer/qquickdesignercustomobjectdata.cpp | 4 | ||||
-rw-r--r-- | src/quick/designer/qquickdesignersupportitems.cpp | 4 | ||||
-rw-r--r-- | src/quick/doc/QtQuickDoc | 2 | ||||
-rw-r--r-- | src/quick/doc/qtquick.qdocconf | 4 | ||||
-rw-r--r-- | src/quick/handlers/qquickpointerhandler.cpp | 10 | ||||
-rw-r--r-- | src/quick/handlers/qquickpointerhandler_p.h | 8 | ||||
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp | 2 |
15 files changed, 57 insertions, 24 deletions
diff --git a/src/3rdparty/masm/yarr/YarrInterpreter.cpp b/src/3rdparty/masm/yarr/YarrInterpreter.cpp index 4a789f6f28..16fc183cad 100644 --- a/src/3rdparty/masm/yarr/YarrInterpreter.cpp +++ b/src/3rdparty/masm/yarr/YarrInterpreter.cpp @@ -731,6 +731,7 @@ public: context->term -= term.atom.parenthesesWidth; return false; } + Q_FALLTHROUGH(); case QuantifierNonGreedy: if (backTrack->begin == notFound) { backTrack->begin = input.getPos(); diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp index 92e93a053a..22c515adf9 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp @@ -59,7 +59,7 @@ Q_QML_DEBUG_PLUGIN_LOADER(QQmlAbstractProfilerAdapter) QQmlProfilerServiceImpl::QQmlProfilerServiceImpl(QObject *parent) : QQmlConfigurableDebugService<QQmlProfilerService>(1, parent), - m_waitingForStop(false) + m_waitingForStop(false), m_globalEnabled(false), m_globalFeatures(0) { m_timer.start(); QQmlAbstractProfilerAdapter *quickAdapter = @@ -137,6 +137,10 @@ void QQmlProfilerServiceImpl::engineAdded(QJSEngine *engine) "QML profilers have to be added from the engine thread"); QMutexLocker lock(&m_configMutex); + + if (m_globalEnabled) + startProfiling(engine, m_globalFeatures); + const auto range = qAsConst(m_engineProfilers).equal_range(engine); for (auto it = range.first; it != range.second; ++it) (*it)->stopWaiting(); @@ -254,6 +258,9 @@ void QQmlProfilerServiceImpl::startProfiling(QJSEngine *engine, quint64 features if (startedAny) d << idForObject(engine); } else { + m_globalEnabled = true; + m_globalFeatures = features; + QSet<QJSEngine *> engines; for (QMultiHash<QJSEngine *, QQmlAbstractProfilerAdapter *>::iterator i(m_engineProfilers.begin()); i != m_engineProfilers.end(); ++i) { @@ -274,9 +281,8 @@ void QQmlProfilerServiceImpl::startProfiling(QJSEngine *engine, quint64 features } emit startFlushTimer(); + emit messageToClient(name(), d.data()); } - - emit messageToClient(name(), d.data()); } /*! @@ -292,6 +298,9 @@ void QQmlProfilerServiceImpl::stopProfiling(QJSEngine *engine) QList<QQmlAbstractProfilerAdapter *> stopping; QList<QQmlAbstractProfilerAdapter *> reporting; + if (engine == nullptr) + m_globalEnabled = false; + bool stillRunning = false; for (QMultiHash<QJSEngine *, QQmlAbstractProfilerAdapter *>::iterator i(m_engineProfilers.begin()); i != m_engineProfilers.end(); ++i) { diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h index e86c8df4ac..ce0101f4d4 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h @@ -115,6 +115,9 @@ private: QTimer m_flushTimer; bool m_waitingForStop; + bool m_globalEnabled; + quint64 m_globalFeatures; + QList<QQmlAbstractProfilerAdapter *> m_globalProfilers; QMultiHash<QJSEngine *, QQmlAbstractProfilerAdapter *> m_engineProfilers; QList<QJSEngine *> m_stoppingEngines; diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h index 44d208db41..d01e2bc429 100644 --- a/src/qml/debugger/qqmlprofiler_p.h +++ b/src/qml/debugger/qqmlprofiler_p.h @@ -190,7 +190,7 @@ public: } RefLocation(QQmlDataBlob *ref) - : Location(QQmlSourceLocation()), locationType(Compiling), sent(false) + : Location(QQmlSourceLocation(), ref->url()), locationType(Compiling), sent(false) { blob = ref; blob->addref(); diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index 7f82a02ae0..9b13d4e341 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -108,6 +108,11 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); } //# define V4_ENABLE_JIT #endif +// check FPU with double precision on ARM platform +#if (defined(Q_PROCESSOR_ARM_64) || defined(Q_PROCESSOR_ARM_32)) && defined(V4_ENABLE_JIT) && defined(__ARM_FP) && (__ARM_FP <= 0x04) +# undef V4_ENABLE_JIT +#endif + // Black list some platforms #if defined(V4_ENABLE_JIT) #if defined(Q_OS_IOS) || defined(Q_OS_TVOS) diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 97ed13cd91..a5ee6b5373 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -339,7 +339,7 @@ public: if (isDouble()) { double d = doubleValue(); int i = (int)d; - if (i == d) { + if (i == d && !(d == 0 && std::signbit(d))) { setInt_32(i); return true; } diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 59cc9bb09f..27d3acb9b7 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -252,6 +252,11 @@ QV4::ReturnedValue QQmlExpressionPrivate::v4value(bool *isUndefined) if (!expressionFunctionValid) { createQmlBinding(context(), scopeObject(), expression, url, line); expressionFunctionValid = true; + if (hasError()) { + if (isUndefined) + *isUndefined = true; + return QV4::Encode::undefined(); + } } return evaluate(isUndefined); diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 74148e3ca4..3daa107b64 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -451,15 +451,11 @@ void QQmlJavaScriptExpression::createQmlBinding(QQmlContextData *ctxt, QObject * QV4::Script script(v4, qmlContext, code, filename, line); script.parse(); if (v4->hasException) { - QQmlError error = v4->catchExceptionAsQmlError(); - if (error.description().isEmpty()) - error.setDescription(QLatin1String("Exception occurred during function evaluation")); - if (error.line() == -1) - error.setLine(line); - if (error.url().isEmpty()) - error.setUrl(QUrl::fromLocalFile(filename)); - error.setObject(qmlScope); - ep->warning(error); + QQmlDelayedError *error = delayedError(); + error->catchJavaScriptException(v4); + error->setErrorObject(qmlScope); + if (!error->addError(ep)) + ep->warning(error); return; } setupFunction(qmlContext, script.vmFunction); diff --git a/src/quick/designer/qquickdesignercustomobjectdata.cpp b/src/quick/designer/qquickdesignercustomobjectdata.cpp index daa9486f02..8989de711e 100644 --- a/src/quick/designer/qquickdesignercustomobjectdata.cpp +++ b/src/quick/designer/qquickdesignercustomobjectdata.cpp @@ -149,11 +149,11 @@ void QQuickDesignerCustomObjectData::populateResetHashes() QQuickDesignerSupportProperties::propertyNameListForWritableProperties(object()); const QMetaObject *mo = object()->metaObject(); - QStringList deferredPropertyNames; + QByteArrayList deferredPropertyNames; const int namesIndex = mo->indexOfClassInfo("DeferredPropertyNames"); if (namesIndex != -1) { QMetaClassInfo classInfo = mo->classInfo(namesIndex); - deferredPropertyNames = QString::fromUtf8(classInfo.value()).split(QLatin1Char(',')); + deferredPropertyNames = QByteArray(classInfo.value()).split(','); } for (const QQuickDesignerSupport::PropertyName &propertyName : propertyNameList) { diff --git a/src/quick/designer/qquickdesignersupportitems.cpp b/src/quick/designer/qquickdesignersupportitems.cpp index 82474827aa..1c338fa79d 100644 --- a/src/quick/designer/qquickdesignersupportitems.cpp +++ b/src/quick/designer/qquickdesignersupportitems.cpp @@ -96,11 +96,11 @@ static void allSubObjects(QObject *object, QObjectList &objectList) const QMetaObject *mo = object->metaObject(); - QStringList deferredPropertyNames; + QByteArrayList deferredPropertyNames; const int namesIndex = mo->indexOfClassInfo("DeferredPropertyNames"); if (namesIndex != -1) { QMetaClassInfo classInfo = mo->classInfo(namesIndex); - deferredPropertyNames = QString::fromUtf8(classInfo.value()).split(QLatin1Char(',')); + deferredPropertyNames = QByteArray(classInfo.value()).split(','); } for (int index = QObject::staticMetaObject.propertyOffset(); diff --git a/src/quick/doc/QtQuickDoc b/src/quick/doc/QtQuickDoc new file mode 100644 index 0000000000..6c151f2ebd --- /dev/null +++ b/src/quick/doc/QtQuickDoc @@ -0,0 +1,2 @@ +#include <QtQuick/QtQuick> +#include <QtQuickWidgets/QtQuickWidgets> diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf index 7ce0dfcf09..c137d1d2c8 100644 --- a/src/quick/doc/qtquick.qdocconf +++ b/src/quick/doc/qtquick.qdocconf @@ -6,6 +6,10 @@ version = $QT_VERSION examplesinstallpath = quick +# Custom module header that pulls in also QtQuickWidgets +moduleheader = QtQuickDoc +includepaths = -I . + qhp.projects = QtQuick qhp.QtQuick.file = qtquick.qhp diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp index 959030b8fe..e5b1dc8985 100644 --- a/src/quick/handlers/qquickpointerhandler.cpp +++ b/src/quick/handlers/qquickpointerhandler.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -245,6 +245,14 @@ void QQuickPointerHandler::setGrabPermissions(GrabPermissions grabPermission) emit grabPermissionChanged(); } +void QQuickPointerHandler::classBegin() +{ +} + +void QQuickPointerHandler::componentComplete() +{ +} + /*! \internal Acquire or give up the exclusive grab of the given \a point, according to diff --git a/src/quick/handlers/qquickpointerhandler_p.h b/src/quick/handlers/qquickpointerhandler_p.h index 9ea6a8b5e2..e2bcce8fc9 100644 --- a/src/quick/handlers/qquickpointerhandler_p.h +++ b/src/quick/handlers/qquickpointerhandler_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -106,9 +106,6 @@ public: GrabPermissions grabPermissions() const { return static_cast<GrabPermissions>(m_grabPermissions); } void setGrabPermissions(GrabPermissions grabPermissions); - void classBegin() override { } - void componentComplete() override { } - Q_SIGNALS: void enabledChanged(); void activeChanged(); @@ -118,6 +115,9 @@ Q_SIGNALS: void canceled(QQuickEventPoint *point); protected: + void classBegin() override; + void componentComplete() override; + QQuickPointerEvent *currentEvent() { return m_currentEvent; } virtual bool wantsPointerEvent(QQuickPointerEvent *event); virtual void handlePointerEventImpl(QQuickPointerEvent *event); diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp index 423f5f7321..b400473128 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp @@ -195,7 +195,7 @@ void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window, bool isNewExpose) int(polishTime / 1000000), int((syncTime - polishTime) / 1000000), int((renderTime - syncTime) / 1000000), - int((swapTime - renderTime) / 10000000), + int((swapTime - renderTime) / 1000000), int(lastFrameTime.msecsTo(QTime::currentTime()))); lastFrameTime = QTime::currentTime(); } |