From eeb320bbd8763f3e72f79369cc3908e999a0da3c Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 2 Mar 2017 15:25:07 +0100 Subject: Delay the deletion of QSGTextures until all windows are synchronized With the 'basic' and the 'windows' render loop the scene graph context is shared. Because of this we cannot start deleting textures after the first window is synchronized as it may contain textures needed by the another window, which is not yet synchronized. QWindowPrivate::syncSceneGraph() is not calling endSync() anymore as it doesn't know whether it is the last window or not. Instead the renderloop is now responsible for calling endSync() once this is safe to do. Change-Id: Icb50ebfb447c928e38b41df7e26f3bfafdb4a811 Reviewed-by: Robert Griebl Reviewed-by: Gunnar Sletta --- src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp | 1 + src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp | 2 ++ src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp | 1 + src/quick/items/qquickrendercontrol.cpp | 3 +++ src/quick/items/qquickwindow.cpp | 2 -- .../adaptations/software/qsgsoftwarerenderloop.cpp | 1 + .../adaptations/software/qsgsoftwarethreadedrenderloop.cpp | 2 ++ src/quick/scenegraph/qsgrenderloop.cpp | 12 ++++++++++++ src/quick/scenegraph/qsgthreadedrenderloop.cpp | 1 + src/quick/scenegraph/qsgwindowsrenderloop.cpp | 10 ++++++++++ 10 files changed, 33 insertions(+), 2 deletions(-) (limited to 'src') 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/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 d30f1c3f78..433c5b25b1 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"); 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 71db35377e..19f16a79fb 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/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index c27700cf84..bc65dc1bc3 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 2364fb714c..3a8e673c0d 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; iflushFrameSynchronousEvents(); // 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); -- cgit v1.2.3 From 5935488d46d2e78d72b4ff61a56bc5e7448c2002 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Thu, 15 Jun 2017 14:36:56 +0200 Subject: Doc: Avoid copyright text in the codeblock by using \snippet Change-Id: Ib6f1a1e796a085d0f274c7e87d4ed1314e958a06 Reviewed-by: Nico Vertriest Reviewed-by: Mitch Curtis --- src/qml/doc/snippets/code/backend/backend.cpp | 3 ++- src/qml/doc/snippets/code/backend/backend.h | 3 ++- src/qml/doc/snippets/code/backend/main.cpp | 3 ++- src/qml/doc/snippets/code/backend/main.qml | 4 ++-- src/qml/doc/src/cppintegration/topic.qdoc | 8 ++++---- 5 files changed, 12 insertions(+), 9 deletions(-) (limited to 'src') 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 #include @@ -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. -- cgit v1.2.3 From b66bc399aed8b307a27781c97585a09888d8692f Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 15 Jun 2017 13:38:43 +0200 Subject: testlib: print out milliseconds for datetime Task-number: QTBUG-32555 Change-Id: I9219c8a7199d4db27c3d160de2544f0a7cb320a6 Reviewed-by: Mitch Curtis Reviewed-by: Edward Welbourne --- src/qmltest/quicktestresult.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index c4fb2b0f5f..8c62196128 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -518,6 +518,12 @@ void QuickTestResult::stringify(QQmlV4Function *args) result = QString::fromLatin1("Qt.url(%1)").arg(url.toString()); break; } + case QVariant::DateTime: + { + QDateTime dt = v.value(); + result = dt.toString(Qt::ISODateWithMs); + break; + } default: result = v.toString(); } -- cgit v1.2.3 From 3fc212f7cad26e310e3f560a9416ad4dfbcaca00 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 16 Jun 2017 10:12:59 +0200 Subject: Doc: Enclose regular expressions with \badcode Without them, qdoc tries to parse the backslashes as qdoc commands: src/quick/util/qquickvalidator.cpp:231: warning: Unknown command '\d' Change-Id: I36322586c477822f7efbae8b80adaee177c7ca44 Reviewed-by: Venugopal Shivashankar --- src/quick/util/qquickvalidator.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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 */ -- cgit v1.2.3 From 1e0685136d0debb2a3b62d9f4650c95afe41913b Mon Sep 17 00:00:00 2001 From: Colin Ogilvie Date: Fri, 2 Jun 2017 11:37:09 +0100 Subject: Don't leak QQmlJavaScriptExpression errors Ensure any error is deleted when the expression is Change-Id: Ibbfd28f50279d4c66830b40c5c917eb8d98f266e Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlexpression.cpp | 1 - src/qml/qml/qqmljavascriptexpression.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3 From 4199572d64d46bfa2efdcf7c910e81e5b8fb5547 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Fri, 16 Jun 2017 22:51:57 +0300 Subject: Fix QML compiler crashes on big endian systems Commit be491913c036b148 changed QV4::CompiledData::Unit to use LEUInt32 structures internally, rather than native uints, however the generators were not updated at that time and still wrote native uints. Also initialize constants field of CompilationUnit to prevent crashes in unlink() where operator delete[] is called. Change-Id: Id6c6e6ad519c9927ba6027479689ecfde9ea86de Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Simon Hausmann --- src/qml/compiler/qqmlirbuilder.cpp | 8 ++++---- src/qml/compiler/qv4compileddata.cpp | 2 ++ src/qml/compiler/qv4compiler.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 57cb4c607c..03a71768d8 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(data + qmlUnit->offsetToObjects); + QV4::CompiledData::LEUInt32 *objectTable = reinterpret_cast(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(objectPtr + objectToWrite->offsetToFunctions); + QV4::CompiledData::LEUInt32 *functionsTable = reinterpret_cast(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(objectPtr + objectToWrite->offsetToSignals); + QV4::CompiledData::LEUInt32 *signalOffsetTable = reinterpret_cast(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(objectPtr + objectToWrite->offsetToNamedObjectsInComponent); + QV4::CompiledData::LEUInt32 *namedObjectInComponentPtr = reinterpret_cast(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 485a5e6fb7..db707061fe 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) @@ -239,6 +240,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 e32749bbf7..de1b835edb 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -335,29 +335,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(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 -- cgit v1.2.3 From 22b7ac33a10a2a9767664efece2e74a70d26c798 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 16 Jun 2017 08:03:45 +0200 Subject: Fix excessive recursion in renderer Change-Id: Iffee781932773fe22c7d946b532ba74492e1e2df Task-number: QTBUG-59789 Reviewed-by: Robin Burchell --- src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3 From 9ac29fcc88a49ef2ffa4639664c906c5d73b57c9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Jun 2017 17:43:54 +0200 Subject: Silence -Wuninitialized warning Task-number: QTBUG-61089 Change-Id: I8b1fb03d040b04b3b14f371bf1a5ba8c2318054f Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira (cherry picked from commit 784ea8c09d448a418b3128be8bee14d9535e36c9) --- src/qml/compiler/qv4instr_moth_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index dabda7bae8..5f46e90ec7 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -897,6 +897,8 @@ template struct InstrMeta { }; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wuninitialized") #define MOTH_INSTR_META_TEMPLATE(I, FMT) \ template<> struct InstrMeta<(int)Instr::I> { \ enum { Size = MOTH_INSTR_SIZE(I, FMT) }; \ @@ -910,6 +912,7 @@ struct InstrMeta { }; FOR_EACH_MOTH_INSTR(MOTH_INSTR_META_TEMPLATE); #undef MOTH_INSTR_META_TEMPLATE +QT_WARNING_POP template class InstrData : public InstrMeta::DataType -- cgit v1.2.3 From 0e73e58f7e8afc4a31c02fe74ddbb3a6781d8144 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 16 Jun 2017 15:06:27 +0200 Subject: Doc: Fix link to Window.screen src/qml/qml/qqmlengine.cpp:455: warning: Can't link to 'QtQuick::Window::screen' Change-Id: I3f662ff574673d86ca048aec709948b236c17fd9 Reviewed-by: Nico Vertriest --- src/qml/qml/qqmlengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index f0564e7b33..ba22bfde76 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -590,7 +590,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} */ /*! -- cgit v1.2.3 From 03c2661b1243cc529fc3d8cfa65073f1da420307 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 22 Jun 2017 13:34:09 +0200 Subject: Fix alignment issue on ARMv7 As analyzed in the bug report, it appears that we may get QV4::CompiledData::Function pointers for writing that are not aligned for the 64-bit fields at the beginning. [ChangeLog][QtQml] Fix crash due to misaligned data structures on ARMv7 Task-number: QTBUG-61552 Change-Id: I6b2c166b725496150c8850475577628ccd811d65 Reviewed-by: Erik Verbruggen --- src/qml/compiler/qv4compiler.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index e32749bbf7..c32e1685a0 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -406,6 +406,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; -- cgit v1.2.3 From 8635fb9e0ca9a8a2bb5d42785c53ac4b4eb363b1 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 21 Jun 2017 11:20:14 +0200 Subject: Fix typo in QQuickWindow::setRenderTarget warning Change-Id: Idc4521e142603ee37a71acdae63ec750fa970d71 Reviewed-by: Laszlo Agocs --- src/quick/items/qquickwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 433c5b25b1..31f367ed96 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -3428,7 +3428,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; } -- cgit v1.2.3 From dfce0a8feceeb7156eba6ac5d8d3521e3009a583 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 21 Jun 2017 09:03:22 +0200 Subject: Support non-integer pixel-ratio in QQuickWidget Non-integer pixel-ratios always resulted in blurry rendering when QQuickWidget was used, but not with QQuickWindow. Fixed by reading qreal accessor of devicePixelRatio instead. Change-Id: I49f5efcf2da2efc090c00017e68c99c857cd84ef Task-number: QTBUG-61502 Reviewed-by: Laszlo Agocs --- src/quickwidgets/qquickwidget.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3 From 768c4b4526b1e6340587d72b985005da786a8494 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 23 Jun 2017 14:20:50 +0200 Subject: YarrOp: Initialize members Fix GCC 7 warnings: 3rdparty\masm\yarr\YarrJIT.cpp:455:12: error: '.JSC::Yarr::YarrGenerator<(JSC::Yarr::YarrJITCompileMode)1>::YarrOp::m_alternative' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3rdparty\masm\yarr\YarrJIT.cpp:455:12: error: '.JSC::Yarr::YarrGenerator<(JSC::Yarr::YarrJITCompileMode)1>::YarrOp::m_previousOp' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3rdparty\masm\yarr\YarrJIT.cpp:455:12: error: '.JSC::Yarr::YarrGenerator<(JSC::Yarr::YarrJITCompileMode)1>::YarrOp::m_nextOp' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3rdparty\masm\yarr\YarrJIT.cpp:455:12: error: '.JSC::Yarr::YarrGenerator<(JSC::Yarr::YarrJITCompileMode)1>::YarrOp::m_term' may be used uninitialized in this function [-Werror=maybe-uninitialized] Task-number: QTBUG-61558 Change-Id: I661f5455dd4cd57797d09edde9e097e17fb98dae Reviewed-by: Simon Hausmann --- src/3rdparty/masm/yarr/YarrJIT.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3 From 45420ef4b06b6039ac09f813c964c1b037a485f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 23 Jun 2017 14:31:01 +0200 Subject: Yarr: Add Q_FALLTHROUGH to fallthroughs detected by GCC 7 Change-Id: I99dcca18155eeef1fdaec8d7693a6a415a68b55b Reviewed-by: Simon Hausmann --- src/3rdparty/masm/yarr/YarrParser.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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()); -- cgit v1.2.3 From 5c80b29e6d77f0ebc63832473159f5a39babe21b Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Fri, 23 Jun 2017 23:26:35 +0200 Subject: QQmlXMLHttpRequest: support sending ArrayBuffer data The XMLHttpRequest.send() method should be able to send arbitrary binary data, and not just UTF-8 text: with this change we first attempt to use the parameter to the send() method as an ArrayBuffer, and fall back to a QString if that fails. [ChangeLog][QtQml] Allow sending binary data, encoded as ArrayBuffer objects, via XMLHttpRequest's send() method. Task-number: QTBUG-61599 Change-Id: I25781969ee39b4d168e5c76315ed9853092b322b Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlxmlhttprequest.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 9e8735cbc6..113ef0c412 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -1823,8 +1823,13 @@ void QQmlXMLHttpRequestCtor::method_send(const QV4::BuiltinFunction *, QV4::Scop THROW_DOM(DOMEXCEPTION_INVALID_STATE_ERR, "Invalid state"); QByteArray data; - if (callData->argc > 0) - data = callData->args[0].toQStringNoThrow().toUtf8(); + if (callData->argc > 0) { + if (const ArrayBuffer *buffer = callData->args[0].as()) { + data = buffer->asByteArray(); + } else { + data = callData->args[0].toQStringNoThrow().toUtf8(); + } + } scope.result = r->send(w, scope.engine->callingQmlContext(), data); } -- cgit v1.2.3 From 2969c92c82e67beb592542cb34a3cbd65ed2fb16 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 27 Jun 2017 15:21:53 +0200 Subject: Do not access the qle_bitfield internals directly This make is impossible to make it private. The uses here also set the internal value multiple times as each part of the union shares the internal. Change-Id: I5db5bf6dd930c09b2aa169371b8d989acfcc00e5 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compileddata_p.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index f4ba257cf5..ff0d597b92 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -129,11 +129,12 @@ struct TableIterator struct Location { union { + quint32 _dummy; QJsonPrivate::qle_bitfield<0, 20> line; QJsonPrivate::qle_bitfield<20, 12> column; }; - Location() { line.val = 0; column.val = 0; } + Location() : _dummy(0) { } inline bool operator<(const Location &other) const { return line < other.line || @@ -149,11 +150,12 @@ struct RegExp RegExp_Multiline = 0x04 }; union { + quint32 _dummy; QJsonPrivate::qle_bitfield<0, 4> flags; QJsonPrivate::qle_bitfield<4, 28> stringIndex; }; - RegExp() { flags.val = 0; stringIndex.val = 0; } + RegExp() : _dummy(0) { } }; struct Lookup @@ -167,21 +169,23 @@ struct Lookup }; union { + quint32 _dummy; QJsonPrivate::qle_bitfield<0, 4> type_and_flags; QJsonPrivate::qle_bitfield<4, 28> nameIndex; }; - Lookup() { type_and_flags.val = 0; nameIndex.val = 0; } + Lookup() : _dummy(0) { } }; struct JSClassMember { union { + quint32 _dummy; QJsonPrivate::qle_bitfield<0, 31> nameOffset; QJsonPrivate::qle_bitfield<31, 1> isAccessor; }; - JSClassMember() { nameOffset = 0; isAccessor = 0; } + JSClassMember() : _dummy(0) { } }; struct JSClass -- cgit v1.2.3 From a813d8a4d87e22a87722fada10710711b1d4306f Mon Sep 17 00:00:00 2001 From: Marco Benelli Date: Thu, 8 Jun 2017 16:18:08 +0200 Subject: QtQml: restore models definitions in qmltypes Regenerated plugins.qmltypes with the -noforceqtquick option added to qmlplugindump. In this way some definitions (eg ObjectModel) are restored. Change-Id: I294ab673b395fc50d8851614fd5801ed121d5b13 Reviewed-by: J-P Nurmi Reviewed-by: Thomas Hartmann --- src/imports/models/plugins.qmltypes | 468 +++++++++++++++++++++++++++++++++++- 1 file changed, 466 insertions(+), 2 deletions(-) (limited to 'src') 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" } + } + 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" } + Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } + } + Signal { + name: "layoutChanged" + Parameter { name: "parents"; type: "QList" } + } + Signal { name: "layoutChanged" } + Signal { + name: "layoutAboutToBeChanged" + Parameter { name: "parents"; type: "QList" } + Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } + } + Signal { + name: "layoutAboutToBeChanged" + Parameter { name: "parents"; type: "QList" } + } + 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 } + } } -- cgit v1.2.3 From 95f6dcbae17b72c8dfebc9f97c77310151b63ceb Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 17 May 2017 22:28:13 +0200 Subject: Fix ObjectModel::move() to mark the changes as moves QQmlObjectModel::move() created a QQmlChangeSet with moveId -1, which made item views and controls see the changes as removals and insertions, because QQmlChangeSet::Change::isMove() returned false. Consequently, item views did not update the current index when the current item was moved. Task-number: QTBUG-60894 Change-Id: I4a64b7670c1fae12337995627437cc83efb9f1ef Reviewed-by: Michael Brasser Reviewed-by: Robin Burchell --- src/qml/types/qqmlobjectmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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(); } -- cgit v1.2.3 From 5c221826025276aea5ee19275f350a28e02db254 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 30 Jun 2017 11:53:30 +0200 Subject: doc: Add font.hintingPreference to font type documentation The docs for this was added to the font property documentation in Text/TextEdit/TextInput, but not to the main font QML type documentation. Change-Id: I579706bea77b6fcd3972921c34b7693bf686ba31 Reviewed-by: Simon Hausmann --- src/quick/doc/src/qmltypereference.qdoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index 2406722dbc..b0aa143505 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -170,6 +170,7 @@ available when you import \c QtQuick. \li \l enumeration \c font.capitalization \li \l real \c font.letterSpacing \li \l real \c font.wordSpacing + \li \l enumeration \c font.hintingPreference \endlist Example: @@ -236,6 +237,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} */ -- cgit v1.2.3 From 441e0b41bf5b700cdaa3b0ba2393c487ed4b9de5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 30 Jun 2017 10:07:29 +0200 Subject: Expose "kerning" property for fonts For text where the content is known, it can be handy to be able to disable the kerning feature in OpenType to improve performance. [ChangeLog][Qt Quick][Text] Added "kerning" property to the font type to support disabling kerning on text. Task-number: QTBUG-56728 Change-Id: I2e447587a066a7e12c5d38967e0845eaad021014 Reviewed-by: Simon Hausmann --- src/quick/doc/src/qmltypereference.qdoc | 1 + src/quick/items/qquicktext.cpp | 13 +++++++++++++ src/quick/items/qquicktextedit.cpp | 13 +++++++++++++ src/quick/items/qquicktextinput.cpp | 13 +++++++++++++ src/quick/util/qquickglobal.cpp | 5 +++++ src/quick/util/qquickvaluetypes.cpp | 10 ++++++++++ src/quick/util/qquickvaluetypes_p.h | 4 ++++ 7 files changed, 59 insertions(+) (limited to 'src') diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc index 2406722dbc..cbcf945a11 100644 --- a/src/quick/doc/src/qmltypereference.qdoc +++ b/src/quick/doc/src/qmltypereference.qdoc @@ -170,6 +170,7 @@ available when you import \c QtQuick. \li \l enumeration \c font.capitalization \li \l real \c font.letterSpacing \li \l real \c font.wordSpacing + \li \l bool \c font.kerning \endlist Example: diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 080cc9412e..1bcfbd41f7 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -1499,6 +1499,19 @@ QQuickText::~QQuickText() Text { text: "Hello"; renderType: Text.NativeRendering; font.hintingPreference: Font.PreferVerticalHinting } \endqml */ + +/*! + \qmlproperty bool QtQuick::Text::font.kerning + \since 5.10 + + Enables or disables the kerning OpenType feature when shaping the text. This may improve performance + when creating or changing the text, at the expense of some cosmetic features. The default value + is true. + + \qml + Text { text: "OATS FLAVOUR WAY"; font.kerning: false } + \endqml +*/ QFont QQuickText::font() const { Q_D(const QQuickText); diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index 61d610520f..aad380ca30 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -355,6 +355,19 @@ QString QQuickTextEdit::text() const \endqml */ +/*! + \qmlproperty bool QtQuick::TextEdit::font.kerning + \since 5.10 + + Enables or disables the kerning OpenType feature when shaping the text. This may improve performance + when creating or changing the text, at the expense of some cosmetic features. The default value + is true. + + \qml + Text { text: "OATS FLAVOUR WAY"; kerning: font.false } + \endqml +*/ + /*! \qmlproperty string QtQuick::TextEdit::text diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index a378359c95..d485083820 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -378,6 +378,19 @@ QString QQuickTextInputPrivate::realText() const TextInput { text: "Hello"; renderType: TextInput.NativeRendering; font.hintingPreference: Font.PreferVerticalHinting } \endqml */ + +/*! + \qmlproperty bool QtQuick::TextInput::font.kerning + \since 5.10 + + Enables or disables the kerning OpenType feature when shaping the text. This may improve performance + when creating or changing the text, at the expense of some cosmetic features. The default value + is true. + + \qml + Text { text: "OATS FLAVOUR WAY"; font.kerning: false } + \endqml +*/ QFont QQuickTextInput::font() const { Q_D(const QQuickTextInput); diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 1d2f3de1df..6df23cdff5 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -302,6 +302,7 @@ public: QV4::ScopedValue vweight(scope, obj->get((s = v4->newString(QStringLiteral("weight"))))); QV4::ScopedValue vwspac(scope, obj->get((s = v4->newString(QStringLiteral("wordSpacing"))))); QV4::ScopedValue vhint(scope, obj->get((s = v4->newString(QStringLiteral("hintingPreference"))))); + QV4::ScopedValue vkerning(scope, obj->get((s = v4->newString(QStringLiteral("kerning"))))); // pull out the values, set ok to true if at least one valid field is given. if (vbold->isBoolean()) { @@ -356,6 +357,10 @@ public: retn.setHintingPreference(static_cast(vhint->integerValue())); if (ok) *ok = true; } + if (vkerning->isBoolean()) { + retn.setKerning(vkerning->booleanValue()); + if (ok) *ok = true; + } return retn; } diff --git a/src/quick/util/qquickvaluetypes.cpp b/src/quick/util/qquickvaluetypes.cpp index 4d34c6d661..bc4a72b6ea 100644 --- a/src/quick/util/qquickvaluetypes.cpp +++ b/src/quick/util/qquickvaluetypes.cpp @@ -757,6 +757,16 @@ void QQuickFontValueType::setHintingPreference(QQuickFontValueType::HintingPrefe v.setHintingPreference(QFont::HintingPreference(hintingPreference)); } +bool QQuickFontValueType::kerning() const +{ + return v.kerning(); +} + +void QQuickFontValueType::setKerning(bool b) +{ + v.setKerning(b); +} + QT_END_NAMESPACE #include "moc_qquickvaluetypes_p.cpp" diff --git a/src/quick/util/qquickvaluetypes_p.h b/src/quick/util/qquickvaluetypes_p.h index 4a1598ec5c..a3f35a84ec 100644 --- a/src/quick/util/qquickvaluetypes_p.h +++ b/src/quick/util/qquickvaluetypes_p.h @@ -323,6 +323,7 @@ class QQuickFontValueType Q_PROPERTY(qreal letterSpacing READ letterSpacing WRITE setLetterSpacing FINAL) Q_PROPERTY(qreal wordSpacing READ wordSpacing WRITE setWordSpacing FINAL) Q_PROPERTY(HintingPreference hintingPreference READ hintingPreference WRITE setHintingPreference FINAL) + Q_PROPERTY(bool kerning READ kerning WRITE setKerning FINAL) public: enum FontWeight { Thin = QFont::Thin, @@ -393,6 +394,9 @@ public: HintingPreference hintingPreference() const; void setHintingPreference(HintingPreference); + + bool kerning() const; + void setKerning(bool b); }; QT_END_NAMESPACE -- cgit v1.2.3 From 98a71c7739a91be03b73312253dd1291e0a1d96d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 1 Jul 2017 14:11:34 -0700 Subject: Suppress warning about QSignalMapper being deprecated It is since qtbase commit 29bcbeab90210da80234529905d17280374f9684. Change-Id: I8d96dea9955d4c749b99fffd14cd512a8ff88a74 Reviewed-by: Simon Hausmann --- src/quick/items/qquickgenericshadereffect.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/quick/items/qquickgenericshadereffect.cpp b/src/quick/items/qquickgenericshadereffect.cpp index b366071962..305ef7e778 100644 --- a/src/quick/items/qquickgenericshadereffect.cpp +++ b/src/quick/items/qquickgenericshadereffect.cpp @@ -546,7 +546,10 @@ void QQuickGenericShaderEffect::updateShaderVars(Shader shaderType) // Have a QSignalMapper that emits mapped() with an index+type on each property change notify signal. auto &sm(m_signalMappers[shaderType][i]); if (!sm.mapper) { +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED sm.mapper = new QSignalMapper; +QT_WARNING_POP sm.mapper->setMapping(m_item, i | (shaderType << 16)); } sm.active = true; -- cgit v1.2.3 From f6cc21f08441f1aa6fa0c4acd9e41efedb4e3823 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Tue, 20 Jun 2017 11:56:58 +0200 Subject: Doc: Add \keyword for "Grouped" and "Attached" property topics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This enables searching the index list for the \keyword in Qt Creator Change-Id: Ic8fde82def48c4d0f4cbf0e75bc862e00ca3ca65 Reviewed-by: Topi Reiniö --- src/qml/doc/src/cppintegration/definetypes.qdoc | 4 ++-- src/qml/doc/src/cppintegration/exposecppattributes.qdoc | 1 + src/qml/doc/src/qmlfunctions.qdoc | 2 +- src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc | 3 +-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/qml/doc/src/cppintegration/definetypes.qdoc b/src/qml/doc/src/cppintegration/definetypes.qdoc index 32084bd308..1ce00c6ad0 100644 --- a/src/qml/doc/src/cppintegration/definetypes.qdoc +++ b/src/qml/doc/src/cppintegration/definetypes.qdoc @@ -346,8 +346,8 @@ demonstrates a usage of extension objects. \section1 Defining QML-Specific Types and Attributes - -\section2 Providing Attached Objects for Data Annotations +\section2 Providing Attached Properties +\keyword Integrating QML and C++ - Attached Properties In the QML language syntax, there is a notion of \l{Attached properties and attached signal handlers}{\e {attached properties} and \e {attached signal diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc index c4c58c2821..2121c1f291 100644 --- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc +++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc @@ -301,6 +301,7 @@ Note that the template class type for the QQmlListProperty — in this case, \section2 Grouped Properties +\keyword Integrating QML and C++ - Grouped Properties Any read-only object-type property is accessible from QML code as a \e {grouped property}. This can be used to expose a group of related diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc index 834684fe6d..e73f1cb59c 100644 --- a/src/qml/doc/src/qmlfunctions.qdoc +++ b/src/qml/doc/src/qmlfunctions.qdoc @@ -354,7 +354,7 @@ Returns 0 if type \e T is not a valid attaching type, or if \a create is false and no attachment object instance has previously been created for \a attachee. - \sa {Providing Attached Objects for Data Annotations} + \sa {Providing Attached Properties} */ diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc index 33f58dc1b9..df65a0942f 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc @@ -856,8 +856,7 @@ are otherwise unavailable to the object. In particular, they allow objects to access properties or signals that are specifically relevant to the individual object. -A QML type implementation may choose to \l {Providing Attached Objects for -Data Annotations}{create an \e {attaching type} in C++} with +A QML type implementation may choose to \l {Providing Attached Properties}{create an \e {attaching type} in C++} with particular properties and signals. Instances of this type can then be created and \e attached to specific objects at run time, allowing those objects to access the properties and signals of the attaching type. These are accessed by -- cgit v1.2.3 From fd295c5047095806db2015a978ed593a140ff373 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 4 Jul 2017 10:59:28 +0200 Subject: doc: Use correct class in docs for font.kerning Copy-pasted the docs for Text.font.kerning into TextEdit and TextInput and forgot to change the class name in the example. Amends 441e0b41bf5b700cdaa3b0ba2393c487ed4b9de5. Task-number: QTBUG-56728 Change-Id: Ieab27efb51fa702d83b891e3c7b7aeb5e4795fc5 Reviewed-by: Simon Hausmann --- src/quick/items/qquicktextedit.cpp | 2 +- src/quick/items/qquicktextinput.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index aad380ca30..aec8666dc4 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -364,7 +364,7 @@ QString QQuickTextEdit::text() const is true. \qml - Text { text: "OATS FLAVOUR WAY"; kerning: font.false } + TextEdit { text: "OATS FLAVOUR WAY"; kerning: font.false } \endqml */ diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index d485083820..49f574156a 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -388,7 +388,7 @@ QString QQuickTextInputPrivate::realText() const is true. \qml - Text { text: "OATS FLAVOUR WAY"; font.kerning: false } + TextInput { text: "OATS FLAVOUR WAY"; font.kerning: false } \endqml */ QFont QQuickTextInput::font() const -- cgit v1.2.3 From 759d8bb3c2c5e10381534bcb652900afaf7aca96 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 6 Jul 2017 09:18:20 +0200 Subject: Update QtQuick 2 plugins.qmltypes Change-Id: Ic86891dbd65acc9db7a467960884c036abd0f987 Reviewed-by: Marco Benelli --- src/imports/qtquick2/plugins.qmltypes | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes index 73d6d8ec68..d23d6cc311 100644 --- a/src/imports/qtquick2/plugins.qmltypes +++ b/src/imports/qtquick2/plugins.qmltypes @@ -1807,6 +1807,7 @@ Module { Property { name: "letterSpacing"; type: "double" } Property { name: "wordSpacing"; type: "double" } Property { name: "hintingPreference"; type: "HintingPreference" } + Property { name: "kerning"; type: "bool" } Method { name: "toString"; type: "string" } } Component { @@ -1823,6 +1824,7 @@ Module { exports: ["QtQuick/Gradient 2.0"] exportMetaObjectRevisions: [0] Property { name: "stops"; type: "QQuickGradientStop"; isList: true; isReadonly: true } + Signal { name: "updated" } } Component { name: "QQuickGradientStop" @@ -3079,8 +3081,8 @@ Module { Component { name: "QQuickPathArc" prototype: "QQuickCurve" - exports: ["QtQuick/PathArc 2.0"] - exportMetaObjectRevisions: [0] + exports: ["QtQuick/PathArc 2.0", "QtQuick/PathArc 2.9"] + exportMetaObjectRevisions: [0, 2] Enum { name: "ArcDirection" values: { @@ -3092,6 +3094,8 @@ Module { Property { name: "radiusY"; type: "double" } Property { name: "useLargeArc"; type: "bool" } Property { name: "direction"; type: "ArcDirection" } + Property { name: "xAxisRotation"; revision: 2; type: "double" } + Signal { name: "xAxisRotationChanged"; revision: 2 } } Component { name: "QQuickPathAttribute" @@ -3143,6 +3147,12 @@ Module { exports: ["QtQuick/PathLine 2.0"] exportMetaObjectRevisions: [0] } + Component { + name: "QQuickPathMove" + prototype: "QQuickCurve" + exports: ["QtQuick/PathMove 2.9"] + exportMetaObjectRevisions: [0] + } Component { name: "QQuickPathPercent" prototype: "QQuickPathElement" -- cgit v1.2.3 From 96ba4222f9654cae43f40f8cabfa689725bb2b1b Mon Sep 17 00:00:00 2001 From: Marco Benelli Date: Thu, 6 Jul 2017 08:53:14 +0200 Subject: Update plugins.qmltypes for Shapes Update qmltypes forcing the dependency to QtQuick in order to avoid the dumping of duplicated QtQuick's components. Change-Id: Ie16f21518076d0af1c744e420d689122fafb485e Reviewed-by: Thomas Hartmann --- src/imports/shapes/plugins.qmltypes | 217 +++++------------------------------- 1 file changed, 25 insertions(+), 192 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/plugins.qmltypes b/src/imports/shapes/plugins.qmltypes index 00d0050085..c7c079991d 100644 --- a/src/imports/shapes/plugins.qmltypes +++ b/src/imports/shapes/plugins.qmltypes @@ -4,196 +4,13 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable -noforceqtquick QtQuick.Shapes 1.0' +// 'qmlplugindump -nonrelocatable QtQuick.Shapes 1.0' Module { - dependencies: [] - Component { - name: "QQuickItem" - defaultProperty: "data" - prototype: "QObject" - Enum { - name: "TransformOrigin" - values: { - "TopLeft": 0, - "Top": 1, - "TopRight": 2, - "Left": 3, - "Center": 4, - "Right": 5, - "BottomLeft": 6, - "Bottom": 7, - "BottomRight": 8 - } - } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "state"; type: "string" } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "implicitWidth"; type: "double" } - Property { name: "implicitHeight"; type: "double" } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } - Component { - name: "QQuickShapeGradient" - defaultProperty: "stops" - prototype: "QObject" - exports: ["QtQuick.Shapes/ShapeGradient 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "SpreadMode" - values: { - "PadSpread": 0, - "RepeatSpread": 1, - "ReflectSpread": 2 - } - } - Property { name: "stops"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "spread"; type: "SpreadMode" } - Signal { name: "updated" } - } + dependencies: ["QtQuick 2.8"] Component { name: "QQuickShape" - defaultProperty: "elements" + defaultProperty: "data" prototype: "QQuickItem" exports: ["QtQuick.Shapes/Shape 1.0"] exportMetaObjectRevisions: [0] @@ -216,9 +33,26 @@ Module { } Property { name: "renderer"; type: "RendererType"; isReadonly: true } Property { name: "asynchronous"; type: "bool" } - Property { name: "enableVendorExtensions"; type: "bool" } + Property { name: "vendorExtensionsEnabled"; type: "bool" } Property { name: "status"; type: "Status"; isReadonly: true } - Property { name: "elements"; type: "QQuickShapePath"; isList: true; isReadonly: true } + Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } + } + Component { + name: "QQuickShapeGradient" + defaultProperty: "stops" + prototype: "QQuickGradient" + exports: ["QtQuick.Shapes/ShapeGradient 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "SpreadMode" + values: { + "PadSpread": 0, + "RepeatSpread": 1, + "ReflectSpread": 2 + } + } + Property { name: "spread"; type: "SpreadMode" } } Component { name: "QQuickShapeLinearGradient" @@ -233,8 +67,8 @@ Module { } Component { name: "QQuickShapePath" - defaultProperty: "path" - prototype: "QObject" + defaultProperty: "pathElements" + prototype: "QQuickPath" exports: ["QtQuick.Shapes/ShapePath 1.0"] exportMetaObjectRevisions: [0] Enum { @@ -267,7 +101,6 @@ Module { "DashLine": 2 } } - Property { name: "path"; type: "QQuickPath"; isPointer: true } Property { name: "strokeColor"; type: "QColor" } Property { name: "strokeWidth"; type: "double" } Property { name: "fillColor"; type: "QColor" } @@ -279,6 +112,6 @@ Module { Property { name: "dashOffset"; type: "double" } Property { name: "dashPattern"; type: "QVector" } Property { name: "fillGradient"; type: "QQuickShapeGradient"; isPointer: true } - Signal { name: "changed" } + Signal { name: "shapePathChanged" } } } -- cgit v1.2.3 From df26542db1eddbcb8a92cce8a38eaa6dc9fa5990 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 6 Jul 2017 09:18:00 +0200 Subject: shapes: Remove componentComplete from QQuickShapePrivate QQuickItemPrivate already has the member componentComplete. Duplicating this breaks QQuickItem::isComponentComplete(), which is used in Qt Quick Designer. For this reason QQuickShape was never completed in Qt Quick Designer. This patch fixes the issue. Change-Id: I30201ff5fb17282dab99a8c84182c6fb6e183134 Reviewed-by: Laszlo Agocs --- src/imports/shapes/qquickshape.cpp | 3 +-- src/imports/shapes/qquickshape_p_p.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/qquickshape.cpp b/src/imports/shapes/qquickshape.cpp index 1054af30de..666ed4e595 100644 --- a/src/imports/shapes/qquickshape.cpp +++ b/src/imports/shapes/qquickshape.cpp @@ -638,8 +638,7 @@ void QQuickShapePath::resetFillGradient() */ QQuickShapePrivate::QQuickShapePrivate() - : componentComplete(true), - spChanged(false), + : spChanged(false), rendererType(QQuickShape::UnknownRenderer), async(false), status(QQuickShape::Null), diff --git a/src/imports/shapes/qquickshape_p_p.h b/src/imports/shapes/qquickshape_p_p.h index 888488efcd..dc62994af2 100644 --- a/src/imports/shapes/qquickshape_p_p.h +++ b/src/imports/shapes/qquickshape_p_p.h @@ -177,7 +177,6 @@ public: static QQuickShapePrivate *get(QQuickShape *item) { return item->d_func(); } - bool componentComplete; bool spChanged; QQuickShape::RendererType rendererType; bool async; -- cgit v1.2.3 From 6d471d6ec79c10e564f2c05bfac7ffab3560f54d Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 4 Jul 2017 12:27:24 +0200 Subject: QQuickFBO: Keep devicePixelRatio qreal as long as possible Task-number: QTBUG-61686 Change-Id: I9637be13f701d32d87a42fc4ae0f013b8843503e Reviewed-by: Andy Shaw Reviewed-by: Allan Sandfeld Jensen --- src/quick/items/qquickframebufferobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp index 52b19d994c..3c00e956cc 100644 --- a/src/quick/items/qquickframebufferobject.cpp +++ b/src/quick/items/qquickframebufferobject.cpp @@ -260,7 +260,7 @@ public: bool renderPending; bool invalidatePending; - int devicePixelRatio; + qreal devicePixelRatio; }; static inline bool isOpenGL(QSGRenderContext *rc) -- cgit v1.2.3 From 8ee40ea18185f9030c7596a3e2c20dd1c3aeeb48 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 6 Jul 2017 10:53:02 +0200 Subject: shape: Call base impl for componentComplete ...and classBegin(). Change-Id: Ie6b4a53c32044d17ce1beb5415a830683c2b513f Reviewed-by: J-P Nurmi --- src/imports/shapes/qquickshape.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/qquickshape.cpp b/src/imports/shapes/qquickshape.cpp index 666ed4e595..d81f560315 100644 --- a/src/imports/shapes/qquickshape.cpp +++ b/src/imports/shapes/qquickshape.cpp @@ -846,14 +846,14 @@ QQmlListProperty QQuickShape::data() void QQuickShape::classBegin() { - Q_D(QQuickShape); - d->componentComplete = false; + QQuickItem::classBegin(); } void QQuickShape::componentComplete() { Q_D(QQuickShape); - d->componentComplete = true; + + QQuickItem::componentComplete(); for (QQuickShapePath *p : d->qmlData.sp) connect(p, SIGNAL(shapePathChanged()), this, SLOT(_q_shapePathChanged())); -- cgit v1.2.3 From 336ecf47667a020376c72a192f195c277931d75a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 28 Jun 2017 12:51:33 +0200 Subject: Refactor le integer types from qjson_p.h to qendian_p.h Change-Id: Ibb24b0a55dd94e03fea3104e8af5ddb266004300 Reviewed-by: Simon Hausmann --- src/qml/compiler/qqmlirbuilder.cpp | 12 +- src/qml/compiler/qv4compileddata.cpp | 4 +- src/qml/compiler/qv4compileddata_p.h | 257 +++++++++++++++---------------- src/qml/compiler/qv4compiler.cpp | 22 +-- src/qml/compiler/qv4compiler_p.h | 4 +- src/qml/jsruntime/qv4function.cpp | 6 +- src/qml/qml/qqmljavascriptexpression.cpp | 6 +- src/qml/qml/qqmlobjectcreator.cpp | 2 +- 8 files changed, 153 insertions(+), 160 deletions(-) (limited to 'src') diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index e80b9d8ac4..df615e6804 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 - QV4::CompiledData::LEUInt32 *objectTable = reinterpret_cast(data + qmlUnit->offsetToObjects); + quint32_le *objectTable = reinterpret_cast(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); - QV4::CompiledData::LEUInt32 *functionsTable = reinterpret_cast(objectPtr + objectToWrite->offsetToFunctions); + quint32_le *functionsTable = reinterpret_cast(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())); - QV4::CompiledData::LEUInt32 *signalOffsetTable = reinterpret_cast(objectPtr + objectToWrite->offsetToSignals); + quint32_le *signalOffsetTable = reinterpret_cast(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; } - QV4::CompiledData::LEUInt32 *namedObjectInComponentPtr = reinterpret_cast(objectPtr + objectToWrite->offsetToNamedObjectsInComponent); + quint32_le *namedObjectInComponentPtr = reinterpret_cast(objectPtr + objectToWrite->offsetToNamedObjectsInComponent); for (int i = 0; i < o->namedObjectsInComponent.count; ++i) { *namedObjectInComponentPtr++ = o->namedObjectsInComponent.at(i); } @@ -2225,7 +2225,7 @@ QmlIR::Object *IRLoader::loadObject(const QV4::CompiledData::Object *serializedO QQmlJS::Engine *jsParserEngine = &output->jsParserEngine; - const QV4::CompiledData::LEUInt32 *functionIdx = serializedObject->functionOffsetTable(); + const quint32_le *functionIdx = serializedObject->functionOffsetTable(); for (uint i = 0; i < serializedObject->nFunctions; ++i, ++functionIdx) { QmlIR::Function *f = pool->New(); const QV4::CompiledData::Function *compiledFunction = unit->functionAt(*functionIdx); @@ -2236,7 +2236,7 @@ QmlIR::Object *IRLoader::loadObject(const QV4::CompiledData::Object *serializedO f->nameIndex = compiledFunction->nameIndex; QQmlJS::AST::FormalParameterList *paramList = 0; - const QV4::CompiledData::LEUInt32 *formalNameIdx = compiledFunction->formalsTable(); + const quint32_le *formalNameIdx = compiledFunction->formalsTable(); for (uint i = 0; i < compiledFunction->nFormals; ++i, ++formalNameIdx) { const QString formal = unit->stringAt(*formalNameIdx); QStringRef paramNameRef = jsParserEngine->newStringRef(formal); diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 94abf416a1..be7429df41 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -187,7 +187,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine) #if Q_BYTE_ORDER == Q_BIG_ENDIAN Value *bigEndianConstants = new Value[data->constantTableSize]; - const LEUInt64 *littleEndianConstants = data->constants(); + const quint64_le *littleEndianConstants = data->constants(); for (uint i = 0; i < data->constantTableSize; ++i) bigEndianConstants[i] = Value::fromReturnedValue(littleEndianConstants[i]); constants = bigEndianConstants; @@ -271,7 +271,7 @@ IdentifierHash CompilationUnit::namedObjectsPerComponent(int componentObjec if (it == namedObjectsPerComponentCache.end()) { IdentifierHash namedObjectCache(engine); const CompiledData::Object *component = data->objectAt(componentObjectIndex); - const LEUInt32 *namedObjectIndexPtr = component->namedObjectsInComponentTable(); + const quint32_le *namedObjectIndexPtr = component->namedObjectsInComponentTable(); for (quint32 i = 0; i < component->nNamedObjectsInComponent; ++i, ++namedObjectIndexPtr) { const CompiledData::Object *namedObject = data->objectAt(*namedObjectIndexPtr); namedObjectCache.add(runtimeStrings[namedObject->idNameIndex], namedObject->id); diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index ff0d597b92..876244437e 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -62,7 +62,7 @@ #include #include #include -#include +#include #ifndef V4_BOOTSTRAP #include #include @@ -96,13 +96,6 @@ class CompilationUnitMapper; namespace CompiledData { -typedef QJsonPrivate::q_littleendian LEInt16; -typedef QJsonPrivate::q_littleendian LEUInt16; -typedef QJsonPrivate::q_littleendian LEUInt32; -typedef QJsonPrivate::q_littleendian LEInt32; -typedef QJsonPrivate::q_littleendian LEUInt64; -typedef QJsonPrivate::q_littleendian LEInt64; - struct String; struct Function; struct Lookup; @@ -130,8 +123,8 @@ struct Location { union { quint32 _dummy; - QJsonPrivate::qle_bitfield<0, 20> line; - QJsonPrivate::qle_bitfield<20, 12> column; + quint32_le_bitfield<0, 20> line; + quint32_le_bitfield<20, 12> column; }; Location() : _dummy(0) { } @@ -151,8 +144,8 @@ struct RegExp }; union { quint32 _dummy; - QJsonPrivate::qle_bitfield<0, 4> flags; - QJsonPrivate::qle_bitfield<4, 28> stringIndex; + quint32_le_bitfield<0, 4> flags; + quint32_le_bitfield<4, 28> stringIndex; }; RegExp() : _dummy(0) { } @@ -170,8 +163,8 @@ struct Lookup union { quint32 _dummy; - QJsonPrivate::qle_bitfield<0, 4> type_and_flags; - QJsonPrivate::qle_bitfield<4, 28> nameIndex; + quint32_le_bitfield<0, 4> type_and_flags; + quint32_le_bitfield<4, 28> nameIndex; }; Lookup() : _dummy(0) { } @@ -181,8 +174,8 @@ struct JSClassMember { union { quint32 _dummy; - QJsonPrivate::qle_bitfield<0, 31> nameOffset; - QJsonPrivate::qle_bitfield<31, 1> isAccessor; + quint32_le_bitfield<0, 31> nameOffset; + quint32_le_bitfield<31, 1> isAccessor; }; JSClassMember() : _dummy(0) { } @@ -190,7 +183,7 @@ struct JSClassMember struct JSClass { - LEUInt32 nMembers; + quint32_le nMembers; // JSClassMember[nMembers] static int calculateSize(int nMembers) { return (sizeof(JSClass) + nMembers * sizeof(JSClassMember) + 7) & ~7; } @@ -198,7 +191,7 @@ struct JSClass struct String { - LEInt32 size; + qint32_le size; // uint16 strdata[] static int calculateSize(const QString &str) { @@ -221,24 +214,24 @@ struct Function // Absolute offset into file where the code for this function is located. Only used when the function // is serialized. - LEUInt64 codeOffset; - LEUInt64 codeSize; - - LEUInt32 nameIndex; - LEUInt32 nFormals; - LEUInt32 formalsOffset; - LEUInt32 nLocals; - LEUInt32 localsOffset; - LEUInt32 nInnerFunctions; + quint64_le codeOffset; + quint64_le codeSize; + + quint32_le nameIndex; + quint32_le nFormals; + quint32_le formalsOffset; + quint32_le nLocals; + quint32_le localsOffset; + quint32_le nInnerFunctions; Location location; // Qml Extensions Begin - LEUInt32 nDependingIdObjects; - LEUInt32 dependingIdObjectsOffset; // Array of resolved ID objects - LEUInt32 nDependingContextProperties; - LEUInt32 dependingContextPropertiesOffset; // Array of int pairs (property index and notify index) - LEUInt32 nDependingScopeProperties; - LEUInt32 dependingScopePropertiesOffset; // Array of int pairs (property index and notify index) + quint32_le nDependingIdObjects; + quint32_le dependingIdObjectsOffset; // Array of resolved ID objects + quint32_le nDependingContextProperties; + quint32_le dependingContextPropertiesOffset; // Array of int pairs (property index and notify index) + quint32_le nDependingScopeProperties; + quint32_le dependingScopePropertiesOffset; // Array of int pairs (property index and notify index) // Qml Extensions End // quint32 formalsIndex[nFormals] @@ -249,15 +242,15 @@ struct Function // Keep all unaligned data at the end quint8 flags; - const LEUInt32 *formalsTable() const { return reinterpret_cast(reinterpret_cast(this) + formalsOffset); } - const LEUInt32 *localsTable() const { return reinterpret_cast(reinterpret_cast(this) + localsOffset); } - const LEUInt32 *qmlIdObjectDependencyTable() const { return reinterpret_cast(reinterpret_cast(this) + dependingIdObjectsOffset); } - const LEUInt32 *qmlContextPropertiesDependencyTable() const { return reinterpret_cast(reinterpret_cast(this) + dependingContextPropertiesOffset); } - const LEUInt32 *qmlScopePropertiesDependencyTable() const { return reinterpret_cast(reinterpret_cast(this) + dependingScopePropertiesOffset); } + const quint32_le *formalsTable() const { return reinterpret_cast(reinterpret_cast(this) + formalsOffset); } + const quint32_le *localsTable() const { return reinterpret_cast(reinterpret_cast(this) + localsOffset); } + const quint32_le *qmlIdObjectDependencyTable() const { return reinterpret_cast(reinterpret_cast(this) + dependingIdObjectsOffset); } + const quint32_le *qmlContextPropertiesDependencyTable() const { return reinterpret_cast(reinterpret_cast(this) + dependingContextPropertiesOffset); } + const quint32_le *qmlScopePropertiesDependencyTable() const { return reinterpret_cast(reinterpret_cast(this) + dependingScopePropertiesOffset); } // --- QQmlPropertyCacheCreator interface - const LEUInt32 *formalsBegin() const { return formalsTable(); } - const LEUInt32 *formalsEnd() const { return formalsTable() + nFormals; } + const quint32_le *formalsBegin() const { return formalsTable(); } + const quint32_le *formalsEnd() const { return formalsTable() + nFormals; } // --- inline bool hasQmlDependencies() const { return nDependingIdObjects > 0 || nDependingContextProperties > 0 || nDependingScopeProperties > 0; } @@ -270,13 +263,13 @@ struct Function // Qml data structures struct Q_QML_EXPORT TranslationData { - LEUInt32 commentIndex; - LEInt32 number; + quint32_le commentIndex; + qint32_le number; }; struct Q_QML_PRIVATE_EXPORT Binding { - LEUInt32 propertyNameIndex; + quint32_le propertyNameIndex; enum ValueType : unsigned int { Type_Invalid, @@ -304,17 +297,17 @@ struct Q_QML_PRIVATE_EXPORT Binding }; union { - QJsonPrivate::qle_bitfield<0, 16> flags; - QJsonPrivate::qle_bitfield<16, 16> type; + quint32_le_bitfield<0, 16> flags; + quint32_le_bitfield<16, 16> type; }; union { bool b; quint64 doubleValue; // do not access directly, needs endian protected access - LEUInt32 compiledScriptIndex; // used when Type_Script - LEUInt32 objectIndex; + quint32_le compiledScriptIndex; // used when Type_Script + quint32_le objectIndex; TranslationData translationData; // used when Type_Translation } value; - LEUInt32 stringIndex; // Set for Type_String, Type_Translation and Type_Script (the latter because of script strings) + quint32_le stringIndex; // Set for Type_String, Type_Translation and Type_Script (the latter because of script strings) Location location; Location valueLocation; @@ -399,16 +392,16 @@ struct Q_QML_PRIVATE_EXPORT Binding struct Parameter { - LEUInt32 nameIndex; - LEUInt32 type; - LEUInt32 customTypeNameIndex; + quint32_le nameIndex; + quint32_le type; + quint32_le customTypeNameIndex; Location location; }; struct Signal { - LEUInt32 nameIndex; - LEUInt32 nParameters; + quint32_le nameIndex; + quint32_le nParameters; Location location; // Parameter parameters[1]; @@ -440,12 +433,12 @@ struct Property IsReadOnly = 0x1 }; - LEUInt32 nameIndex; + quint32_le nameIndex; union { - QJsonPrivate::qle_bitfield<0, 31> type; - QJsonPrivate::qle_bitfield<31, 1> flags; // readonly + quint32_le_bitfield<0, 31> type; + quint32_le_bitfield<31, 1> flags; // readonly }; - LEUInt32 customTypeNameIndex; // If type >= Custom + quint32_le customTypeNameIndex; // If type >= Custom Location location; }; @@ -456,18 +449,18 @@ struct Alias { AliasPointsToPointerObject = 0x4 }; union { - QJsonPrivate::qle_bitfield<0, 29> nameIndex; - QJsonPrivate::qle_bitfield<29, 3> flags; + quint32_le_bitfield<0, 29> nameIndex; + quint32_le_bitfield<29, 3> flags; }; union { - LEUInt32 idIndex; // string index - QJsonPrivate::qle_bitfield<0, 31> targetObjectId; // object id index (in QQmlContextData::idValues) - QJsonPrivate::qle_bitfield<31, 1> aliasToLocalAlias; + quint32_le idIndex; // string index + quint32_le_bitfield<0, 31> targetObjectId; // object id index (in QQmlContextData::idValues) + quint32_le_bitfield<31, 1> aliasToLocalAlias; }; union { - LEUInt32 propertyNameIndex; // string index - LEInt32 encodedMetaPropertyIndex; - LEUInt32 localAliasIndex; // index in list of aliases local to the object (if targetObjectId == objectId) + quint32_le propertyNameIndex; // string index + qint32_le encodedMetaPropertyIndex; + quint32_le localAliasIndex; // index in list of aliases local to the object (if targetObjectId == objectId) }; Location location; Location referenceLocation; @@ -490,26 +483,26 @@ struct Object // Depending on the use, this may be the type name to instantiate before instantiating this // object. For grouped properties the type name will be empty and for attached properties // it will be the name of the attached type. - LEUInt32 inheritedTypeNameIndex; - LEUInt32 idNameIndex; + quint32_le inheritedTypeNameIndex; + quint32_le idNameIndex; union { - QJsonPrivate::qle_bitfield<0, 15> flags; - QJsonPrivate::qle_bitfield<15, 1> defaultPropertyIsAlias; - QJsonPrivate::qle_signedbitfield<16, 16> id; + quint32_le_bitfield<0, 15> flags; + quint32_le_bitfield<15, 1> defaultPropertyIsAlias; + qint32_le_bitfield<16, 16> id; }; - LEInt32 indexOfDefaultPropertyOrAlias; // -1 means no default property declared in this object - LEUInt32 nFunctions; - LEUInt32 offsetToFunctions; - LEUInt32 nProperties; - LEUInt32 offsetToProperties; - LEUInt32 nAliases; - LEUInt32 offsetToAliases; - LEUInt32 nSignals; - LEUInt32 offsetToSignals; // which in turn will be a table with offsets to variable-sized Signal objects - LEUInt32 nBindings; - LEUInt32 offsetToBindings; - LEUInt32 nNamedObjectsInComponent; - LEUInt32 offsetToNamedObjectsInComponent; + qint32_le indexOfDefaultPropertyOrAlias; // -1 means no default property declared in this object + quint32_le nFunctions; + quint32_le offsetToFunctions; + quint32_le nProperties; + quint32_le offsetToProperties; + quint32_le nAliases; + quint32_le offsetToAliases; + quint32_le nSignals; + quint32_le offsetToSignals; // which in turn will be a table with offsets to variable-sized Signal objects + quint32_le nBindings; + quint32_le offsetToBindings; + quint32_le nNamedObjectsInComponent; + quint32_le offsetToNamedObjectsInComponent; Location location; Location locationOfIdProperty; // Function[] @@ -530,9 +523,9 @@ struct Object ) & ~0x7; } - const LEUInt32 *functionOffsetTable() const + const quint32_le *functionOffsetTable() const { - return reinterpret_cast(reinterpret_cast(this) + offsetToFunctions); + return reinterpret_cast(reinterpret_cast(this) + offsetToFunctions); } const Property *propertyTable() const @@ -552,14 +545,14 @@ struct Object const Signal *signalAt(int idx) const { - const LEUInt32 *offsetTable = reinterpret_cast((reinterpret_cast(this)) + offsetToSignals); - const LEUInt32 offset = offsetTable[idx]; + const quint32_le *offsetTable = reinterpret_cast((reinterpret_cast(this)) + offsetToSignals); + const quint32_le offset = offsetTable[idx]; return reinterpret_cast(reinterpret_cast(this) + offset); } - const LEUInt32 *namedObjectsInComponentTable() const + const quint32_le *namedObjectsInComponentTable() const { - return reinterpret_cast(reinterpret_cast(this) + offsetToNamedObjectsInComponent); + return reinterpret_cast(reinterpret_cast(this) + offsetToNamedObjectsInComponent); } // --- QQmlPropertyCacheCreator interface @@ -592,13 +585,13 @@ struct Import ImportFile = 0x2, ImportScript = 0x3 }; - LEUInt32 type; + quint32_le type; - LEUInt32 uriIndex; - LEUInt32 qualifierIndex; + quint32_le uriIndex; + quint32_le qualifierIndex; - LEInt32 majorVersion; - LEInt32 minorVersion; + qint32_le majorVersion; + qint32_le minorVersion; Location location; @@ -611,17 +604,17 @@ struct Unit { // DO NOT CHANGE THESE FIELDS EVER char magic[8]; - LEUInt32 version; - LEUInt32 qtVersion; - LEInt64 sourceTimeStamp; - LEUInt32 unitSize; // Size of the Unit and any depending data. + quint32_le version; + quint32_le qtVersion; + qint64_le sourceTimeStamp; + quint32_le unitSize; // Size of the Unit and any depending data. // END DO NOT CHANGE THESE FIELDS EVER char md5Checksum[16]; // checksum of all bytes following this field. void generateChecksum(); - LEUInt32 architectureIndex; // string index to QSysInfo::buildAbi() - LEUInt32 codeGeneratorIndex; + quint32_le architectureIndex; // string index to QSysInfo::buildAbi() + quint32_le codeGeneratorIndex; char dependencyMD5Checksum[16]; enum : unsigned int { @@ -633,36 +626,36 @@ struct Unit ContainsMachineCode = 0x20, // used to determine if we need to mmap with execute permissions PendingTypeCompilation = 0x40 // the QML data structures present are incomplete and require type compilation }; - LEUInt32 flags; - LEUInt32 stringTableSize; - LEUInt32 offsetToStringTable; - LEUInt32 functionTableSize; - LEUInt32 offsetToFunctionTable; - LEUInt32 lookupTableSize; - LEUInt32 offsetToLookupTable; - LEUInt32 regexpTableSize; - LEUInt32 offsetToRegexpTable; - LEUInt32 constantTableSize; - LEUInt32 offsetToConstantTable; - LEUInt32 jsClassTableSize; - LEUInt32 offsetToJSClassTable; - LEInt32 indexOfRootFunction; - LEUInt32 sourceFileIndex; + quint32_le flags; + quint32_le stringTableSize; + quint32_le offsetToStringTable; + quint32_le functionTableSize; + quint32_le offsetToFunctionTable; + quint32_le lookupTableSize; + quint32_le offsetToLookupTable; + quint32_le regexpTableSize; + quint32_le offsetToRegexpTable; + quint32_le constantTableSize; + quint32_le offsetToConstantTable; + quint32_le jsClassTableSize; + quint32_le offsetToJSClassTable; + qint32_le indexOfRootFunction; + quint32_le sourceFileIndex; /* QML specific fields */ - LEUInt32 nImports; - LEUInt32 offsetToImports; - LEUInt32 nObjects; - LEUInt32 offsetToObjects; - LEUInt32 indexOfRootObject; + quint32_le nImports; + quint32_le offsetToImports; + quint32_le nObjects; + quint32_le offsetToObjects; + quint32_le indexOfRootObject; const Import *importAt(int idx) const { return reinterpret_cast((reinterpret_cast(this)) + offsetToImports + idx * sizeof(Import)); } const Object *objectAt(int idx) const { - const LEUInt32 *offsetTable = reinterpret_cast((reinterpret_cast(this)) + offsetToObjects); - const LEUInt32 offset = offsetTable[idx]; + const quint32_le *offsetTable = reinterpret_cast((reinterpret_cast(this)) + offsetToObjects); + const quint32_le offset = offsetTable[idx]; return reinterpret_cast(reinterpret_cast(this) + offset); } @@ -672,8 +665,8 @@ struct Unit /* end QML specific fields*/ QString stringAt(int idx) const { - const LEUInt32 *offsetTable = reinterpret_cast((reinterpret_cast(this)) + offsetToStringTable); - const LEUInt32 offset = offsetTable[idx]; + const quint32_le *offsetTable = reinterpret_cast((reinterpret_cast(this)) + offsetToStringTable); + const quint32_le offset = offsetTable[idx]; const String *str = reinterpret_cast(reinterpret_cast(this) + offset); if (str->size == 0) return QString(); @@ -685,7 +678,7 @@ struct Unit // return QString::fromRawData(characters, str->size); return QString(characters, str->size); #else - const LEUInt16 *characters = reinterpret_cast(str + 1); + const quint16_le *characters = reinterpret_cast(str + 1); QString qstr(str->size, Qt::Uninitialized); QChar *ch = qstr.data(); for (int i = 0; i < str->size; ++i) @@ -694,11 +687,11 @@ struct Unit #endif } - const LEUInt32 *functionOffsetTable() const { return reinterpret_cast((reinterpret_cast(this)) + offsetToFunctionTable); } + const quint32_le *functionOffsetTable() const { return reinterpret_cast((reinterpret_cast(this)) + offsetToFunctionTable); } const Function *functionAt(int idx) const { - const LEUInt32 *offsetTable = functionOffsetTable(); - const LEUInt32 offset = offsetTable[idx]; + const quint32_le *offsetTable = functionOffsetTable(); + const quint32_le offset = offsetTable[idx]; return reinterpret_cast(reinterpret_cast(this) + offset); } @@ -706,13 +699,13 @@ struct Unit const RegExp *regexpAt(int index) const { return reinterpret_cast(reinterpret_cast(this) + offsetToRegexpTable + index * sizeof(RegExp)); } - const LEUInt64 *constants() const { - return reinterpret_cast(reinterpret_cast(this) + offsetToConstantTable); + const quint64_le *constants() const { + return reinterpret_cast(reinterpret_cast(this) + offsetToConstantTable); } const JSClassMember *jsClassAt(int idx, int *nMembers) const { - const LEUInt32 *offsetTable = reinterpret_cast(reinterpret_cast(this) + offsetToJSClassTable); - const LEUInt32 offset = offsetTable[idx]; + const quint32_le *offsetTable = reinterpret_cast(reinterpret_cast(this) + offsetToJSClassTable); + const quint32_le offset = offsetTable[idx]; const char *ptr = reinterpret_cast(this) + offset; const JSClass *klass = reinterpret_cast(ptr); *nMembers = klass->nMembers; diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index a49388846d..35825587b1 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -78,7 +78,7 @@ void QV4::Compiler::StringTableGenerator::clear() void QV4::Compiler::StringTableGenerator::serialize(CompiledData::Unit *unit) { char *dataStart = reinterpret_cast(unit); - CompiledData::LEUInt32 *stringTable = reinterpret_cast(dataStart + unit->offsetToStringTable); + quint32_le *stringTable = reinterpret_cast(dataStart + unit->offsetToStringTable); char *stringData = dataStart + unit->offsetToStringTable + unit->stringTableSize * sizeof(uint); for (int i = 0; i < strings.size(); ++i) { stringTable[i] = stringData - dataStart; @@ -220,7 +220,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorO registerString(*f->locals.at(i)); } - Q_ALLOCA_VAR(CompiledData::LEUInt32, functionOffsets, irModule->functions.size() * sizeof(CompiledData::LEUInt32)); + Q_ALLOCA_VAR(quint32_le, functionOffsets, irModule->functions.size() * sizeof(quint32_le)); uint jsClassDataOffset = 0; char *dataPtr; @@ -233,7 +233,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorO memcpy(unit, &tempHeader, sizeof(tempHeader)); } - memcpy(dataPtr + unit->offsetToFunctionTable, functionOffsets, unit->functionTableSize * sizeof(CompiledData::LEUInt32)); + memcpy(dataPtr + unit->offsetToFunctionTable, functionOffsets, unit->functionTableSize * sizeof(quint32_le)); for (int i = 0; i < irModule->functions.size(); ++i) { QV4::IR::Function *function = irModule->functions.at(i); @@ -254,7 +254,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorO ReturnedValue *constantTable = reinterpret_cast(dataPtr + unit->offsetToConstantTable); memcpy(constantTable, constants.constData(), constants.size() * sizeof(ReturnedValue)); #else - CompiledData::LEUInt64 *constantTable = reinterpret_cast(dataPtr + unit->offsetToConstantTable); + quint64_le *constantTable = reinterpret_cast(dataPtr + unit->offsetToConstantTable); for (int i = 0; i < constants.count(); ++i) constantTable[i] = constants.at(i); #endif @@ -263,7 +263,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorO memcpy(dataPtr + jsClassDataOffset, jsClassData.constData(), jsClassData.size()); // write js classes and js class lookup table - CompiledData::LEUInt32 *jsClassOffsetTable = reinterpret_cast(dataPtr + unit->offsetToJSClassTable); + quint32_le *jsClassOffsetTable = reinterpret_cast(dataPtr + unit->offsetToJSClassTable); for (int i = 0; i < jsClassOffsets.count(); ++i) jsClassOffsetTable[i] = jsClassDataOffset + jsClassOffsets.at(i); } @@ -337,36 +337,36 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::IR::Function *i function->codeSize = 0; // write formals - CompiledData::LEUInt32 *formals = (CompiledData::LEUInt32 *)(f + function->formalsOffset); + quint32_le *formals = (quint32_le *)(f + function->formalsOffset); for (int i = 0; i < irFunction->formals.size(); ++i) formals[i] = getStringId(*irFunction->formals.at(i)); // write locals - CompiledData::LEUInt32 *locals = (CompiledData::LEUInt32 *)(f + function->localsOffset); + quint32_le *locals = (quint32_le *)(f + function->localsOffset); for (int i = 0; i < irFunction->locals.size(); ++i) locals[i] = getStringId(*irFunction->locals.at(i)); // write QML dependencies - CompiledData::LEUInt32 *writtenDeps = (CompiledData::LEUInt32 *)(f + function->dependingIdObjectsOffset); + quint32_le *writtenDeps = (quint32_le *)(f + function->dependingIdObjectsOffset); for (int id : irFunction->idObjectDependencies) { Q_ASSERT(id >= 0); *writtenDeps++ = static_cast(id); } - writtenDeps = (CompiledData::LEUInt32 *)(f + function->dependingContextPropertiesOffset); + writtenDeps = (quint32_le *)(f + function->dependingContextPropertiesOffset); for (auto property : irFunction->contextObjectPropertyDependencies) { *writtenDeps++ = property.key(); // property index *writtenDeps++ = property.value(); // notify index } - writtenDeps = (CompiledData::LEUInt32 *)(f + function->dependingScopePropertiesOffset); + writtenDeps = (quint32_le *)(f + function->dependingScopePropertiesOffset); for (auto property : irFunction->scopeObjectPropertyDependencies) { *writtenDeps++ = property.key(); // property index *writtenDeps++ = property.value(); // notify index } } -QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Compiler::JSUnitGenerator::GeneratorOption option, QJsonPrivate::q_littleendian *functionOffsets, uint *jsClassDataOffset) +QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Compiler::JSUnitGenerator::GeneratorOption option, quint32_le *functionOffsets, uint *jsClassDataOffset) { CompiledData::Unit unit; memset(&unit, 0, sizeof(unit)); diff --git a/src/qml/compiler/qv4compiler_p.h b/src/qml/compiler/qv4compiler_p.h index 49b8664513..9c51a44bad 100644 --- a/src/qml/compiler/qv4compiler_p.h +++ b/src/qml/compiler/qv4compiler_p.h @@ -52,7 +52,7 @@ #include #include "qv4jsir_p.h" -#include +#include QT_BEGIN_NAMESPACE @@ -120,7 +120,7 @@ struct Q_QML_PRIVATE_EXPORT JSUnitGenerator { StringTableGenerator stringTable; QString codeGeneratorName; private: - CompiledData::Unit generateHeader(GeneratorOption option, QJsonPrivate::q_littleendian *functionOffsets, uint *jsClassDataOffset); + CompiledData::Unit generateHeader(GeneratorOption option, quint32_le *functionOffsets, uint *jsClassDataOffset); IR::Module *irModule; diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index 4c8117527c..d1bdab1b3c 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -60,7 +60,7 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, Q_UNUSED(engine); internalClass = engine->internalClasses[EngineBase::Class_Empty]; - const CompiledData::LEUInt32 *formalsIndices = compiledFunction->formalsTable(); + const quint32_le *formalsIndices = compiledFunction->formalsTable(); // iterate backwards, so we get the right ordering for duplicate names Scope scope(engine); ScopedString arg(scope); @@ -79,7 +79,7 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, } nFormals = compiledFunction->nFormals; - const CompiledData::LEUInt32 *localsIndices = compiledFunction->localsTable(); + const quint32_le *localsIndices = compiledFunction->localsTable(); for (quint32 i = 0; i < compiledFunction->nLocals; ++i) internalClass = internalClass->addMember(compilationUnit->runtimeStrings[localsIndices[i]]->identifier, Attr_NotConfigurable); @@ -111,7 +111,7 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QListlocalsTable(); + const quint32_le *localsIndices = compiledFunction->localsTable(); for (quint32 i = 0; i < compiledFunction->nLocals; ++i) internalClass = internalClass->addMember(compilationUnit->runtimeStrings[localsIndices[i]]->identifier, Attr_NotConfigurable); diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 9d4e46e254..9587b3961f 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -350,7 +350,7 @@ void QQmlPropertyCapture::registerQmlDependencies(const QV4::CompiledData::Funct QV4::Scoped context(scope, engine->qmlContext()); QQmlContextData *qmlContext = context->qmlContext(); - const QV4::CompiledData::LEUInt32 *idObjectDependency = compiledFunction->qmlIdObjectDependencyTable(); + const quint32_le *idObjectDependency = compiledFunction->qmlIdObjectDependencyTable(); const int idObjectDependencyCount = compiledFunction->nDependingIdObjects; for (int i = 0; i < idObjectDependencyCount; ++i, ++idObjectDependency) { Q_ASSERT(int(*idObjectDependency) < qmlContext->idValueCount); @@ -359,7 +359,7 @@ void QQmlPropertyCapture::registerQmlDependencies(const QV4::CompiledData::Funct } Q_ASSERT(qmlContext->contextObject); - const QV4::CompiledData::LEUInt32 *contextPropertyDependency = compiledFunction->qmlContextPropertiesDependencyTable(); + const quint32_le *contextPropertyDependency = compiledFunction->qmlContextPropertiesDependencyTable(); const int contextPropertyDependencyCount = compiledFunction->nDependingContextProperties; for (int i = 0; i < contextPropertyDependencyCount; ++i) { const int propertyIndex = *contextPropertyDependency++; @@ -369,7 +369,7 @@ void QQmlPropertyCapture::registerQmlDependencies(const QV4::CompiledData::Funct } QObject *scopeObject = context->qmlScope(); - const QV4::CompiledData::LEUInt32 *scopePropertyDependency = compiledFunction->qmlScopePropertiesDependencyTable(); + const quint32_le *scopePropertyDependency = compiledFunction->qmlScopePropertiesDependencyTable(); const int scopePropertyDependencyCount = compiledFunction->nDependingScopeProperties; for (int i = 0; i < scopePropertyDependencyCount; ++i) { const int propertyIndex = *scopePropertyDependency++; diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 2cbcfbbfb6..b73cbaa563 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -996,7 +996,7 @@ void QQmlObjectCreator::setupFunctions() QV4::ScopedValue function(scope); QV4::ScopedContext qmlContext(scope, currentQmlContext()); - const QV4::CompiledData::LEUInt32 *functionIdx = _compiledObject->functionOffsetTable(); + const quint32_le *functionIdx = _compiledObject->functionOffsetTable(); for (quint32 i = 0; i < _compiledObject->nFunctions; ++i, ++functionIdx) { QV4::Function *runtimeFunction = compilationUnit->runtimeFunctions[*functionIdx]; const QString name = runtimeFunction->name()->toQString(); -- cgit v1.2.3 From b9767f03bdfcc06dae49661150fbeb0f19a8547b Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 13 Jun 2017 16:34:07 +0200 Subject: Doc: explain ListView default Z values in detail This should save users some time when they are trying to figure out why the delegate items are rendered underneath the header when headerPositioning is set to ListView.OverlayHeader, for example. Task-number: QTBUG-61346 Change-Id: I490250f2a64a8bbda463b3a31be6f820d0cfe881 Reviewed-by: J-P Nurmi Reviewed-by: Robin Burchell --- src/quick/items/qquicklistview.cpp | 62 +++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 18f9b8512d..979a3557a1 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -1835,6 +1835,38 @@ bool QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte \snippet qml/listview/listview.qml flickBothDirections + \section1 Stacking Order in ListView + + The \l {QQuickItem::z}{Z value} of items determines whether they are + rendered above or below other items. ListView uses several different + default Z values, depending on what type of item is being created: + + \table + \header + \li Property + \li Default Z value + \row + \li \l delegate + \li 1 + \row + \li \l footer + \li 1 + \row + \li \l header + \li 1 + \row + \li \l highlight + \li 0 + \row + \li \l section.delegate + \li 2 + \endtable + + These default values are set if the Z value of the item is \c 0, so setting + the Z value of these items to \c 0 has no effect. Note that the Z value is + of type \l [QML] {real}, so it is possible to set fractional + values like \c 0.1. + \sa {QML Data Models}, GridView, PathView, {Qt Quick Examples - Views} */ QQuickListView::QQuickListView(QQuickItem *parent) @@ -1963,6 +1995,8 @@ QQuickListView::~QQuickListView() \note Delegates are instantiated as needed and may be destroyed at any time. They are parented to ListView's \l {Flickable::contentItem}{contentItem}, not to the view itself. State should \e never be stored in a delegate. + + \sa {Stacking Order in ListView} */ /*! \qmlproperty int QtQuick::ListView::currentIndex @@ -1990,7 +2024,7 @@ QQuickListView::~QQuickListView() The default \l {QQuickItem::z}{stacking order} of the highlight item is \c 0. - \sa highlight, highlightFollowsCurrentItem + \sa highlight, highlightFollowsCurrentItem, {Stacking Order in ListView} */ /*! @@ -2009,7 +2043,8 @@ QQuickListView::~QQuickListView() highlight item is \c 0. \sa highlightItem, highlightFollowsCurrentItem, - {Qt Quick Examples - Views#Highlight}{ListView highlight example} + {Qt Quick Examples - Views#Highlight}{ListView highlight example}, + {Stacking Order in ListView} */ /*! @@ -2352,7 +2387,8 @@ void QQuickListView::setOrientation(QQuickListView::Orientation orientation) differing sections will result in a section header being created even if that section exists elsewhere. - \sa {Qt Quick Examples - Views}{ListView examples} + \sa {Qt Quick Examples - Views}{ListView examples}, + {Stacking Order in ListView} */ QQuickViewSection *QQuickListView::sectionCriteria() { @@ -2503,7 +2539,7 @@ void QQuickListView::setSnapMode(SnapMode mode) footer is positioned at the end of the view, after any items. The default \l {QQuickItem::z}{stacking order} of the footer is \c 1. - \sa header, footerItem + \sa header, footerItem, {Stacking Order in ListView} */ @@ -2515,7 +2551,7 @@ void QQuickListView::setSnapMode(SnapMode mode) header is positioned at the beginning of the view, before any items. The default \l {QQuickItem::z}{stacking order} of the header is \c 1. - \sa footer, headerItem + \sa footer, headerItem, {Stacking Order in ListView} */ /*! @@ -2526,7 +2562,7 @@ void QQuickListView::setSnapMode(SnapMode mode) header is positioned at the beginning of the view, before any items. The default \l {QQuickItem::z}{stacking order} of the header is \c 1. - \sa header, footerItem + \sa header, footerItem, {Stacking Order in ListView} */ /*! @@ -2537,7 +2573,7 @@ void QQuickListView::setSnapMode(SnapMode mode) footer is positioned at the end of the view, after any items. The default \l {QQuickItem::z}{stacking order} of the footer is \c 1. - \sa footer, headerItem + \sa footer, headerItem, {Stacking Order in ListView} */ /*! @@ -2555,6 +2591,12 @@ void QQuickListView::setSnapMode(SnapMode mode) The header can be pushed away by moving the content forwards, and pulled back by moving the content backwards. \endlist + + \note This property has no effect on the \l {QQuickItem::z}{stacking order} + of the header. For example, if the header should be shown above the + \l delegate items when using \c ListView.OverlayHeader, its Z value + should be set to a value higher than that of the delegates. For more + information, see \l {Stacking Order in ListView}. */ QQuickListView::HeaderPositioning QQuickListView::headerPositioning() const { @@ -2592,6 +2634,12 @@ void QQuickListView::setHeaderPositioning(QQuickListView::HeaderPositioning posi The footer can be pushed away by moving the content backwards, and pulled back by moving the content forwards. \endlist + + \note This property has no effect on the \l {QQuickItem::z}{stacking order} + of the footer. For example, if the footer should be shown above the + \l delegate items when using \c ListView.OverlayFooter, its Z value + should be set to a value higher than that of the delegates. For more + information, see \l {Stacking Order in ListView}. */ QQuickListView::FooterPositioning QQuickListView::footerPositioning() const { -- cgit v1.2.3 From 9d546614a6b080baad66b4cddcb2afa83352e348 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 6 Jul 2017 14:31:07 +0200 Subject: shape: Revise performance notes in the docs Clear up some sentences and add some more recommendations. Change-Id: Iecfd90c63411aa6d17a9218122bada92b06f1cd3 Reviewed-by: J-P Nurmi Reviewed-by: Mitch Curtis --- src/imports/shapes/qquickshape.cpp | 59 ++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/qquickshape.cpp b/src/imports/shapes/qquickshape.cpp index d81f560315..648c9df1ce 100644 --- a/src/imports/shapes/qquickshape.cpp +++ b/src/imports/shapes/qquickshape.cpp @@ -131,7 +131,7 @@ QPainterPath QQuickShapePathCommands::toPainterPath() const \brief Describes a Path and associated properties for stroking and filling \since 5.10 - A Shape contains one or more ShapePath elements. At least one ShapePath is + A \l Shape contains one or more ShapePath elements. At least one ShapePath is necessary in order to have a Shape output anything visible. A ShapePath itself is a \l Path with additional properties describing the stroking and filling parameters, such as the stroke width and color, the fill color or @@ -593,27 +593,6 @@ void QQuickShapePath::resetFillGradient() useful since it allows adding visual items, like \l Rectangle or \l Image, and non-visual objects, like \l Timer directly as children of Shape. - \note It is important to be aware of performance implications, in particular - when the application is running on the generic Shape implementation due to - not having support for accelerated path rendering. The geometry generation - happens entirely on the CPU in this case, and this is potentially - expensive. Changing the set of path elements, changing the properties of - these elements, or changing certain properties of the Shape itself all lead - to retriangulation of the affected elements on every change. Therefore, - applying animation to such properties can affect performance on less - powerful systems. If animating properties other than stroke and fill colors - is a must, it is recommended to target systems providing - \c{GL_NV_path_rendering} where the cost of path property changes is much - smaller. - - \note However, the data-driven, declarative nature of the Shape API often - means better cacheability for the underlying CPU and GPU resources. A - property change in one ShapePath will only lead to reprocessing the affected - ShapePath, leaving other parts of the Shape unchanged. Therefore, a heavily - changing (for example, animating) property can often result in a lower - overall system load than with imperative painting approaches (for example, - QPainter). - The following list summarizes the available Shape rendering approaches: \list @@ -634,6 +613,42 @@ void QQuickShapePath::resetFillGradient() \endlist + When using Shape, it is important to be aware of potential performance + implications: + + \li When the application is running with the generic, triangulation-based + Shape implementation, the geometry generation happens entirely on the + CPU. This is potentially expensive. Changing the set of path elements, + changing the properties of these elements, or changing certain properties of + the Shape itself all lead to retriangulation of the affected paths on every + change. Therefore, applying animation to such properties can affect + performance on less powerful systems. + + \li However, the data-driven, declarative nature of the Shape API often + means better cacheability for the underlying CPU and GPU resources. A + property change in one ShapePath will only lead to reprocessing the affected + ShapePath, leaving other parts of the Shape unchanged. Therefore, a + frequently changing property can still result in a lower overall system load + than with imperative painting approaches (for example, QPainter). + + \li If animating properties other than stroke and fill colors is a must, it + is recommended to target systems providing \c{GL_NV_path_rendering} where + the cost of property changes is smaller. + + \li At the same time, attention must be paid to the number of Shape elements + in the scene, in particular when using this special accelerated approach for + \c{GL_NV_path_rendering}. The way such a Shape item is represented in the + scene graph is different from an ordinary geometry-based item, and incurs a + certain cost when it comes to OpenGL state changes. + + \li As a general rule, scenes should avoid using separate Shape items when + it is not absolutely necessary. Prefer using one Shape item with multiple + ShapePath elements over multiple Shape items. Scenes that cannot avoid using + a large number of individual Shape items should consider setting + Shape.vendorExtensionsEnabled to \c false. + + \endlist + \sa Path, PathMove, PathLine, PathQuad, PathCubic, PathArc, PathSvg */ -- cgit v1.2.3 From a670d760e351987ad23b445bfb08f6add1fb067b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 6 Jul 2017 14:59:06 +0200 Subject: shapes: Add example links Change-Id: I9826058b6f721a6d3a85878ab872864e0fc494ac Reviewed-by: J-P Nurmi --- src/imports/shapes/qquickshape.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/imports/shapes/qquickshape.cpp b/src/imports/shapes/qquickshape.cpp index 648c9df1ce..3d90ca0c1f 100644 --- a/src/imports/shapes/qquickshape.cpp +++ b/src/imports/shapes/qquickshape.cpp @@ -171,6 +171,8 @@ QPainterPath QQuickShapePathCommands::toPainterPath() const of 2 (ShapePath.RoundJoin): \image visualpath-code-example.png + + \sa {Qt Quick Examples - Shapes}, Shape */ QQuickShapePathPrivate::QQuickShapePathPrivate() @@ -649,7 +651,7 @@ void QQuickShapePath::resetFillGradient() \endlist - \sa Path, PathMove, PathLine, PathQuad, PathCubic, PathArc, PathSvg + \sa {Qt Quick Examples - Shapes}, Path, PathMove, PathLine, PathQuad, PathCubic, PathArc, PathSvg */ QQuickShapePrivate::QQuickShapePrivate() -- cgit v1.2.3 From 65ef4bab4ad0ef4a45ff56de3e143a588deac364 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 14 Jun 2017 13:15:45 +0200 Subject: QQuickText: don't clear the text formats on every layout In order to fix QTBUG-21919, 6ff9ba0 added a QTextLayout::clearFormats() call to QQuickTextPrivate::updateLayout(). This patch moves that logic to clearFormats(), called from setText() and setTextFormat() in order to avoid clearing the formats on every text layout update. This allows Qt Quick Controls 2 to extend QQuickText with support for mnenonics by adding a text format range to underline the appropriate piece of text in the internal QTextLayout. Task-number: QTBUG-61422 Change-Id: I646d53f0feeeaa3c106db94f187c7accabdc6a61 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/items/qquicktext.cpp | 15 +++++++++++---- src/quick/items/qquicktext_p_p.h | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 1bcfbd41f7..2e66367e85 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -269,9 +269,6 @@ void QQuickTextPrivate::updateLayout() formatModifiesFontSize = fontSizeModified; multilengthEos = -1; } else { - layout.clearFormats(); - if (elideLayout) - elideLayout->clearFormats(); QString tmp = text; multilengthEos = tmp.indexOf(QLatin1Char('\x9c')); if (multilengthEos != -1) @@ -632,6 +629,13 @@ QString QQuickTextPrivate::elidedText(qreal lineWidth, const QTextLine &line, QT } } +void QQuickTextPrivate::clearFormats() +{ + layout.clearFormats(); + if (elideLayout) + elideLayout->clearFormats(); +} + /*! Lays out the QQuickTextPrivate::layout QTextLayout in the constraints of the QQuickText. @@ -1060,7 +1064,8 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline) elideLayout = new QTextLayout; elideLayout->setCacheEnabled(true); } - if (styledText) { + QTextEngine *engine = layout.engine(); + if (engine && engine->hasFormats()) { QVector formats; switch (elideMode) { case QQuickText::ElideRight: @@ -1612,6 +1617,7 @@ void QQuickText::setText(const QString &n) d->extra->doc->setText(n); d->rightToLeftText = d->extra->doc->toPlainText().isRightToLeft(); } else { + d->clearFormats(); d->rightToLeftText = d->text.isRightToLeft(); } d->determineHorizontalAlignment(); @@ -2102,6 +2108,7 @@ void QQuickText::setTextFormat(TextFormat format) d->extra->doc->setText(d->text); d->rightToLeftText = d->extra->doc->toPlainText().isRightToLeft(); } else { + d->clearFormats(); d->rightToLeftText = d->text.isRightToLeft(); d->textHasChanged = true; } diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h index fde07eaf2e..957641ec0a 100644 --- a/src/quick/items/qquicktext_p_p.h +++ b/src/quick/items/qquicktext_p_p.h @@ -85,6 +85,7 @@ public: int lineHeightOffset() const; QString elidedText(qreal lineWidth, const QTextLine &line, QTextLine *nextLine = 0) const; void elideFormats(int start, int length, int offset, QVector *elidedFormats); + void clearFormats(); void processHoverEvent(QHoverEvent *event); -- cgit v1.2.3 From 286f14f1e29e7f4e2db4517d087dd5c92606f971 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 5 Jul 2017 12:53:01 +0200 Subject: Add QQuickItem::ItemEnabledHasChanged The itemChange() method has been very useful for Qt Quick Controls 2 to efficiently react to various item changes, but a notification for the enabled state was missing, so it always had to be handled as a special case using signals and slots. This change allows QQC2 to handle enabled state changes the same way e.g. visibility changes are handled. It's also nice to be able to update a control's internal state before the actual notifier signal is emitted. [ChangeLog][QtQuick][QQuickItem] Added a ItemEnabledHasChanged value to the ItemChange enum. QQuickItem::itemChange(ItemEnabledHasChanged) gets called when the item's effective enabled state has changed. The new enabled state is stored in ItemChangeData::boolValue. Change-Id: Iae96ec21f2b94f453632282473decd1c66097a75 Reviewed-by: Mitch Curtis Reviewed-by: Robin Burchell --- src/quick/items/qquickitem.cpp | 16 ++++++++++++++++ src/quick/items/qquickitem.h | 3 ++- src/quick/items/qquickitem_p.h | 3 ++- src/quick/items/qquickitemchangelistener_p.h | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index a8a862bb2f..1e71c20ff3 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2138,6 +2138,9 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus) \value ItemAntialiasingHasChanged The antialiasing has changed. The current (boolean) value can be found in QQuickItem::antialiasing. + + \value ItemEnabledHasChanged The item's enabled state has changed. + ItemChangeData::boolValue contains the new enabled state. (since Qt 5.10) */ /*! @@ -5927,6 +5930,7 @@ void QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem *scope, bool newEffec scope, q, Qt::OtherFocusReason, QQuickWindowPrivate::DontChangeFocusProperty | QQuickWindowPrivate::DontChangeSubFocusItem); } + itemChange(QQuickItem::ItemEnabledHasChanged, effectiveEnable); emit q->enabledChanged(); } @@ -6099,6 +6103,18 @@ void QQuickItemPrivate::itemChange(QQuickItem::ItemChange change, const QQuickIt } break; } + case QQuickItem::ItemEnabledHasChanged: { + q->itemChange(change, data); + if (!changeListeners.isEmpty()) { + const auto listeners = changeListeners; // NOTE: intentional copy (QTBUG-54732) + for (const QQuickItemPrivate::ChangeListener &change : listeners) { + if (change.types & QQuickItemPrivate::Enabled) { + change.listener->itemEnabledChanged(q); + } + } + } + break; + } case QQuickItem::ItemParentHasChanged: { q->itemChange(change, data); if (!changeListeners.isEmpty()) { diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index f58946d01d..4a832bbf6f 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -173,7 +173,8 @@ public: ItemActiveFocusHasChanged, // value.boolValue ItemRotationHasChanged, // value.realValue ItemAntialiasingHasChanged, // value.boolValue - ItemDevicePixelRatioHasChanged // value.realValue + ItemDevicePixelRatioHasChanged, // value.realValue + ItemEnabledHasChanged // value.boolValue }; union ItemChangeData { diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index e56d839de9..74d70da2bc 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -321,7 +321,8 @@ public: Children = 0x40, Rotation = 0x80, ImplicitWidth = 0x100, - ImplicitHeight = 0x200 + ImplicitHeight = 0x200, + Enabled = 0x400, }; Q_DECLARE_FLAGS(ChangeTypes, ChangeType) diff --git a/src/quick/items/qquickitemchangelistener_p.h b/src/quick/items/qquickitemchangelistener_p.h index 83c69a9330..cb0af75c4c 100644 --- a/src/quick/items/qquickitemchangelistener_p.h +++ b/src/quick/items/qquickitemchangelistener_p.h @@ -125,6 +125,7 @@ public: virtual void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF & /* oldGeometry */) {} virtual void itemSiblingOrderChanged(QQuickItem *) {} virtual void itemVisibilityChanged(QQuickItem *) {} + virtual void itemEnabledChanged(QQuickItem *) {} virtual void itemOpacityChanged(QQuickItem *) {} virtual void itemDestroyed(QQuickItem *) {} virtual void itemChildAdded(QQuickItem *, QQuickItem * /* child */ ) {} -- cgit v1.2.3 From c7b22fd4d3bc8e5e4ea17b5f101d5d062d7f5d62 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 11 Jul 2017 11:42:10 +0200 Subject: =?UTF-8?q?Doc:=20finish=20incomplete=20sentence=20in=20Loader?= =?UTF-8?q?=E2=80=99s=20detailed=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-61889 Change-Id: Ib6adcabc79b75fe2ee9a31fc4808a2a5f303df74 Reviewed-by: Topi Reiniö --- src/quick/items/qquickloader.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index 5d5934bbd2..2c8f854d4d 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -270,6 +270,7 @@ qreal QQuickLoaderPrivate::getImplicitHeight() const In some cases you may wish to use a Loader within a view delegate to improve delegate loading performance. This works well in most cases, but there is one important issue to + be aware of related to the \l{QtQml::Component#Creation Context}{creation context} of a Component. In the following example, the \c index context property inserted by the ListView into \c delegateComponent's context will be inaccessible to Text, as the Loader will use the creation context of \c myComponent as the parent -- cgit v1.2.3 From 8b0c90be00887a99c638f6834c53ee31104e1217 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 12 Jul 2017 14:28:53 +0200 Subject: QDoc: Fix syntax error on the definition of the Q_GADGET Change-Id: I1a0ec09441e7791bcdaf34f16a71be9e535625f0 Reviewed-by: Simon Hausmann --- src/qml/doc/src/cppintegration/data.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc index 4523ee39d8..b5c5505628 100644 --- a/src/qml/doc/src/cppintegration/data.qdoc +++ b/src/qml/doc/src/cppintegration/data.qdoc @@ -352,7 +352,7 @@ properties: private: QString m_name; - } + }; Q_DECLARE_METATYPE(Actor) \endcode -- cgit v1.2.3 From f812edbb5f3edc8a2349ce386139ad08144e665d Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 13 Jul 2017 09:48:05 +0200 Subject: Doc: link to Qt::WindowFlags in Window's flag doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0d5f03bcdcf9154431ed38eac2b41b622ad0c3d6 Reviewed-by: Topi Reiniö --- src/quick/items/qquickwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 31f367ed96..c124150b8d 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -4085,6 +4085,8 @@ void QQuickWindow::resetOpenGLState() The flags which you read from this property might differ from the ones that you set if the requested flags could not be fulfilled. + + \sa Qt::WindowFlags */ /*! -- cgit v1.2.3 From ab5d4c78224c9ec79165e8890e5f8b8e838e0709 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 10 Jul 2017 17:26:59 +0100 Subject: Rebuild QQmlData::propertyCache if deleted by another engine QQmlData is shared between engines, but the relevant QObjectWrapper is not. Since 749a7212e903d8e8c6f256edb1836b9449cc7fe1 when a QObjectWrapper is deleted it resets the shared QQmlData propertyCache. In most cases the propertyCache except when a property updated in an existing binding in the first engine, where it currently asserts. Task-number: QTBUG-61681 Change-Id: I6efdc506e5c7e30b95cda1be282afa9feb781cd2 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlbinding.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 62288a5845..325f752cd5 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -515,7 +515,12 @@ void QQmlBinding::getPropertyData(QQmlPropertyData **propertyData, QQmlPropertyD Q_ASSERT(propertyData); QQmlData *data = QQmlData::get(*m_target, false); - Q_ASSERT(data && data->propertyCache); + Q_ASSERT(data); + + if (Q_UNLIKELY(!data->propertyCache)) { + data->propertyCache = QQmlEnginePrivate::get(context()->engine)->cache(m_target->metaObject()); + data->propertyCache->addref(); + } *propertyData = data->propertyCache->property(m_targetIndex.coreIndex()); Q_ASSERT(*propertyData); -- cgit v1.2.3 From 22a2cc43387ec3b9f74a6c01f8665378a4541147 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 20 Apr 2017 15:59:31 +0200 Subject: Add support for enum declarations in QML Enums can be declared with the following syntax: enum MyEnum { Value1, Value2 } Grammar changes done by Simon Hausmann. [ChangeLog][QtQml] Enums can now be declared directly in QML. Task-number: QTBUG-14861 Change-Id: Ic6b6e032651d01ee2ecf9d5ce5734976cb3ad7ab Reviewed-by: Simon Hausmann --- src/qml/compiler/qqmlirbuilder.cpp | 94 +- src/qml/compiler/qqmlirbuilder_p.h | 26 + src/qml/compiler/qqmlpropertycachecreator_p.h | 19 +- src/qml/compiler/qv4compileddata_p.h | 47 +- .../qmllanguageref/syntax/objectattributes.qdoc | 38 + src/qml/jsruntime/qv4qmlcontext.cpp | 2 +- src/qml/parser/qqmljs.g | 34 + src/qml/parser/qqmljsast.cpp | 17 + src/qml/parser/qqmljsast_p.h | 67 +- src/qml/parser/qqmljsastfwd_p.h | 2 + src/qml/parser/qqmljsastvisitor_p.h | 4 + src/qml/parser/qqmljsgrammar.cpp | 2111 ++++++++++---------- src/qml/parser/qqmljsgrammar_p.h | 295 +-- src/qml/parser/qqmljskeywords_p.h | 2 +- src/qml/parser/qqmljslexer_p.h | 1 - src/qml/parser/qqmljsparser.cpp | 384 ++-- src/qml/parser/qqmljsparser_p.h | 5 +- src/qml/qml/qqmlimport.cpp | 36 +- src/qml/qml/qqmlimport_p.h | 13 +- src/qml/qml/qqmlmetatype.cpp | 151 +- src/qml/qml/qqmlmetatype_p.h | 9 +- src/qml/qml/qqmlpropertycache.cpp | 21 +- src/qml/qml/qqmlpropertycache_p.h | 33 +- src/qml/qml/qqmltypeloader.cpp | 4 + src/qml/qml/qqmltypenamecache.cpp | 4 +- src/qml/qml/qqmltypenamecache_p.h | 2 +- 26 files changed, 1916 insertions(+), 1505 deletions(-) (limited to 'src') diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index df615e6804..e05c38e14a 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -86,6 +86,7 @@ void Object::init(QQmlJS::MemoryPool *pool, int typeNameIndex, int idIndex, cons flags = QV4::CompiledData::Object::NoFlag; properties = pool->New >(); aliases = pool->New >(); + qmlEnums = pool->New>(); qmlSignals = pool->New >(); bindings = pool->New >(); functions = pool->New >(); @@ -118,6 +119,21 @@ QString Object::sanityCheckFunctionNames(const QSet &illegalNames, QQml return QString(); // no error } +QString Object::appendEnum(Enum *enumeration) +{ + Object *target = declarationsOverride; + if (!target) + target = this; + + for (Enum *e = qmlEnums->first; e; e = e->next) { + if (e->nameIndex == enumeration->nameIndex) + return tr("Duplicate scoped enum name"); + } + + target->qmlEnums->append(enumeration); + return QString(); // no error +} + QString Object::appendSignal(Signal *signal) { Object *target = declarationsOverride; @@ -709,6 +725,48 @@ static QStringList astNodeToStringList(QQmlJS::AST::Node *node) return QStringList(); } +bool IRBuilder::visit(QQmlJS::AST::UiEnumDeclaration *node) +{ + Enum *enumeration = New(); + QString enumName = node->name.toString(); + enumeration->nameIndex = registerString(enumName); + + if (enumName.at(0).isLower()) + COMPILE_EXCEPTION(node->enumToken, tr("Scoped enum names must begin with an upper case letter")); + + enumeration->location.line = node->enumToken.startLine; + enumeration->location.column = node->enumToken.startColumn; + + enumeration->enumValues = New>(); + + QQmlJS::AST::UiEnumMemberList *e = node->members; + int i = -1; + while (e) { + EnumValue *enumValue = New(); + QString member = e->member.toString(); + enumValue->nameIndex = registerString(member); + enumValue->value = ++i; + + if (member.at(0).isLower()) + COMPILE_EXCEPTION(e->memberToken, tr("Enum names must begin with an upper case letter")); + + enumValue->location.line = e->memberToken.startLine; + enumValue->location.column = e->memberToken.startColumn; + enumeration->enumValues->append(enumValue); + + e = e->next; + } + + QString error = _object->appendEnum(enumeration); + if (!error.isEmpty()) { + recordError(node->enumToken, error); + return false; + } + + return false; +} + + bool IRBuilder::visit(QQmlJS::AST::UiPublicMember *node) { static const struct TypeNameToType { @@ -1375,13 +1433,19 @@ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output, const QV4: int objectsSize = 0; for (Object *o : qAsConst(output.objects)) { objectOffsets.insert(o, unitSize + importSize + objectOffsetTableSize + objectsSize); - objectsSize += QV4::CompiledData::Object::calculateSizeExcludingSignals(o->functionCount(), o->propertyCount(), o->aliasCount(), o->signalCount(), o->bindingCount(), o->namedObjectsInComponent.count); + objectsSize += QV4::CompiledData::Object::calculateSizeExcludingSignalsAndEnums(o->functionCount(), o->propertyCount(), o->aliasCount(), o->enumCount(), o->signalCount(), o->bindingCount(), o->namedObjectsInComponent.count); int signalTableSize = 0; for (const Signal *s = o->firstSignal(); s; s = s->next) signalTableSize += QV4::CompiledData::Signal::calculateSize(s->parameters->count); objectsSize += signalTableSize; + + int enumTableSize = 0; + for (const Enum *e = o->firstEnum(); e; e = e->next) + enumTableSize += QV4::CompiledData::Enum::calculateSize(e->enumValues->count); + + objectsSize += enumTableSize; } const int totalSize = unitSize + importSize + objectOffsetTableSize + objectsSize + output.jsGenerator.stringTable.sizeOfTableAndData(); @@ -1455,6 +1519,10 @@ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output, const QV4: objectToWrite->offsetToAliases = nextOffset; nextOffset += objectToWrite->nAliases * sizeof(QV4::CompiledData::Alias); + objectToWrite->nEnums = o->enumCount(); + objectToWrite->offsetToEnums = nextOffset; + nextOffset += objectToWrite->nEnums * sizeof(quint32); + objectToWrite->nSignals = o->signalCount(); objectToWrite->offsetToSignals = nextOffset; nextOffset += objectToWrite->nSignals * sizeof(quint32); @@ -1512,14 +1580,36 @@ QV4::CompiledData::Unit *QmlUnitGenerator::generate(Document &output, const QV4: signalTableSize += size; signalPtr += size; } + nextOffset += signalTableSize; + + quint32_le *enumOffsetTable = reinterpret_cast(objectPtr + objectToWrite->offsetToEnums); + quint32 enumTableSize = 0; + char *enumPtr = objectPtr + nextOffset; + for (const Enum *e = o->firstEnum(); e; e = e->next) { + *enumOffsetTable++ = enumPtr - objectPtr; + QV4::CompiledData::Enum *enumToWrite = reinterpret_cast(enumPtr); + + enumToWrite->nameIndex = e->nameIndex; + enumToWrite->location = e->location; + enumToWrite->nEnumValues = e->enumValues->count; + + QV4::CompiledData::EnumValue *enumValueToWrite = reinterpret_cast(enumPtr + sizeof(*enumToWrite)); + for (EnumValue *enumValue = e->enumValues->first; enumValue; enumValue = enumValue->next, ++enumValueToWrite) + *enumValueToWrite = *enumValue; + + int size = QV4::CompiledData::Enum::calculateSize(e->enumValues->count); + enumTableSize += size; + enumPtr += size; + } quint32_le *namedObjectInComponentPtr = reinterpret_cast(objectPtr + objectToWrite->offsetToNamedObjectsInComponent); for (int i = 0; i < o->namedObjectsInComponent.count; ++i) { *namedObjectInComponentPtr++ = o->namedObjectsInComponent.at(i); } - objectPtr += QV4::CompiledData::Object::calculateSizeExcludingSignals(o->functionCount(), o->propertyCount(), o->aliasCount(), o->signalCount(), o->bindingCount(), o->namedObjectsInComponent.count); + objectPtr += QV4::CompiledData::Object::calculateSizeExcludingSignalsAndEnums(o->functionCount(), o->propertyCount(), o->aliasCount(), o->enumCount(), o->signalCount(), o->bindingCount(), o->namedObjectsInComponent.count); objectPtr += signalTableSize; + objectPtr += enumTableSize; } // enable flag if we encountered pragma Singleton diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h index 64bf111d9a..4c29e0b9f5 100644 --- a/src/qml/compiler/qqmlirbuilder_p.h +++ b/src/qml/compiler/qqmlirbuilder_p.h @@ -265,6 +265,25 @@ public: struct Object; +struct EnumValue : public QV4::CompiledData::EnumValue +{ + EnumValue *next; +}; + +struct Enum +{ + int nameIndex; + QV4::CompiledData::Location location; + PoolList *enumValues; + + int enumValueCount() const { return enumValues->count; } + PoolList::Iterator enumValuesBegin() const { return enumValues->begin(); } + PoolList::Iterator enumValuesEnd() const { return enumValues->end(); } + + Enum *next; +}; + + struct SignalParameter : public QV4::CompiledData::Parameter { SignalParameter *next; @@ -359,6 +378,8 @@ public: int propertyCount() const { return properties->count; } Alias *firstAlias() const { return aliases->first; } int aliasCount() const { return aliases->count; } + const Enum *firstEnum() const { return qmlEnums->first; } + int enumCount() const { return qmlEnums->count; } const Signal *firstSignal() const { return qmlSignals->first; } int signalCount() const { return qmlSignals->count; } Binding *firstBinding() const { return bindings->first; } @@ -372,6 +393,8 @@ public: PoolList::Iterator propertiesEnd() const { return properties->end(); } PoolList::Iterator aliasesBegin() const { return aliases->begin(); } PoolList::Iterator aliasesEnd() const { return aliases->end(); } + PoolList::Iterator enumsBegin() const { return qmlEnums->begin(); } + PoolList::Iterator enumsEnd() const { return qmlEnums->end(); } PoolList::Iterator signalsBegin() const { return qmlSignals->begin(); } PoolList::Iterator signalsEnd() const { return qmlSignals->end(); } PoolList::Iterator functionsBegin() const { return functions->begin(); } @@ -385,6 +408,7 @@ public: QString sanityCheckFunctionNames(const QSet &illegalNames, QQmlJS::AST::SourceLocation *errorLocation); + QString appendEnum(Enum *enumeration); QString appendSignal(Signal *signal); QString appendProperty(Property *prop, const QString &propertyName, bool isDefaultProperty, const QQmlJS::AST::SourceLocation &defaultToken, QQmlJS::AST::SourceLocation *errorLocation); QString appendAlias(Alias *prop, const QString &aliasName, bool isDefaultProperty, const QQmlJS::AST::SourceLocation &defaultToken, QQmlJS::AST::SourceLocation *errorLocation); @@ -408,6 +432,7 @@ private: PoolList *properties; PoolList *aliases; + PoolList *qmlEnums; PoolList *qmlSignals; PoolList *bindings; PoolList *functions; @@ -482,6 +507,7 @@ public: bool visit(QQmlJS::AST::UiArrayBinding *ast) override; bool visit(QQmlJS::AST::UiObjectBinding *ast) override; bool visit(QQmlJS::AST::UiObjectDefinition *ast) override; + bool visit(QQmlJS::AST::UiEnumDeclaration *ast) override; bool visit(QQmlJS::AST::UiPublicMember *ast) override; bool visit(QQmlJS::AST::UiScriptBinding *ast) override; bool visit(QQmlJS::AST::UiSourceElement *ast) override; diff --git a/src/qml/compiler/qqmlpropertycachecreator_p.h b/src/qml/compiler/qqmlpropertycachecreator_p.h index 3c14abc019..5901e4e13e 100644 --- a/src/qml/compiler/qqmlpropertycachecreator_p.h +++ b/src/qml/compiler/qqmlpropertycachecreator_p.h @@ -116,7 +116,7 @@ inline QQmlCompileError QQmlPropertyCacheCreator::buildMetaObje { const CompiledObject *obj = objectContainer->objectAt(objectIndex); - bool needVMEMetaObject = obj->propertyCount() != 0 || obj->aliasCount() != 0 || obj->signalCount() != 0 || obj->functionCount() != 0; + bool needVMEMetaObject = obj->propertyCount() != 0 || obj->aliasCount() != 0 || obj->signalCount() != 0 || obj->functionCount() != 0 || obj->enumCount() != 0; if (!needVMEMetaObject) { auto binding = obj->bindingsBegin(); auto end = obj->bindingsEnd(); @@ -244,7 +244,7 @@ inline QQmlCompileError QQmlPropertyCacheCreator::createMetaObj QQmlRefPointer cache; cache.adopt(baseTypeCache->copyAndReserve(obj->propertyCount() + obj->aliasCount(), obj->functionCount() + obj->propertyCount() + obj->aliasCount() + obj->signalCount(), - obj->signalCount() + obj->propertyCount() + obj->aliasCount())); + obj->signalCount() + obj->propertyCount() + obj->aliasCount(), obj->enumCount())); propertyCaches->set(objectIndex, cache); propertyCaches->setNeedsVMEMetaObject(objectIndex); @@ -370,6 +370,21 @@ inline QQmlCompileError QQmlPropertyCacheCreator::createMetaObj cache->appendSignal(changedSigName, flags, effectiveMethodIndex++); } + auto e = obj->enumsBegin(); + auto eend = obj->enumsEnd(); + for ( ; e != eend; ++e) { + const int enumValueCount = e->enumValueCount(); + QVector values; + values.reserve(enumValueCount); + + auto enumValue = e->enumValuesBegin(); + auto end = e->enumValuesEnd(); + for ( ; enumValue != end; ++enumValue) + values.append(QQmlEnumValue(stringAt(enumValue->nameIndex), enumValue->value)); + + cache->appendEnum(stringAt(e->nameIndex), values); + } + // Dynamic signals auto s = obj->signalsBegin(); auto send = obj->signalsEnd(); diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 876244437e..386f3ae922 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -390,6 +390,36 @@ struct Q_QML_PRIVATE_EXPORT Binding }; +struct EnumValue +{ + quint32_le nameIndex; + qint32_le value; + Location location; +}; + +struct Enum +{ + quint32_le nameIndex; + quint32_le nEnumValues; + Location location; + + const EnumValue *enumValueAt(int idx) const { + return reinterpret_cast(this + 1) + idx; + } + + static int calculateSize(int nEnumValues) { + return (sizeof(Enum) + + nEnumValues * sizeof(EnumValue) + + 7) & ~0x7; + } + + // --- QQmlPropertyCacheCreatorInterface + const EnumValue *enumValuesBegin() const { return enumValueAt(0); } + const EnumValue *enumValuesEnd() const { return enumValueAt(nEnumValues); } + int enumValueCount() const { return nEnumValues; } + // --- +}; + struct Parameter { quint32_le nameIndex; @@ -497,6 +527,8 @@ struct Object quint32_le offsetToProperties; quint32_le nAliases; quint32_le offsetToAliases; + quint32_le nEnums; + quint32_le offsetToEnums; // which in turn will be a table with offsets to variable-sized Enum objects quint32_le nSignals; quint32_le offsetToSignals; // which in turn will be a table with offsets to variable-sized Signal objects quint32_le nBindings; @@ -510,12 +542,13 @@ struct Object // Signal[] // Binding[] - static int calculateSizeExcludingSignals(int nFunctions, int nProperties, int nAliases, int nSignals, int nBindings, int nNamedObjectsInComponent) + static int calculateSizeExcludingSignalsAndEnums(int nFunctions, int nProperties, int nAliases, int nEnums, int nSignals, int nBindings, int nNamedObjectsInComponent) { return ( sizeof(Object) + nFunctions * sizeof(quint32) + nProperties * sizeof(Property) + nAliases * sizeof(Alias) + + nEnums * sizeof(quint32) + nSignals * sizeof(quint32) + nBindings * sizeof(Binding) + nNamedObjectsInComponent * sizeof(int) @@ -543,6 +576,13 @@ struct Object return reinterpret_cast(reinterpret_cast(this) + offsetToBindings); } + const Enum *enumAt(int idx) const + { + const quint32_le *offsetTable = reinterpret_cast((reinterpret_cast(this)) + offsetToEnums); + const quint32_le offset = offsetTable[idx]; + return reinterpret_cast(reinterpret_cast(this) + offset); + } + const Signal *signalAt(int idx) const { const quint32_le *offsetTable = reinterpret_cast((reinterpret_cast(this)) + offsetToSignals); @@ -558,6 +598,7 @@ struct Object // --- QQmlPropertyCacheCreator interface int propertyCount() const { return nProperties; } int aliasCount() const { return nAliases; } + int enumCount() const { return nEnums; } int signalCount() const { return nSignals; } int functionCount() const { return nFunctions; } @@ -570,6 +611,10 @@ struct Object const Alias *aliasesBegin() const { return aliasTable(); } const Alias *aliasesEnd() const { return aliasTable() + nAliases; } + typedef TableIterator EnumIterator; + EnumIterator enumsBegin() const { return EnumIterator(this, 0); } + EnumIterator enumsEnd() const { return EnumIterator(this, nEnums); } + typedef TableIterator SignalIterator; SignalIterator signalsBegin() const { return SignalIterator(this, 0); } SignalIterator signalsEnd() const { return SignalIterator(this, nSignals); } diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc index 33f58dc1b9..befe575fe1 100644 --- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc +++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc @@ -50,6 +50,7 @@ The set of QML object-type attribute types is as follows: \li signal handler attributes \li method attributes \li attached properties and attached signal handler attributes +\li enumeration attributes \endlist These attributes are discussed in detail below. @@ -975,4 +976,41 @@ ListView { Now \c delegateItem.ListView.isCurrentItem correctly refers to the \c isCurrentItem attached property of the delegate. +\section2 Enumeration Attributes + +Enumerations provide a fixed set of named choices. They can be declared in QML using the \c enum keyword: + +\qml +// MyText.qml +Text { + enum TextType { + Normal, + Heading + } +} +\endqml + +As shown above, enumeration types (e.g. \c TextType) and values (e.g. \c Normal) must begin with an uppercase letter. + +Values are referred to via \c {..} or \c {.}. + +\qml +// MyText.qml +Text { + enum TextType { + Normal, + Heading + } + + property int textType: MyText.TextType.Normal + + font.bold: textType == MyText.TextType.Heading + font.pixelSize: textType == MyText.TextType.Heading ? 24 : 12 +} +\endqml + +More information on enumeration usage in QML can be found in the \l {QML Basic Types} \l enumeration documentation. + +The ability to declare enumerations in QML was introduced in Qt 5.10. + */ diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index 61d785066f..89770d269a 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -134,7 +134,7 @@ ReturnedValue QQmlContextWrapper::get(const Managed *m, String *name, bool *hasP if (context->imports && name->startsWithUpper()) { // Search for attached properties, enums and imported scripts - QQmlTypeNameCache::Result r = context->imports->query(name); + QQmlTypeNameCache::Result r = context->imports->query(name, QQmlImport::AllowRecursion); if (r.isValid()) { if (hasProperty) diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g index ca84e0c157..395e62e657 100644 --- a/src/qml/parser/qqmljs.g +++ b/src/qml/parser/qqmljs.g @@ -77,6 +77,7 @@ %token T_MULTILINE_STRING_LITERAL "multiline string literal" %token T_COMMENT "comment" %token T_COMPATIBILITY_SEMICOLON +%token T_ENUM "enum" --- context keywords. %token T_PUBLIC "public" @@ -281,6 +282,7 @@ public: AST::UiArrayMemberList *UiArrayMemberList; AST::UiQualifiedId *UiQualifiedId; AST::UiQualifiedPragmaId *UiQualifiedPragmaId; + AST::UiEnumMemberList *UiEnumMemberList; }; public: @@ -1207,6 +1209,37 @@ case $rule_number: { } break; ./ +UiObjectMember: T_ENUM T_IDENTIFIER T_LBRACE EnumMemberList T_RBRACE; +/. +case $rule_number: { + AST::UiEnumDeclaration *enumDeclaration = new (pool) AST::UiEnumDeclaration(stringRef(2), sym(4).UiEnumMemberList->finish()); + enumDeclaration->enumToken = loc(1); + enumDeclaration->rbraceToken = loc(5); + sym(1).Node = enumDeclaration; + break; +} +./ + +EnumMemberList: T_IDENTIFIER; +/. +case $rule_number: { + AST::UiEnumMemberList *node = new (pool) AST::UiEnumMemberList(stringRef(1)); + node->memberToken = loc(1); + sym(1).Node = node; + break; +} +./ + +EnumMemberList: EnumMemberList T_COMMA T_IDENTIFIER; +/. +case $rule_number: { + AST::UiEnumMemberList *node = new (pool) AST::UiEnumMemberList(sym(1).UiEnumMemberList, stringRef(3)); + node->memberToken = loc(3); + sym(1).Node = node; + break; +} +./ + JsIdentifier: T_IDENTIFIER; JsIdentifier: T_PROPERTY ; @@ -1602,6 +1635,7 @@ ReservedIdentifier: T_DEFAULT ; ReservedIdentifier: T_DELETE ; ReservedIdentifier: T_DO ; ReservedIdentifier: T_ELSE ; +ReservedIdentifier: T_ENUM ; ReservedIdentifier: T_FALSE ; ReservedIdentifier: T_FINALLY ; ReservedIdentifier: T_FOR ; diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp index 7f8cecca8f..2433522f42 100644 --- a/src/qml/parser/qqmljsast.cpp +++ b/src/qml/parser/qqmljsast.cpp @@ -967,6 +967,23 @@ void UiSourceElement::accept0(Visitor *visitor) visitor->endVisit(this); } +void UiEnumDeclaration::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + accept(members, visitor); + } + + visitor->endVisit(this); +} + +void UiEnumMemberList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + } + + visitor->endVisit(this); +} + } } // namespace QQmlJS::AST QT_QML_END_NAMESPACE diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index 0de419d697..d458b2cd35 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -218,7 +218,9 @@ public: Kind_UiQualifiedPragmaId, Kind_UiScriptBinding, Kind_UiSourceElement, - Kind_UiHeaderItemList + Kind_UiHeaderItemList, + Kind_UiEnumDeclaration, + Kind_UiEnumMemberList }; inline Node() @@ -2785,6 +2787,69 @@ public: SourceLocation rbracketToken; }; +class QML_PARSER_EXPORT UiEnumMemberList: public Node +{ + QQMLJS_DECLARE_AST_NODE(UiEnumMemberList) +public: + UiEnumMemberList(const QStringRef &member) + : next(this), member(member) + { kind = K; } + + UiEnumMemberList(UiEnumMemberList *previous, const QStringRef &member) + : member(member) + { + kind = K; + next = previous->next; + previous->next = this; + } + + SourceLocation firstSourceLocation() const override + { return memberToken; } + + SourceLocation lastSourceLocation() const override + { return next ? next->lastSourceLocation() : memberToken; } + + void accept0(Visitor *visitor) override; + + UiEnumMemberList *finish() + { + UiEnumMemberList *head = next; + next = 0; + return head; + } + +// attributes + UiEnumMemberList *next; + QStringRef member; + SourceLocation memberToken; +}; + +class QML_PARSER_EXPORT UiEnumDeclaration: public UiObjectMember +{ +public: + QQMLJS_DECLARE_AST_NODE(UiEnumDeclaration) + + UiEnumDeclaration(const QStringRef &name, + UiEnumMemberList *members) + : name(name) + , members(members) + { kind = K; } + + SourceLocation firstSourceLocation() const override + { return enumToken; } + + SourceLocation lastSourceLocation() const override + { return rbraceToken; } + + void accept0(Visitor *visitor) override; + +// attributes + SourceLocation enumToken; + SourceLocation rbraceToken; + QStringRef name; + UiEnumMemberList *members; +}; + } } // namespace AST diff --git a/src/qml/parser/qqmljsastfwd_p.h b/src/qml/parser/qqmljsastfwd_p.h index 189eb72a57..140a757e51 100644 --- a/src/qml/parser/qqmljsastfwd_p.h +++ b/src/qml/parser/qqmljsastfwd_p.h @@ -181,6 +181,8 @@ class UiArrayMemberList; class UiQualifiedId; class UiQualifiedPragmaId; class UiHeaderItemList; +class UiEnumDeclaration; +class UiEnumMemberList; } } // namespace AST diff --git a/src/qml/parser/qqmljsastvisitor_p.h b/src/qml/parser/qqmljsastvisitor_p.h index e582a8f6a7..13218f0e98 100644 --- a/src/qml/parser/qqmljsastvisitor_p.h +++ b/src/qml/parser/qqmljsastvisitor_p.h @@ -84,6 +84,8 @@ public: virtual bool visit(UiArrayMemberList *) { return true; } virtual bool visit(UiQualifiedId *) { return true; } virtual bool visit(UiQualifiedPragmaId *) { return true; } + virtual bool visit(UiEnumDeclaration *) { return true; } + virtual bool visit(UiEnumMemberList *) { return true; } virtual void endVisit(UiProgram *) {} virtual void endVisit(UiImport *) {} @@ -101,6 +103,8 @@ public: virtual void endVisit(UiArrayMemberList *) {} virtual void endVisit(UiQualifiedId *) {} virtual void endVisit(UiQualifiedPragmaId *) {} + virtual void endVisit(UiEnumDeclaration *) {} + virtual void endVisit(UiEnumMemberList *) { } // QQmlJS virtual bool visit(ThisExpression *) { return true; } diff --git a/src/qml/parser/qqmljsgrammar.cpp b/src/qml/parser/qqmljsgrammar.cpp index ca5a4bbd85..8e47898e2f 100644 --- a/src/qml/parser/qqmljsgrammar.cpp +++ b/src/qml/parser/qqmljsgrammar.cpp @@ -43,1069 +43,1086 @@ QT_BEGIN_NAMESPACE const char *const QQmlJSGrammar::spell [] = { - "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ",", "continue", - "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===", - "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier", - "if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=", - "-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=", - "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return", - ")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch", - "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^", - "^=", "null", "true", "false", "const", "let", "debugger", "reserved word", "multiline string literal", "comment", - 0, "public", "import", "pragma", "as", "on", "get", "set", 0, 0, - 0, 0, 0, 0, 0, 0, 0}; + "end of file", "&", "&&", "&=", "break", "case", "catch", ":", ",", "continue", + "default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===", + "finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier", + "if", "in", "instanceof", "{", "[", "<=", "(", "<", "<<", "<<=", + "-", "-=", "--", "new", "!", "!=", "!==", "numeric literal", "|", "|=", + "||", "+", "+=", "++", "?", "}", "]", "%", "%=", "return", + ")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch", + "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^", + "^=", "null", "true", "false", "const", "let", "debugger", "reserved word", "multiline string literal", "comment", + 0, "enum", "public", "import", "pragma", "as", "on", "get", "set", 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; const short QQmlJSGrammar::lhs [] = { - 107, 107, 107, 107, 107, 107, 108, 114, 114, 117, - 117, 117, 117, 120, 122, 118, 118, 119, 119, 119, - 119, 119, 119, 119, 119, 123, 124, 116, 115, 127, - 127, 128, 128, 129, 129, 126, 112, 112, 112, 112, - 131, 131, 131, 131, 131, 131, 131, 112, 139, 139, - 139, 139, 140, 140, 141, 141, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 125, 125, 125, 125, - 125, 125, 125, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 130, 146, 146, 146, 146, 145, 145, 150, 150, - 150, 148, 148, 151, 151, 151, 151, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, - 155, 121, 121, 121, 121, 121, 158, 158, 159, 159, - 159, 159, 157, 157, 160, 160, 161, 161, 162, 162, - 162, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 164, 164, 164, 164, 165, 165, 165, 166, 166, - 166, 166, 167, 167, 167, 167, 167, 167, 167, 168, - 168, 168, 168, 168, 168, 169, 169, 169, 169, 169, - 170, 170, 170, 170, 170, 171, 171, 172, 172, 173, - 173, 174, 174, 175, 175, 176, 176, 177, 177, 178, - 178, 179, 179, 180, 180, 181, 181, 182, 182, 149, - 149, 183, 183, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 110, 110, 185, 185, 186, - 186, 187, 187, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 132, 196, - 196, 195, 195, 143, 143, 197, 197, 197, 198, 198, - 200, 200, 199, 201, 204, 202, 202, 205, 203, 203, - 133, 134, 134, 135, 135, 188, 188, 188, 188, 188, - 188, 188, 188, 189, 189, 189, 189, 190, 190, 190, - 190, 191, 191, 136, 137, 206, 206, 209, 209, 207, - 207, 210, 208, 192, 193, 193, 138, 138, 138, 211, - 212, 194, 194, 213, 142, 156, 156, 214, 214, 153, - 153, 152, 152, 215, 113, 113, 216, 216, 111, 111, - 147, 147, 217}; + 108, 108, 108, 108, 108, 108, 109, 115, 115, 118, + 118, 118, 118, 121, 123, 119, 119, 120, 120, 120, + 120, 120, 120, 120, 120, 124, 125, 117, 116, 128, + 128, 129, 129, 130, 130, 127, 113, 113, 113, 113, + 132, 132, 132, 132, 132, 132, 132, 113, 140, 140, + 140, 140, 141, 141, 142, 142, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 145, 145, 126, + 126, 126, 126, 126, 126, 126, 146, 146, 146, 146, + 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, + 146, 146, 146, 146, 131, 148, 148, 148, 148, 147, + 147, 152, 152, 152, 150, 150, 153, 153, 153, 153, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 157, 157, 122, 122, 122, 122, 122, + 160, 160, 161, 161, 161, 161, 159, 159, 162, 162, + 163, 163, 164, 164, 164, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 166, 166, 166, 166, 167, + 167, 167, 168, 168, 168, 168, 169, 169, 169, 169, + 169, 169, 169, 170, 170, 170, 170, 170, 170, 171, + 171, 171, 171, 171, 172, 172, 172, 172, 172, 173, + 173, 174, 174, 175, 175, 176, 176, 177, 177, 178, + 178, 179, 179, 180, 180, 181, 181, 182, 182, 183, + 183, 184, 184, 151, 151, 185, 185, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 111, + 111, 187, 187, 188, 188, 189, 189, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 133, 198, 198, 197, 197, 144, 144, 199, + 199, 199, 200, 200, 202, 202, 201, 203, 206, 204, + 204, 207, 205, 205, 134, 135, 135, 136, 136, 190, + 190, 190, 190, 190, 190, 190, 190, 191, 191, 191, + 191, 192, 192, 192, 192, 193, 193, 137, 138, 208, + 208, 211, 211, 209, 209, 212, 210, 194, 195, 195, + 139, 139, 139, 213, 214, 196, 196, 215, 143, 158, + 158, 216, 216, 155, 155, 154, 154, 217, 114, 114, + 218, 218, 112, 112, 149, 149, 219 +}; const short QQmlJSGrammar::rhs [] = { - 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, - 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, - 3, 5, 5, 4, 4, 2, 2, 0, 1, 1, - 2, 1, 3, 2, 3, 2, 1, 5, 4, 4, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, - 1, 3, 0, 1, 2, 4, 6, 6, 3, 3, - 7, 7, 4, 4, 5, 5, 8, 8, 5, 6, - 6, 10, 6, 7, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 3, 3, 4, 5, 3, 4, - 3, 1, 1, 2, 3, 4, 1, 2, 3, 7, - 8, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 4, 3, 5, 1, 2, 4, 4, - 4, 3, 0, 1, 1, 3, 1, 1, 1, 2, - 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 3, 3, 3, 1, 3, 3, 1, 3, - 3, 3, 1, 3, 3, 3, 3, 3, 3, 1, - 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, - 1, 3, 3, 3, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 5, 1, 5, 1, - 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 0, 1, 1, - 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 2, 0, 1, 3, 3, 1, 1, 1, 1, 3, - 1, 3, 2, 2, 2, 0, 1, 2, 0, 1, - 1, 2, 2, 7, 5, 7, 7, 7, 5, 9, - 10, 7, 8, 2, 2, 3, 3, 2, 2, 3, - 3, 3, 3, 5, 5, 3, 5, 1, 2, 0, - 1, 4, 3, 3, 3, 3, 3, 3, 4, 5, - 2, 2, 2, 1, 8, 8, 7, 1, 3, 0, - 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, - 0, 1, 2}; + 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, + 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, + 3, 5, 5, 4, 4, 2, 2, 0, 1, 1, + 2, 1, 3, 2, 3, 2, 1, 5, 4, 4, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, + 1, 3, 0, 1, 2, 4, 6, 6, 3, 3, + 7, 7, 4, 4, 5, 5, 8, 8, 5, 6, + 6, 10, 6, 7, 1, 1, 5, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 3, 3, 4, + 5, 3, 4, 3, 1, 1, 2, 3, 4, 1, + 2, 3, 7, 8, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 4, 3, 5, + 1, 2, 4, 4, 4, 3, 0, 1, 1, 3, + 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 3, 3, 1, + 3, 3, 1, 3, 3, 3, 1, 3, 3, 3, + 3, 3, 3, 1, 3, 3, 3, 3, 3, 1, + 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 5, 1, 5, 1, 3, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 0, 1, 1, 3, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 2, 0, 1, 3, 3, 1, + 1, 1, 1, 3, 1, 3, 2, 2, 2, 0, + 1, 2, 0, 1, 1, 2, 2, 7, 5, 7, + 7, 7, 5, 9, 10, 7, 8, 2, 2, 3, + 3, 2, 2, 3, 3, 3, 3, 5, 5, 3, + 5, 1, 2, 0, 1, 4, 3, 3, 3, 3, + 3, 3, 4, 5, 2, 2, 2, 1, 8, 8, + 7, 1, 3, 0, 1, 0, 1, 1, 1, 1, + 1, 2, 1, 1, 0, 1, 2 +}; const short QQmlJSGrammar::action_default [] = { - 0, 0, 28, 0, 0, 0, 28, 0, 189, 256, - 220, 228, 224, 168, 240, 216, 3, 153, 85, 169, - 232, 236, 157, 186, 167, 172, 152, 206, 193, 0, - 92, 93, 88, 0, 82, 77, 361, 0, 0, 0, - 0, 90, 0, 0, 86, 89, 81, 0, 0, 78, - 80, 83, 79, 91, 84, 0, 87, 0, 0, 182, - 0, 0, 169, 188, 171, 170, 0, 0, 0, 184, - 185, 183, 187, 0, 217, 0, 0, 0, 0, 207, - 0, 0, 0, 0, 0, 0, 197, 0, 0, 0, - 191, 192, 190, 195, 199, 198, 196, 194, 209, 208, - 210, 0, 225, 0, 221, 0, 0, 163, 150, 162, - 151, 118, 119, 120, 145, 121, 147, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 146, 133, - 134, 148, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 149, 0, 0, 161, 257, 164, 0, 165, - 0, 166, 160, 0, 253, 246, 244, 251, 252, 250, - 249, 255, 248, 247, 245, 254, 241, 0, 229, 0, - 0, 233, 0, 0, 237, 0, 0, 163, 155, 0, - 154, 0, 159, 173, 0, 350, 350, 351, 0, 348, - 0, 349, 0, 352, 264, 271, 270, 278, 266, 0, - 267, 0, 353, 0, 360, 268, 269, 85, 274, 272, - 357, 354, 359, 275, 0, 287, 0, 0, 0, 0, - 344, 0, 361, 286, 258, 301, 0, 0, 0, 288, - 0, 0, 276, 277, 0, 265, 273, 302, 303, 0, - 350, 0, 0, 352, 0, 345, 346, 0, 334, 358, - 0, 318, 319, 320, 321, 0, 314, 315, 316, 317, - 342, 343, 0, 0, 0, 0, 0, 306, 307, 308, - 262, 260, 222, 230, 226, 242, 218, 263, 0, 169, - 234, 238, 211, 200, 0, 0, 219, 0, 0, 0, - 0, 212, 0, 0, 0, 0, 0, 204, 202, 205, - 203, 201, 214, 213, 215, 0, 227, 0, 223, 0, - 261, 169, 0, 243, 258, 259, 0, 258, 0, 0, - 310, 0, 0, 0, 312, 0, 231, 0, 0, 235, - 0, 0, 239, 299, 0, 291, 300, 294, 0, 298, - 0, 258, 292, 0, 258, 0, 0, 311, 0, 0, - 0, 313, 0, 0, 0, 305, 0, 304, 85, 112, - 362, 0, 0, 117, 280, 283, 0, 118, 287, 121, - 147, 123, 124, 88, 128, 129, 82, 130, 286, 133, - 86, 89, 258, 83, 91, 136, 84, 138, 87, 140, - 141, 288, 143, 144, 149, 0, 114, 113, 116, 100, - 115, 99, 0, 109, 281, 279, 0, 0, 0, 352, - 0, 110, 157, 158, 163, 0, 156, 0, 322, 323, - 0, 350, 0, 0, 352, 0, 111, 0, 0, 0, - 325, 330, 328, 331, 0, 0, 329, 330, 0, 326, - 0, 327, 282, 333, 0, 282, 332, 0, 335, 336, - 0, 282, 337, 338, 0, 0, 339, 0, 0, 0, - 340, 341, 175, 174, 0, 0, 0, 309, 0, 0, - 0, 324, 296, 289, 0, 297, 293, 0, 295, 284, - 0, 285, 290, 0, 0, 352, 0, 347, 103, 0, - 0, 107, 94, 0, 96, 105, 0, 97, 106, 108, - 98, 104, 95, 0, 101, 179, 177, 181, 178, 176, - 180, 355, 6, 356, 4, 2, 75, 102, 0, 0, - 78, 80, 79, 37, 5, 0, 76, 0, 51, 50, - 49, 0, 0, 51, 0, 0, 0, 52, 0, 67, - 68, 0, 65, 0, 66, 41, 42, 43, 44, 46, - 47, 71, 45, 0, 51, 0, 0, 0, 0, 0, - 61, 0, 62, 0, 0, 32, 0, 0, 72, 33, - 0, 36, 34, 30, 0, 35, 31, 0, 63, 0, - 64, 157, 0, 69, 73, 0, 0, 0, 0, 157, - 282, 0, 70, 85, 118, 287, 121, 147, 123, 124, - 88, 128, 129, 130, 286, 133, 86, 89, 258, 91, - 136, 84, 138, 87, 140, 141, 288, 143, 144, 149, - 74, 0, 59, 53, 60, 54, 0, 0, 0, 0, - 56, 0, 57, 58, 55, 0, 0, 0, 0, 48, - 0, 38, 39, 0, 40, 8, 0, 0, 9, 0, - 11, 0, 10, 0, 1, 27, 15, 14, 26, 13, - 12, 29, 7, 0, 18, 0, 19, 0, 24, 25, - 0, 20, 21, 0, 22, 23, 16, 17, 363}; + 0, 0, 28, 0, 0, 0, 28, 0, 193, 260, + 224, 232, 228, 172, 244, 220, 3, 157, 88, 173, + 236, 240, 161, 190, 171, 176, 156, 210, 197, 0, + 95, 96, 91, 0, 85, 80, 365, 0, 0, 0, + 0, 93, 0, 0, 89, 92, 84, 0, 0, 81, + 83, 86, 82, 94, 87, 0, 90, 0, 0, 186, + 0, 0, 173, 192, 175, 174, 0, 0, 0, 188, + 189, 187, 191, 0, 221, 0, 0, 0, 0, 211, + 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, + 195, 196, 194, 199, 203, 202, 200, 198, 213, 212, + 214, 0, 229, 0, 225, 0, 0, 167, 154, 166, + 155, 121, 122, 123, 149, 124, 151, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 150, + 137, 138, 152, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 153, 0, 0, 165, 261, 168, 0, + 169, 0, 170, 164, 0, 257, 250, 248, 255, 256, + 254, 253, 259, 252, 251, 249, 258, 245, 0, 233, + 0, 0, 237, 0, 0, 241, 0, 0, 167, 159, + 0, 158, 0, 163, 177, 0, 354, 354, 355, 0, + 352, 0, 353, 0, 356, 268, 275, 274, 282, 270, + 0, 271, 0, 357, 0, 364, 272, 273, 88, 278, + 276, 361, 358, 363, 279, 0, 291, 0, 0, 0, + 0, 348, 0, 365, 290, 262, 305, 0, 0, 0, + 292, 0, 0, 280, 281, 0, 269, 277, 306, 307, + 0, 354, 0, 0, 356, 0, 349, 350, 0, 338, + 362, 0, 322, 323, 324, 325, 0, 318, 319, 320, + 321, 346, 347, 0, 0, 0, 0, 0, 310, 311, + 312, 266, 264, 226, 234, 230, 246, 222, 267, 0, + 173, 238, 242, 215, 204, 0, 0, 223, 0, 0, + 0, 0, 216, 0, 0, 0, 0, 0, 208, 206, + 209, 207, 205, 218, 217, 219, 0, 231, 0, 227, + 0, 265, 173, 0, 247, 262, 263, 0, 262, 0, + 0, 314, 0, 0, 0, 316, 0, 235, 0, 0, + 239, 0, 0, 243, 303, 0, 295, 304, 298, 0, + 302, 0, 262, 296, 0, 262, 0, 0, 315, 0, + 0, 0, 317, 0, 0, 0, 309, 0, 308, 88, + 115, 366, 0, 0, 120, 284, 287, 0, 121, 291, + 124, 151, 126, 127, 91, 132, 133, 85, 134, 290, + 137, 89, 92, 262, 86, 94, 140, 87, 142, 90, + 144, 145, 292, 147, 148, 153, 0, 117, 116, 119, + 103, 118, 102, 0, 112, 285, 283, 0, 0, 0, + 356, 0, 113, 161, 162, 167, 0, 160, 0, 326, + 327, 0, 354, 0, 0, 356, 0, 114, 0, 0, + 0, 329, 334, 332, 335, 0, 0, 333, 334, 0, + 330, 0, 331, 286, 337, 0, 286, 336, 0, 339, + 340, 0, 286, 341, 342, 0, 0, 343, 0, 0, + 0, 344, 345, 179, 178, 0, 0, 0, 313, 0, + 0, 0, 328, 300, 293, 0, 301, 297, 0, 299, + 288, 0, 289, 294, 0, 0, 356, 0, 351, 106, + 0, 0, 110, 97, 0, 99, 108, 0, 100, 109, + 111, 101, 107, 98, 0, 104, 183, 181, 185, 182, + 180, 184, 359, 6, 360, 4, 2, 75, 105, 0, + 0, 0, 81, 83, 82, 37, 5, 0, 76, 0, + 51, 50, 49, 0, 0, 51, 0, 0, 0, 52, + 0, 67, 68, 0, 65, 0, 66, 41, 42, 43, + 44, 46, 47, 71, 45, 0, 0, 0, 78, 0, + 77, 79, 0, 51, 0, 0, 0, 0, 0, 61, + 0, 62, 0, 0, 32, 0, 0, 72, 33, 0, + 36, 34, 30, 0, 35, 31, 0, 63, 0, 64, + 161, 0, 69, 73, 0, 0, 0, 0, 161, 286, + 0, 70, 88, 121, 291, 124, 151, 126, 127, 91, + 132, 133, 134, 290, 137, 89, 92, 262, 94, 140, + 87, 142, 90, 144, 145, 292, 147, 148, 153, 74, + 0, 59, 53, 60, 54, 0, 0, 0, 0, 56, + 0, 57, 58, 55, 0, 0, 0, 0, 48, 0, + 38, 39, 0, 40, 8, 0, 0, 9, 0, 11, + 0, 10, 0, 1, 27, 15, 14, 26, 13, 12, + 29, 7, 0, 18, 0, 19, 0, 24, 25, 0, + 20, 21, 0, 22, 23, 16, 17, 367 +}; const short QQmlJSGrammar::goto_default [] = { - 7, 654, 212, 199, 210, 524, 512, 649, 662, 511, - 648, 652, 650, 658, 22, 655, 653, 651, 18, 523, - 574, 564, 571, 566, 551, 194, 198, 200, 205, 236, - 213, 233, 555, 626, 625, 204, 235, 26, 490, 489, - 361, 360, 9, 359, 362, 203, 483, 363, 109, 17, - 148, 24, 13, 147, 19, 25, 59, 23, 8, 28, - 27, 282, 15, 276, 10, 272, 12, 274, 11, 273, - 20, 280, 21, 281, 14, 275, 271, 312, 417, 277, - 278, 206, 196, 195, 209, 208, 232, 197, 366, 365, - 234, 474, 473, 334, 335, 476, 337, 475, 336, 430, - 434, 437, 433, 432, 452, 453, 201, 187, 202, 211, - 0}; + 7, 663, 213, 200, 211, 526, 513, 658, 671, 512, + 657, 661, 659, 667, 22, 664, 662, 660, 18, 525, + 583, 573, 580, 575, 553, 195, 199, 201, 206, 237, + 214, 234, 564, 635, 634, 205, 236, 557, 26, 491, + 490, 362, 361, 9, 360, 363, 204, 484, 364, 109, + 17, 149, 24, 13, 148, 19, 25, 59, 23, 8, + 28, 27, 283, 15, 277, 10, 273, 12, 275, 11, + 274, 20, 281, 21, 282, 14, 276, 272, 313, 418, + 278, 279, 207, 197, 196, 210, 209, 233, 198, 367, + 366, 235, 475, 474, 335, 336, 477, 338, 476, 337, + 431, 435, 438, 434, 433, 453, 454, 202, 188, 203, + 212, 0 +}; const short QQmlJSGrammar::action_index [] = { - 308, 1392, 2787, 2787, 2890, 1102, 71, 6, 103, -107, - 10, -35, -64, 287, -107, 310, 11, -107, -107, 815, - 30, 112, 183, 214, -107, -107, -107, 463, 203, 1392, - -107, -107, -107, 536, -107, -107, 2478, 1786, 1392, 1392, - 1392, -107, 1005, 1392, -107, -107, -107, 1392, 1392, -107, - -107, -107, -107, -107, -107, 1392, -107, 1392, 1392, -107, - 1392, 1392, 75, 204, -107, -107, 1392, 1392, 1392, -107, - -107, -107, 221, 1392, 306, 1392, 1392, 1392, 1392, 463, - 1392, 1392, 1392, 1392, 1392, 1392, 200, 1392, 1392, 1392, - 149, 145, 108, 231, 241, 295, 379, 379, 463, 463, - 463, 1392, -70, 1392, 4, 2375, 1392, 1392, -107, -107, - -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, 105, 1392, -107, -107, -5, -58, -107, - 1392, -107, -107, 1392, -107, -107, -107, -107, -107, -107, - -107, -107, -107, -107, -107, -107, -107, 1392, -44, 1392, - 1392, 5, 7, 1392, -107, 2375, 1392, 1392, -107, 134, - -107, -43, -107, -107, -16, 541, 541, 15, -36, -107, - 462, -107, -4, 2787, -107, -107, -107, -107, -107, 213, - -107, 449, -107, -20, -107, -107, -107, 31, -107, -107, - -107, 2787, -107, -107, 616, -107, 711, 144, 2890, 21, - 42, 43, 3096, -107, 1392, -107, 62, 1392, 101, -107, - 102, 99, -107, -107, 417, -107, -107, -107, -107, 93, - 441, 56, 92, 2787, 34, -107, -107, 2890, -107, -107, - 118, -107, -107, -107, -107, 125, -107, -107, -107, -107, - -107, -107, -14, 33, 1392, 137, 193, -107, -107, -107, - 1488, -107, 44, -1, -42, -107, 316, -8, -60, 718, - 97, 87, 368, 222, 359, 1392, 313, 1392, 1392, 1392, - 1392, 342, 1392, 1392, 1392, 1392, 1392, 271, 270, 263, - 262, 225, 346, 352, 362, 1392, -51, 1392, 29, 1392, - -107, 815, 1392, -107, 1392, 28, -22, 1392, -19, 2890, - -107, 1392, 160, 2890, -107, 1392, 0, 1392, 1392, 97, - 45, 1392, -107, 37, 142, 25, -107, -107, 1392, -107, - 541, 1392, -107, 9, 1392, 12, 2890, -107, 1392, 128, - 2890, -107, 1392, 124, 2890, 61, 2890, -107, 60, -107, - 67, 26, 73, -107, -107, 2890, 49, 544, 80, 556, - 114, 1392, 2890, 85, 58, 482, 2581, 64, 88, 1005, - 90, 94, 1588, 2581, 96, 70, 197, 1392, 100, 76, - 1392, 104, 1392, 82, 84, 2684, -107, -107, -107, -107, - -107, -107, 1392, -107, -107, -107, 95, 63, 91, 2787, - 53, -107, 217, -107, 1392, 50, -107, 120, -107, -107, - 40, 372, 8, 27, 2787, 3, -107, 1392, 141, 20, - -107, 46, -107, 41, 147, 1392, -107, 39, 36, -107, - -15, -107, 2890, -107, 297, 2890, -107, 175, -107, -107, - 187, 2890, 14, -107, -3, -2, -107, 459, -34, -6, - -107, -107, -107, -107, 1392, 139, 2890, -107, 1392, 132, - 2890, -107, 1, -107, 251, -107, -107, 1392, -107, -107, - 541, -107, -107, -48, -23, 2787, -47, -107, -107, 113, - 1984, -107, -107, 1885, -107, -107, 1687, -107, -107, -107, - -107, -107, -107, 107, -107, -107, -107, -107, -107, -107, - -107, -107, -107, 2787, -107, -107, -107, 131, -50, 910, - 243, -45, -7, -107, -107, 232, -107, 206, -12, -107, - -107, 633, 189, -107, 198, 13, 385, -107, 153, -107, - -107, 184, -107, 2080, -107, -107, -107, -107, -107, -107, - -107, -107, -107, 208, 18, 633, 219, 129, 353, 292, - -107, 48, -107, 910, 122, -107, 81, 910, -107, -107, - 1296, -107, -107, -107, 1199, -107, -107, 224, -107, 2080, - -107, 311, 81, -107, -107, 205, 633, 98, 2176, 304, - 2993, 69, -107, 89, 613, 86, 597, 109, 1392, 2890, - 83, 55, 467, 52, 79, 804, 78, 77, 1588, 66, - 47, 59, 1392, 57, 32, 1392, 54, 1392, 38, 35, - -107, 255, -107, 228, -107, 51, 2, 524, 195, 532, - -107, 133, -107, -107, -107, 2272, 910, 1786, 17, -107, - 152, -107, -107, 16, -107, -107, 910, 910, 119, 910, - -107, 302, -107, 148, -107, -107, 143, 140, -107, -107, - -107, -107, -107, 369, -107, 249, -107, 111, -107, -107, - 364, -107, -107, 65, -107, -107, -107, -107, -107, + 301, 1388, 2901, 2901, 2797, 1095, 106, 97, 99, -108, + 92, 88, 85, 364, -108, 338, 96, -108, -108, 805, + 100, 161, 281, 247, -108, -108, -108, 394, 274, 1388, + -108, -108, -108, 516, -108, -108, 2589, 1786, 1388, 1388, + 1388, -108, 997, 1388, -108, -108, -108, 1388, 1388, -108, + -108, -108, -108, -108, -108, 1388, -108, 1388, 1388, -108, + 1388, 1388, 116, 235, -108, -108, 1388, 1388, 1388, -108, + -108, -108, 220, 1388, 326, 1388, 1388, 1388, 1388, 384, + 1388, 1388, 1388, 1388, 1388, 1388, 193, 1388, 1388, 1388, + 115, 103, 102, 211, 227, 231, 257, 230, 424, 414, + 404, 1388, 85, 1388, 78, 2381, 1388, 1388, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, + -108, -108, -108, -108, 157, 1388, -108, -108, 68, 61, + -108, 1388, -108, -108, 1388, -108, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -108, -108, -108, 1388, 59, + 1388, 1388, 71, 60, 1388, -108, 2381, 1388, 1388, -108, + 271, -108, 54, -108, -108, 53, 428, 434, 58, 51, + -108, 437, -108, 50, 2901, -108, -108, -108, -108, -108, + 232, -108, 528, -108, 48, -108, -108, -108, 55, -108, + -108, -108, 2901, -108, -108, 634, -108, 637, 101, 2797, + 56, 90, 89, 3109, -108, 1388, -108, 86, 1388, 77, + -108, 84, 82, -108, -108, 425, -108, -108, -108, -108, + 81, 346, 75, 66, 2901, 74, -108, -108, 2797, -108, + -108, 121, -108, -108, -108, -108, 117, -108, -108, -108, + -108, -108, -108, 63, 69, 1388, 108, 160, -108, -108, + -108, 1586, -108, 80, 67, 72, -108, 324, 76, 73, + 711, 83, 122, 449, 308, 411, 1388, 331, 1388, 1388, + 1388, 1388, 449, 1388, 1388, 1388, 1388, 1388, 303, 299, + 298, 284, 280, 449, 357, 449, 1388, -20, 1388, 57, + 1388, -108, 805, 1388, -108, 1388, 70, 62, 1388, 64, + 2797, -108, 1388, 204, 2797, -108, 1388, 65, 1388, 1388, + 104, 105, 1388, -108, 91, 136, 171, -108, -108, 1388, + -108, 528, 1388, -108, -6, 1388, 87, 2797, -108, 1388, + 129, 2797, -108, 1388, 125, 2797, 93, 2797, -108, 79, + -108, 22, -36, 20, -108, -108, 2797, -34, 581, 15, + 594, 113, 1388, 2797, 16, -12, 508, 2485, -11, 11, + 997, 21, 24, 1489, 2485, 25, -2, 3, 1388, 94, + -32, 1388, -4, 1388, -30, -29, 2693, -108, -108, -108, + -108, -108, -108, 1388, -108, -108, -108, -19, -9, 37, + 2901, -1, -108, 285, -108, 1388, 5, -108, 134, -108, + -108, 39, 421, 40, 44, 2901, 41, -108, 1388, 141, + 47, -108, 52, -108, 36, 206, 1388, -108, 30, 29, + -108, -16, -108, 2797, -108, 123, 2797, -108, 270, -108, + -108, 132, 2797, 18, -108, 27, 28, -108, 528, -10, + 31, -108, -108, -108, -108, 1388, 133, 2797, -108, 1388, + 124, 2797, -108, 9, -108, 209, -108, -108, 1388, -108, + -108, 445, -108, -108, 0, -17, 2901, -51, -108, -108, + 111, 1986, -108, -108, 1686, -108, -108, 1886, -108, -108, + -108, -108, -108, -108, 120, -108, -108, -108, -108, -108, + -108, -108, -108, -108, 2901, -108, -108, -108, 112, -22, + 23, 901, 216, -26, 13, -108, -108, 218, -108, 210, + 45, -108, -108, 621, 201, -108, 162, 43, 401, -108, + 144, -108, -108, 219, -108, 2277, -108, -108, -108, -108, + -108, -108, -108, -108, -108, -31, 17, 186, -108, 19, + -108, -108, 208, 34, 621, 200, 166, 528, 228, -108, + -5, -108, 901, 190, -108, -13, 794, -108, -108, 1291, + -108, -108, -108, 1193, -108, -108, 212, -108, 2277, -108, + 352, -13, -108, -108, 185, 521, 26, 2083, 319, 3005, + 4, -108, 1, 571, 2, 700, 146, 1388, 2797, -7, + -25, 511, -24, 6, 997, 7, 8, 1489, 46, 38, + 49, 1388, 94, 12, 1388, 42, 1388, 32, 33, -108, + 277, -108, 273, -108, -3, 35, 524, 233, 621, -108, + 98, -108, -108, -108, 2180, 901, 1786, 14, -108, 153, + -108, -108, 10, -108, -108, 901, 901, 110, 901, -108, + 300, -108, 95, -108, -108, 176, 158, -108, -108, -108, + -108, -108, 528, -108, 172, -108, 109, -108, -108, 528, + -108, -108, 126, -108, -108, -108, -108, -108, - -111, 55, 62, 77, 71, 279, -7, -111, -111, -111, - -111, -111, -111, -111, -111, -111, -111, -111, -111, -74, - -111, -111, -111, -111, -111, -111, -111, -111, -111, 70, - -111, -111, -111, -8, -111, -111, -6, -28, 12, 84, - 85, -111, 93, 100, -111, -111, -111, 101, 104, -111, - -111, -111, -111, -111, -111, 107, -111, 112, 118, -111, - 182, 184, -111, -111, -111, -111, 218, 215, 209, -111, - -111, -111, -111, 202, -111, 195, 193, 192, 191, -111, - 189, 183, 181, 175, 168, 155, -111, 170, 153, 150, - -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, 151, -111, 142, -111, 172, 30, -4, -111, -111, - -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, -111, -111, -111, -2, -111, -111, -111, -111, -111, - 0, -111, -111, 9, -111, -111, -111, -111, -111, -111, - -111, -111, -111, -111, -111, -111, -111, 125, -111, 122, - 10, -111, -111, 22, -111, 236, 46, 127, -111, -111, - -111, -111, -111, -111, -111, 37, 124, -111, -111, -111, - 39, -111, -111, 42, -111, -111, -111, -111, -111, -111, - -111, 44, -111, -111, -111, -111, -111, -111, -111, -111, - -111, 94, -111, -111, 47, -111, 48, -111, 128, -111, - 50, -111, 91, -111, -3, -111, -111, 66, 53, -111, - -111, -111, -111, -111, 57, -111, -111, -111, -111, -111, - 79, -111, -111, 78, -111, -111, -111, 82, -111, -111, - -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, -111, -111, -111, 67, -111, -111, -111, -111, -111, - 61, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, -111, -111, -111, 59, 258, -111, 259, 268, 269, - 272, -111, 60, 63, 73, 74, 75, -111, -111, -111, - -111, -111, -111, -111, -111, 252, -111, 242, -111, 233, - -111, -111, 232, -111, 87, -111, -111, 89, -111, 133, - -111, 51, -111, 135, -111, 231, -111, 223, 222, -111, - -111, 221, -111, -111, -111, -111, -111, -111, 219, -111, - 92, 102, -111, -111, 110, -111, 171, -111, 40, -111, - 173, -111, 38, -111, 176, -111, 179, -111, -111, -111, - -111, -111, -111, -111, -111, 180, -111, 19, -111, 18, - -111, 145, 185, -111, -111, 17, 166, -111, -111, 65, - -111, -111, 29, 177, -111, -111, -111, 25, -111, 5, - 159, -111, 164, -111, -111, 207, -111, -111, -111, -111, - -111, -111, -18, -111, -111, -111, -111, -111, -111, 212, - -111, -111, -111, -111, 216, -111, -111, -111, -111, -111, - -111, 213, -111, -111, 86, -111, -111, 16, -111, -111, - -111, -111, -111, -85, -111, 14, -111, -84, -111, -111, - -111, -111, 286, -111, -111, 287, -111, -111, -111, -111, - -111, 214, -94, -111, -111, -16, -111, -10, -111, -19, - -111, -111, -111, -111, 2, -111, 83, -111, 105, -111, - 81, -111, -111, -111, -111, -111, -111, -41, -111, -111, - 131, -111, -111, -111, -111, 76, -111, -111, -111, -111, - -35, -111, -111, 64, -111, -111, -29, -111, -111, -111, - -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, -111, -111, 208, -111, -111, -111, -111, -111, 20, - -111, -111, -111, -111, -111, -111, -111, 13, -111, -111, - -111, 26, 15, -111, -111, -111, 32, -111, -111, -111, - -111, -111, -111, 329, -111, -111, -111, -111, -111, -111, - -111, -111, -111, -111, -111, 54, 56, -111, 58, -111, - -111, -111, -111, 68, -111, -111, -111, 72, -111, -111, - 330, -111, -111, -111, 327, -111, -111, -111, -111, 389, - -111, -111, 52, -111, -111, 31, 49, -111, 371, -111, - 134, 34, -111, -111, 43, -111, 41, -111, 108, 141, - -111, -111, 35, -111, -111, 97, -111, -111, 45, -111, - -111, -111, 36, -111, 21, 129, -111, 146, -111, -111, - -111, -111, -111, -1, -111, -111, -111, 11, -5, 7, - -111, -111, -111, -111, -111, 353, 311, 408, 4, -111, - -111, -111, -111, 1, -111, -111, 8, 6, 249, 248, - -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, - -111, -111, -111, 3, -111, -111, -111, -111, -111, -111, - -14, -111, -111, -111, -111, -111, -111, -111, -111}; + -112, -3, 65, 88, 78, 292, -4, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -70, + -112, -112, -112, -112, -112, -112, -112, -112, -112, 70, + -112, -112, -112, 10, -112, -112, 2, -24, 15, 96, + 99, -112, 130, 103, -112, -112, -112, 48, 62, -112, + -112, -112, -112, -112, -112, 57, -112, 82, 203, -112, + 187, 181, -112, -112, -112, -112, 169, 177, 178, -112, + -112, -112, -112, 189, -112, 196, 198, 206, 161, -112, + 107, 113, 135, 116, 117, 119, -112, 125, 128, 133, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, 139, -112, 145, -112, 180, 8, -42, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, 5, -112, -112, -112, -112, + -112, 31, -112, -112, 32, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, 86, -112, + 77, 17, -112, -112, 28, -112, 273, 37, 79, -112, + -112, -112, -112, -112, -112, -112, 61, 95, -112, -112, + -112, 46, -112, -112, 58, -112, -112, -112, -112, -112, + -112, -112, 45, -112, -112, -112, -112, -112, -112, -112, + -112, -112, 131, -112, -112, 29, -112, 33, -112, 84, + -112, 39, -112, 223, -112, 42, -112, -112, 35, 16, + -112, -112, -112, -112, -112, 49, -112, -112, -112, -112, + -112, 184, -112, -112, 194, -112, -112, -112, 199, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, 19, -112, -112, -112, -112, + -112, 76, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -11, 214, -112, 215, 221, + 224, 225, -112, 92, 90, 83, 74, 73, -112, -112, + -112, -112, -112, -112, -112, -112, 237, -112, 234, -112, + 243, -112, -112, 254, -112, 67, -112, -112, 85, -112, + 167, -112, 26, -112, 219, -112, 247, -112, 244, 241, + -112, -112, 233, -112, -112, -112, -112, -112, -112, 213, + -112, 108, 183, -112, -112, 193, -112, 202, -112, 106, + -112, 209, -112, 55, -112, 317, -112, 205, -112, -112, + -112, -112, -112, -112, -112, -112, 191, -112, 59, -112, + 60, -112, 134, 179, -112, -112, 44, 160, -112, -112, + 156, -112, -112, 41, 211, -112, -112, -112, 50, -112, + 36, 192, -112, 63, -112, -112, 72, -112, -112, -112, + -112, -112, -112, 23, -112, -112, -112, -112, -112, -112, + 75, -112, -112, -112, -112, 114, -112, -112, -112, -112, + -112, -112, 64, -112, -112, 69, -112, -112, 52, -112, + -112, -112, -112, -112, -50, -112, 56, -112, -45, -112, + -112, -112, -112, 293, -112, -112, 264, -112, -112, -112, + -112, -112, 89, -64, -112, -112, 24, -112, 25, -112, + 27, -112, -112, -112, -112, 34, -112, 122, -112, 47, + -112, 66, -112, -112, -112, -112, -112, -112, 38, -112, + -112, 220, -112, -112, -112, -112, 197, -112, -112, -112, + -112, 30, -112, -112, 120, -112, -112, 3, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, 195, -112, -112, -112, -112, -112, + -112, 51, -112, -112, -112, -112, -112, -112, -112, 40, + -112, -112, -112, -15, -28, -112, -112, -112, -12, -112, + -112, -112, -112, -112, -112, 314, -112, -112, -112, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -112, -112, 7, 0, -112, 21, -112, -112, + -112, -112, 147, -112, -112, -112, 236, -112, -112, 324, + -112, -112, -112, 424, -112, -112, -112, -112, 360, -112, + -112, 13, -112, -112, -1, 12, -112, 338, -112, 212, + 4, -112, -112, 9, -112, -6, -112, 208, 246, -112, + -112, 6, -112, -112, 71, -112, -112, 18, -112, -112, + -112, 14, -112, -10, 53, -112, 43, -112, -112, -112, + -112, -112, -30, -112, -112, -112, -5, -18, -2, -112, + -112, -112, -112, -112, 378, 81, 311, 1, -112, -112, + -112, -112, 11, -112, -112, 20, 22, 207, 80, -112, + -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, + -112, -112, -8, -112, -112, -112, -112, -112, -112, -9, + -112, -112, -112, -112, -112, -112, -112, -112 +}; const short QQmlJSGrammar::action_info [] = { - 309, 314, 152, 150, 101, 73, 678, 167, 487, 103, - 485, 73, 484, 101, 173, 103, 527, 182, 477, 144, - 186, 585, 621, 190, 192, 532, 459, 451, 307, 193, - 285, 451, 167, 457, 455, 246, 144, 307, 247, 317, - 441, 319, 537, 442, 435, 285, 435, 305, 305, 570, - 570, 435, 331, 431, 338, 556, 348, 270, 426, 628, - 424, -142, 631, 263, -139, 451, -137, 247, 423, 264, - 344, 468, 346, -115, 464, 395, 421, 356, 185, 352, - 402, 401, 563, 427, -116, -134, -146, -145, 352, 245, - -126, 270, -126, -145, 270, -146, 247, -134, 427, 325, - 352, -116, 570, -115, 405, 588, 427, -139, 411, 451, - 416, -142, 0, 144, 570, 144, 242, 64, 464, 0, - 468, 493, 0, 408, 409, 243, 675, 674, 65, 240, - 567, 407, 144, 0, 451, 468, 144, 327, 464, 0, - 144, 328, 144, 60, 535, 144, 175, 144, 60, 144, - 340, 0, 0, 558, 61, 175, 0, 438, 175, 61, - 567, 145, 169, 646, 647, 176, 170, 504, 144, 494, - 261, 260, 669, 668, 176, 261, 260, 176, 568, 254, - 253, 419, 418, 144, 354, 60, 259, 258, 350, 60, - 180, 543, 470, 454, 633, 632, 61, 266, 175, 466, - 61, 429, 439, 341, -137, 261, 260, 455, 641, 677, - 676, 646, 647, 535, 540, 539, 66, 176, 533, 177, - 323, 144, 536, 175, 533, 87, 66, 88, 87, 0, - 88, 579, 175, 66, 533, 528, 449, 448, 89, 635, - 0, 89, 176, 0, 414, 544, 542, 87, 533, 88, - 87, 176, 88, 414, 269, 267, 87, 533, 88, 480, - 89, 67, 0, 89, 530, 570, 87, 68, 88, 89, - 530, 67, 554, 0, 238, 237, 529, 68, 67, 89, - 530, 530, 529, 268, 68, 580, 578, 87, 87, 88, - 88, 623, 529, 529, 530, 87, 87, 88, 88, 561, - 89, 89, 105, 530, 445, 144, 529, 0, 89, 89, - 672, 671, 481, 479, 0, 529, 624, 622, 530, 175, - 87, 106, 88, 107, 75, 76, 175, 636, 75, 76, - 529, 287, 288, 89, 287, 288, 0, -102, 176, 0, - 177, 0, 0, 670, -102, 176, 0, 177, 0, 665, - 0, 77, 78, 562, 560, 77, 78, 0, 289, 290, - 0, 289, 290, 666, 664, 292, 293, 0, 0, 292, - 293, 0, 0, 0, 294, 292, 293, 295, 294, 296, - 0, 295, 35, 296, 294, 292, 293, 295, 35, 296, - 0, 292, 293, 35, 294, 0, 663, 295, 35, 296, - 294, 35, 0, 295, 87, 296, 88, 6, 5, 4, - 1, 3, 2, 0, 35, 0, 0, 89, 0, 49, - 52, 50, 0, 0, 0, 49, 52, 50, 0, 0, - 49, 52, 50, 0, 0, 49, 52, 50, 49, 52, - 50, 0, 0, 0, 0, 0, 35, 0, 46, 34, - 51, 49, 52, 50, 46, 34, 51, 0, 0, 46, - 34, 51, 0, 0, 46, 34, 51, 46, 34, 51, - 35, 0, 0, 0, 0, 0, 0, 0, 35, 0, - 46, 34, 51, 49, 52, 50, 80, 81, 35, 0, - 0, 35, 0, 0, 82, 83, 35, 0, 84, 0, - 85, 0, 0, 185, 0, 0, 0, 49, 52, 50, - 0, 35, 46, 34, 51, 49, 52, 50, 185, 0, - 0, 0, 0, 0, 0, 49, 52, 50, 49, 52, - 50, 0, 0, 49, 52, 50, 46, 34, 51, 535, - 0, 0, 0, 0, 46, 34, 51, 535, 49, 52, - 50, 0, 0, 35, 46, 34, 51, 46, 34, 51, - 0, 35, 46, 34, 51, 35, 0, 0, 0, 0, - 35, 0, 185, 35, 0, 0, 0, 46, 34, 51, - 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, - 49, 52, 50, 0, 0, 0, 0, 0, 49, 52, - 50, 0, 49, 52, 50, 252, 251, 49, 52, 50, - 49, 52, 50, 0, 0, 0, 0, 257, 256, 46, - 34, 51, 49, 52, 50, 0, 35, 46, 34, 51, - 0, 46, 34, 51, 0, 0, 46, 34, 51, 46, - 34, 51, 35, 0, 0, 35, 0, 0, 535, 0, - 0, 46, 34, 51, 0, 0, 0, 0, 257, 256, - 0, 0, 35, 49, 52, 50, 0, 0, 0, 0, - 0, 0, 0, 0, 252, 251, 0, 252, 251, 49, - 52, 50, 49, 52, 50, 0, 0, 0, 0, 0, - 0, 0, 46, 34, 51, 0, 0, 0, 0, 49, - 52, 50, 0, 0, 0, 0, 0, 0, 46, 34, - 51, 46, 34, 51, 0, 0, 0, 0, 0, 0, - 0, 154, 0, 0, 0, 0, 0, 0, 46, 34, - 51, 155, 0, 0, 0, 156, 0, 0, 0, 0, - 35, 0, 0, 0, 157, 0, 158, 0, 0, 321, - 0, 0, 0, 0, 0, 0, 0, 159, 0, 160, - 64, 0, 0, 0, 0, 0, 0, 161, 0, 0, - 162, 65, 257, 256, 0, 0, 163, 49, 52, 50, - 0, 0, 164, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 165, 0, - 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, - 0, 0, 0, 0, 0, 0, 30, 31, 154, 0, - 0, 0, 0, 0, 0, 0, 33, 0, 155, 0, - 0, 0, 156, 35, 0, 0, 0, 36, 37, 0, - 38, 157, 0, 158, 0, 0, 0, 42, 0, 0, - 0, 45, 0, 0, 159, 0, 160, 64, 0, 0, - 0, 0, 0, 0, 161, 0, 0, 162, 65, 53, - 49, 52, 50, 163, 54, 0, 0, 0, 0, 164, - 0, 0, 0, 0, 0, 44, 56, 32, 0, 0, - 0, 0, 41, 0, 0, 165, 0, 0, 0, 46, - 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 30, 31, 0, 0, 0, 0, 0, 0, - 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, - 0, 0, 0, 36, 37, 0, 38, 0, 0, 0, - 0, 0, 0, 519, 0, 0, 0, 45, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 53, 49, 52, 50, 0, - 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 44, 56, 32, 0, 0, 0, 0, 41, 0, - 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, - 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, - 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, - 0, 38, 0, 0, 0, 0, 0, 0, 42, 0, - 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 53, 49, 52, 50, 0, 54, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 44, 56, 32, 0, - 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, - 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 518, 0, 30, 31, 0, 0, 0, 0, - 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, - 0, 35, 0, 0, 0, 36, 37, 0, 38, 0, - 0, 0, 0, 0, 0, 519, 0, 0, 0, 45, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 53, 520, 522, - 521, 0, 54, 0, 0, 0, 0, 229, 0, 0, - 0, 0, 0, 44, 56, 32, 215, 223, 0, 0, - 41, 0, 0, 0, 0, 0, 0, 46, 34, 51, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 518, - 0, 30, 31, 0, 0, 0, 0, 0, 0, 0, - 0, 220, 0, 0, 0, 0, 0, 0, 35, 0, - 0, 0, 36, 37, 0, 38, 0, 0, 0, 0, - 0, 0, 519, 0, 0, 0, 45, 0, 0, 0, - 0, 0, 0, 0, 575, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 53, 520, 522, 521, 0, 54, - 0, 0, 0, 0, 229, 0, 0, 0, 0, 0, - 44, 56, 32, 215, 223, 0, 0, 41, 0, 0, - 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 518, 0, 30, 31, - 0, 0, 0, 0, 0, 0, 0, 0, 220, 0, - 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, - 37, 0, 38, 0, 0, 0, 0, 0, 0, 519, - 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, - 0, 572, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 53, 520, 522, 521, 0, 54, 0, 0, 0, - 0, 229, 0, 0, 0, 0, 0, 44, 56, 32, - 215, 223, 0, 0, 41, 0, 0, 0, 0, 0, - 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, - 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, - 0, 35, 0, 0, 0, 36, 37, 0, 38, 0, - 0, 0, 39, 0, 40, 42, 43, 0, 0, 45, - 0, 0, 0, 47, 0, 48, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 53, 49, 52, - 50, 0, 54, 0, 55, 0, 57, 0, 58, 0, - 0, 0, 0, 44, 56, 32, 0, 0, 0, 0, - 41, 0, 0, 0, 0, 0, 0, 46, 34, 51, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, - 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 0, 0, 0, 0, 0, 0, 35, 0, 0, - 0, 36, 37, 0, 38, 0, 0, 0, 39, 0, - 40, 42, 43, 0, 0, 45, 0, 0, 0, 47, - 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 53, 49, 52, 50, 0, 54, 0, - 55, 0, 57, 284, 58, 0, 0, 0, 0, 44, - 56, 32, 0, 0, 0, 0, 41, 0, 0, 0, - 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -135, 0, 0, 0, 29, - 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 0, 0, 0, 0, 0, 0, 35, 0, 0, - 0, 36, 37, 0, 38, 0, 0, 0, 39, 0, - 40, 42, 43, 0, 0, 45, 0, 0, 0, 47, - 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 53, 49, 52, 50, 0, 54, 0, - 55, 0, 57, 0, 58, 0, 0, 0, 0, 44, - 56, 32, 0, 0, 0, 0, 41, 0, 0, 0, - 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 499, 0, 0, 29, 30, - 31, 0, 0, 0, 0, 0, 0, 0, 0, 33, - 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, - 36, 37, 0, 38, 0, 0, 0, 39, 0, 40, - 42, 43, 0, 0, 45, 0, 0, 0, 47, 0, - 48, 0, 0, 500, 0, 0, 0, 0, 0, 0, - 0, 0, 53, 49, 52, 50, 0, 54, 0, 55, - 0, 57, 0, 58, 0, 0, 0, 0, 44, 56, - 32, 0, 0, 0, 0, 41, 0, 0, 0, 0, - 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 491, 0, 0, 29, 30, 31, - 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, - 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, - 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, - 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, - 0, 0, 492, 0, 0, 0, 0, 0, 0, 0, - 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, - 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, - 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, - 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 491, 0, 0, 29, 30, 31, 0, - 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, - 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, - 0, 38, 0, 0, 0, 39, 0, 40, 42, 43, - 0, 0, 45, 0, 0, 0, 47, 0, 48, 0, - 0, 497, 0, 0, 0, 0, 0, 0, 0, 0, - 53, 49, 52, 50, 0, 54, 0, 55, 0, 57, - 0, 58, 0, 0, 0, 0, 44, 56, 32, 0, - 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, - 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 499, 0, 0, 29, 30, 31, 0, 0, - 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, - 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, - 38, 0, 0, 0, 39, 0, 40, 42, 43, 0, - 0, 45, 0, 0, 0, 47, 0, 48, 0, 0, - 502, 0, 0, 0, 0, 0, 0, 0, 0, 53, - 49, 52, 50, 0, 54, 0, 55, 0, 57, 0, - 58, 0, 0, 0, 0, 44, 56, 32, 0, 0, - 0, 0, 41, 0, 0, 0, 0, 0, 0, 46, - 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, - 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, - 221, 0, 0, 222, 37, 0, 38, 0, 0, 0, - 39, 0, 40, 42, 43, 0, 0, 45, 0, 0, - 0, 47, 0, 48, 0, 0, 0, 0, 0, 0, - 0, 225, 0, 0, 0, 53, 49, 52, 50, 226, - 54, 0, 55, 228, 57, 0, 58, 0, 231, 0, - 0, 44, 56, 32, 0, 0, 0, 0, 41, 0, - 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, - 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, - 0, 0, 0, 0, 0, 35, 221, 0, 0, 590, - 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, - 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, - 0, 0, 0, 0, 0, 0, 0, 225, 0, 0, - 0, 53, 49, 52, 50, 226, 54, 0, 55, 228, - 57, 0, 58, 0, 231, 0, 0, 44, 56, 32, - 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, - 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, - 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, - 0, 35, 221, 0, 0, 590, 637, 0, 38, 0, - 0, 0, 39, 0, 40, 42, 43, 0, 0, 45, - 0, 0, 0, 47, 0, 48, 0, 0, 0, 0, - 0, 0, 0, 225, 0, 0, 0, 53, 49, 52, - 50, 226, 54, 0, 55, 228, 57, 0, 58, 0, - 231, 0, 0, 44, 56, 32, 0, 0, 0, 0, - 41, 0, 0, 0, 0, 0, 0, 46, 34, 51, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, - 112, 113, 0, 0, 115, 117, 118, 0, 0, 119, - 0, 120, 0, 0, 0, 122, 123, 124, 0, 0, - 0, 0, 0, 0, 35, 125, 126, 127, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 129, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 132, 0, 0, 0, 0, 0, - 0, 49, 52, 50, 133, 134, 135, 0, 137, 138, - 139, 140, 141, 142, 0, 0, 130, 136, 121, 114, - 128, 116, 131, 0, 0, 0, 0, 0, 0, 0, - 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 111, 112, 113, 0, 0, 115, 117, 118, - 0, 0, 119, 0, 120, 0, 0, 0, 122, 123, - 124, 0, 0, 0, 0, 0, 0, 35, 125, 126, - 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 129, 0, 0, 0, 398, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 132, 0, 0, - 0, 0, 0, 400, 49, 52, 50, 133, 134, 135, - 0, 137, 138, 139, 140, 141, 142, 0, 0, 130, - 136, 121, 114, 128, 116, 131, 0, 0, 0, 0, - 0, 0, 0, 46, 376, 383, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 111, 112, 113, 0, 0, - 115, 117, 118, 0, 0, 119, 0, 120, 0, 0, - 0, 122, 123, 124, 0, 0, 0, 0, 0, 0, - 35, 125, 126, 127, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 129, 0, 0, 0, 398, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 132, 0, 0, 0, 0, 0, 400, 49, 52, 50, - 133, 134, 135, 0, 137, 138, 139, 140, 141, 142, - 0, 0, 130, 136, 121, 114, 128, 116, 131, 0, - 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 111, 112, - 113, 0, 0, 115, 117, 118, 0, 0, 119, 0, - 120, 0, 0, 0, 122, 123, 124, 0, 0, 0, - 0, 0, 0, 35, 125, 126, 127, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 129, 0, 0, - 0, 398, 0, 0, 0, 0, 0, 0, 0, 399, - 0, 0, 0, 132, 0, 0, 0, 0, 0, 400, - 49, 52, 50, 133, 134, 135, 0, 137, 138, 139, - 140, 141, 142, 0, 0, 130, 136, 121, 114, 128, - 116, 131, 0, 0, 0, 0, 0, 0, 0, 46, - 376, 383, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 214, 0, 0, 0, 0, 216, 0, 29, 30, - 31, 218, 0, 0, 0, 0, 0, 0, 219, 220, - 0, 0, 0, 0, 0, 0, 35, 221, 0, 0, - 222, 37, 0, 38, 0, 0, 0, 39, 0, 40, - 42, 43, 0, 0, 45, 0, 0, 0, 47, 0, - 48, 0, 0, 0, 0, 0, 224, 0, 225, 0, - 0, 0, 53, 49, 52, 50, 226, 54, 227, 55, - 228, 57, 229, 58, 230, 231, 0, 0, 44, 56, - 32, 215, 223, 217, 0, 41, 0, 0, 0, 0, - 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 214, 0, 0, 0, 0, 216, - 0, 29, 30, 31, 218, 0, 0, 0, 0, 0, - 0, 219, 33, 0, 0, 0, 0, 0, 0, 35, - 221, 0, 0, 222, 37, 0, 38, 0, 0, 0, - 39, 0, 40, 42, 43, 0, 0, 45, 0, 0, - 0, 47, 0, 48, 0, 0, 0, 0, 0, 224, - 0, 225, 0, 0, 0, 53, 49, 52, 50, 226, - 54, 227, 55, 228, 57, 229, 58, 230, 231, 0, - 0, 44, 56, 32, 215, 223, 217, 0, 41, 0, - 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 594, 112, 113, - 0, 0, 596, 117, 598, 30, 31, 599, 0, 120, - 0, 0, 0, 122, 601, 602, 0, 0, 0, 0, - 0, 0, 35, 603, 126, 127, 222, 37, 0, 38, - 0, 0, 0, 39, 0, 40, 605, 43, 0, 0, - 607, 0, 0, 0, 47, 0, 48, 0, 0, 0, - 0, 0, 608, 0, 225, 0, 0, 0, 609, 49, - 52, 50, 610, 611, 612, 55, 614, 615, 616, 617, - 618, 619, 0, 0, 606, 613, 600, 595, 604, 597, - 131, 41, 0, 0, 0, 0, 0, 0, 46, 376, - 383, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 367, 112, 113, 0, 0, 369, 117, 371, 30, 31, - 372, 0, 120, 0, 0, 0, 122, 374, 375, 0, - 0, 0, 0, 0, 0, 35, 377, 126, 127, 222, - 37, 0, 38, 0, 0, 0, 39, 0, 40, 379, - 43, 0, 0, 381, 0, 0, 0, 47, 0, 48, - 0, -282, 0, 0, 0, 382, 0, 225, 0, 0, - 0, 384, 49, 52, 50, 385, 386, 387, 55, 389, - 390, 391, 392, 393, 394, 0, 0, 380, 388, 373, - 368, 378, 370, 131, 41, 0, 0, 0, 0, 0, - 0, 46, 376, 383, 0, 0, 0, 0, 0, 0, - 0, 0, 0, + -130, 452, 556, -146, 488, 637, 465, 469, 248, -149, + -141, 271, 353, -150, -138, -119, 486, 408, -150, 402, + 579, 406, -149, -130, 271, 353, 478, 403, -138, 572, + 396, -119, -118, 597, 428, 436, 443, 579, 456, 442, + 594, 436, 630, 579, 529, 452, 558, 579, 561, -146, + 460, 409, 555, -118, 412, 345, -141, 436, 286, 308, + 485, 452, 248, 458, 452, 417, 191, 174, 465, 469, + 410, 565, 539, 168, 428, 422, 151, 425, 145, 73, + 432, 286, 534, 194, 310, 326, 248, 0, 0, 187, + 0, 0, 271, 73, 0, 640, 427, 687, 0, 244, + 424, -143, 168, 247, 145, 265, 326, 101, 339, 357, + 452, 193, 332, 306, 183, 306, 145, 241, 469, 494, + 465, 153, 428, 318, 320, 353, 186, 176, 145, 246, + 446, 145, 145, 145, 315, 243, 101, 145, 455, 60, + 264, 145, 60, 60, 341, 0, 177, 347, 0, 145, + 61, 308, 456, 61, 61, 60, 686, 685, 64, 642, + 641, 576, 262, 261, 103, 145, 61, 495, 267, 65, + 678, 677, 328, 176, 262, 261, 329, 537, 260, 259, + 505, 537, 255, 254, 471, 355, 538, 684, 683, 351, + 567, 176, 177, 467, 559, 420, 419, 342, 576, 655, + 656, 430, 349, 655, 656, 542, 541, 262, 261, 650, + 177, 170, 145, 146, 535, 171, 439, 481, 87, 588, + 88, 270, 268, 176, 0, 644, 545, 0, 0, 535, + 535, 89, 66, 681, 680, 570, 87, 0, 88, 530, + 145, 560, 177, 0, 415, 563, 577, 66, 0, 89, + 269, 579, 87, 0, 88, 87, 87, 88, 88, 66, + 532, 440, 535, 0, 324, 89, 0, 679, 89, 89, + 482, 480, 531, 589, 587, 532, 532, 67, 145, 145, + 546, 544, 87, 68, 88, 532, 0, 531, 531, 571, + 569, 532, 67, 239, 238, 89, 176, 531, 68, 87, + 176, 88, 535, 531, 67, 87, 0, 88, 532, 87, + 68, 88, 89, 632, 645, 177, 0, 178, 89, 177, + 531, 415, 89, 87, 87, 88, 88, 181, 87, 0, + 88, 450, 449, 87, 176, 88, 89, 89, 633, 631, + 0, 89, 288, 289, 75, 76, 89, 674, 532, 288, + 289, 0, -105, 177, 0, 178, 75, 76, 0, 0, + 531, 675, 673, 0, 0, 0, 0, 176, 0, 290, + 291, 77, 78, 0, 0, 35, 290, 291, 0, 105, + 293, 294, 0, 77, 78, -105, 177, 0, 178, 295, + 0, 0, 296, 0, 297, 672, 0, 0, 106, 0, + 107, 6, 5, 4, 1, 3, 2, 80, 81, 0, + 0, 0, 49, 52, 50, 82, 83, 80, 81, 84, + 0, 85, 0, 0, 0, 82, 83, 80, 81, 84, + 35, 85, 0, 0, 0, 82, 83, 80, 81, 84, + 35, 85, 46, 34, 51, 82, 83, 80, 81, 84, + 35, 85, 0, 0, 35, 82, 83, 35, 0, 84, + 0, 85, 0, 35, 0, 0, 35, 49, 52, 50, + 0, 0, 293, 294, 35, 0, 0, 49, 52, 50, + 0, 295, 0, 0, 296, 0, 297, 49, 52, 50, + 0, 49, 52, 50, 49, 52, 50, 46, 34, 51, + 49, 52, 50, 49, 52, 50, 0, 46, 34, 51, + 0, 49, 52, 50, 0, 0, 0, 46, 34, 51, + 0, 46, 34, 51, 46, 34, 51, 0, 0, 0, + 46, 34, 51, 46, 34, 51, 537, 35, 0, 537, + 35, 46, 34, 51, 186, 35, 0, 186, 0, 0, + 35, 0, 186, 35, 0, 0, 0, 35, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 49, 52, 50, 49, 52, 50, + 0, 0, 49, 52, 50, 0, 0, 49, 52, 50, + 49, 52, 50, 0, 49, 52, 50, 0, 0, 0, + 35, 0, 0, 0, 46, 34, 51, 46, 34, 51, + 35, 0, 46, 34, 51, 0, 0, 46, 34, 51, + 46, 34, 51, 35, 46, 34, 51, 0, 0, 0, + 0, 0, 253, 252, 0, 0, 537, 49, 52, 50, + 0, 0, 253, 252, 0, 0, 0, 49, 52, 50, + 35, 0, 0, 0, 0, 258, 257, 0, 0, 0, + 49, 52, 50, 35, 0, 0, 35, 46, 34, 51, + 0, 0, 0, 0, 0, 0, 0, 46, 34, 51, + 0, 0, 0, 0, 0, 0, 0, 49, 52, 50, + 46, 34, 51, 0, 0, 253, 252, 0, 258, 257, + 49, 52, 50, 49, 52, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 155, 0, 0, 46, 34, 51, + 0, 0, 0, 0, 156, 0, 0, 0, 157, 35, + 46, 34, 51, 46, 34, 51, 0, 158, 0, 159, + 0, 0, 322, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 161, 64, 0, 0, 0, 0, 0, 0, + 162, 258, 257, 163, 65, 0, 49, 52, 50, 164, + 0, 0, 0, 0, 0, 165, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 166, 0, 0, 0, 0, 46, 34, 51, 0, + 0, 0, 0, 0, 0, 0, 30, 31, 155, 0, + 0, 0, 0, 0, 0, 0, 33, 0, 156, 0, + 0, 0, 157, 35, 0, 0, 0, 36, 37, 0, + 38, 158, 0, 159, 0, 0, 0, 521, 0, 0, + 0, 45, 0, 0, 160, 0, 161, 64, 0, 0, + 0, 0, 0, 0, 162, 0, 0, 163, 65, 53, + 49, 52, 50, 164, 54, 0, 0, 0, 0, 165, + 0, 0, 0, 0, 0, 44, 56, 32, 0, 0, + 0, 0, 41, 0, 0, 166, 0, 0, 0, 0, + 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 30, 31, 0, 0, 0, 0, 0, + 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 36, 37, 0, 38, 0, 0, + 0, 0, 0, 0, 521, 0, 0, 0, 45, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 53, 49, 52, 50, + 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 44, 56, 32, 0, 0, 0, 0, 41, + 0, 0, 0, 0, 0, 0, 0, 46, 34, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, + 31, 0, 0, 0, 0, 0, 0, 0, 0, 33, + 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, + 36, 37, 0, 38, 0, 0, 0, 0, 0, 0, + 42, 0, 0, 0, 45, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 53, 49, 52, 50, 0, 54, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 44, 56, + 32, 0, 0, 0, 0, 41, 0, 0, 0, 0, + 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 519, 0, 30, 31, 0, + 0, 0, 0, 0, 0, 0, 0, 221, 0, 0, + 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, + 0, 38, 0, 0, 0, 0, 0, 0, 521, 0, + 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 53, 522, 524, 523, 0, 54, 0, 0, 0, 0, + 230, 0, 0, 0, 0, 0, 44, 56, 32, 216, + 224, 0, 0, 41, 0, 0, 520, 0, 0, 0, + 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 519, 0, 30, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, + 0, 0, 35, 0, 0, 0, 36, 37, 0, 38, + 0, 0, 0, 0, 0, 0, 521, 0, 0, 0, + 45, 0, 0, 0, 0, 0, 0, 0, 584, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 53, 522, + 524, 523, 0, 54, 0, 0, 0, 0, 230, 0, + 0, 0, 0, 0, 44, 56, 32, 216, 224, 0, + 0, 41, 0, 0, 520, 0, 0, 0, 0, 46, + 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 519, 0, 30, 31, 0, 0, 0, 0, 0, + 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 36, 37, 0, 38, 0, 0, + 0, 0, 0, 0, 521, 0, 0, 0, 45, 0, + 0, 0, 0, 0, 0, 0, 581, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 53, 522, 524, 523, + 0, 54, 0, 0, 0, 0, 230, 0, 0, 0, + 0, 0, 44, 56, 32, 216, 224, 0, 0, 41, + 0, 0, 520, 0, 0, 0, 0, 46, 34, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, + 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 0, 0, 0, 35, 0, 0, + 0, 36, 37, 0, 38, 0, 0, 0, 39, 0, + 40, 42, 43, 0, 0, 45, 0, 0, 0, 47, + 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 53, 49, 52, 50, 0, 54, 0, + 55, 0, 57, 0, 58, 0, 0, 0, 0, 44, + 56, 32, 0, 0, 0, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -139, 0, 0, 0, + 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, + 0, 33, 0, 0, 0, 0, 0, 0, 35, 0, + 0, 0, 36, 37, 0, 38, 0, 0, 0, 39, + 0, 40, 42, 43, 0, 0, 45, 0, 0, 0, + 47, 0, 48, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 53, 49, 52, 50, 0, 54, + 0, 55, 0, 57, 0, 58, 0, 0, 0, 0, + 44, 56, 32, 0, 0, 0, 0, 41, 0, 0, + 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, + 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, + 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, + 57, 285, 58, 0, 0, 0, 0, 44, 56, 32, + 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 492, 0, 0, 29, 30, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, + 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, + 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, + 0, 0, 498, 0, 0, 0, 0, 0, 0, 0, + 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, + 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, + 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 492, 0, 0, 29, 30, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, + 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, + 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, + 0, 0, 493, 0, 0, 0, 0, 0, 0, 0, + 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, + 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, + 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 500, 0, 0, 29, 30, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, + 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, + 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, + 0, 0, 501, 0, 0, 0, 0, 0, 0, 0, + 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, + 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, + 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 500, 0, 0, 29, 30, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, + 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, + 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, + 0, 0, 503, 0, 0, 0, 0, 0, 0, 0, + 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, + 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, + 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, + 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, + 0, 0, 35, 222, 0, 0, 599, 37, 0, 38, + 0, 0, 0, 39, 0, 40, 42, 43, 0, 0, + 45, 0, 0, 0, 47, 0, 48, 0, 0, 0, + 0, 0, 0, 0, 226, 0, 0, 0, 53, 49, + 52, 50, 227, 54, 0, 55, 229, 57, 0, 58, + 0, 232, 0, 0, 44, 56, 32, 0, 0, 0, + 0, 41, 0, 0, 0, 0, 0, 0, 0, 46, + 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, + 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, + 222, 0, 0, 599, 646, 0, 38, 0, 0, 0, + 39, 0, 40, 42, 43, 0, 0, 45, 0, 0, + 0, 47, 0, 48, 0, 0, 0, 0, 0, 0, + 0, 226, 0, 0, 0, 53, 49, 52, 50, 227, + 54, 0, 55, 229, 57, 0, 58, 0, 232, 0, + 0, 44, 56, 32, 0, 0, 0, 0, 41, 0, + 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, + 31, 0, 0, 0, 0, 0, 0, 0, 0, 33, + 0, 0, 0, 0, 0, 0, 35, 222, 0, 0, + 223, 37, 0, 38, 0, 0, 0, 39, 0, 40, + 42, 43, 0, 0, 45, 0, 0, 0, 47, 0, + 48, 0, 0, 0, 0, 0, 0, 0, 226, 0, + 0, 0, 53, 49, 52, 50, 227, 54, 0, 55, + 229, 57, 0, 58, 0, 232, 0, 0, 44, 56, + 32, 0, 0, 0, 0, 41, 0, 0, 0, 0, + 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 111, 112, 113, 0, 0, + 115, 117, 118, 0, 0, 119, 0, 120, 0, 0, + 0, 123, 124, 125, 0, 0, 0, 0, 0, 0, + 35, 126, 127, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 130, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 133, 0, 0, 0, 0, 0, 0, 49, 52, 50, + 134, 135, 136, 0, 138, 139, 140, 141, 142, 143, + 0, 0, 131, 137, 122, 114, 129, 116, 132, 0, + 0, 0, 121, 0, 0, 0, 0, 46, 34, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, + 112, 113, 0, 0, 115, 117, 118, 0, 0, 119, + 0, 120, 0, 0, 0, 123, 124, 125, 0, 0, + 0, 0, 0, 0, 35, 126, 127, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 130, 0, + 0, 0, 399, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 133, 0, 0, 0, 0, 0, + 401, 49, 52, 50, 134, 135, 136, 0, 138, 139, + 140, 141, 142, 143, 0, 0, 131, 137, 122, 114, + 129, 116, 132, 0, 0, 0, 121, 0, 0, 0, + 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 111, 112, 113, 0, 0, 115, 117, + 118, 0, 0, 119, 0, 120, 0, 0, 0, 123, + 124, 125, 0, 0, 0, 0, 0, 0, 35, 126, + 127, 128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 0, 0, 0, 399, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, + 0, 0, 0, 0, 401, 49, 52, 50, 134, 135, + 136, 0, 138, 139, 140, 141, 142, 143, 0, 0, + 131, 137, 122, 114, 129, 116, 132, 0, 0, 0, + 121, 0, 0, 0, 0, 46, 377, 384, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 111, 112, 113, + 0, 0, 115, 117, 118, 0, 0, 119, 0, 120, + 0, 0, 0, 123, 124, 125, 0, 0, 0, 0, + 0, 0, 35, 126, 127, 128, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 0, 0, 0, + 399, 0, 0, 0, 0, 0, 0, 0, 400, 0, + 0, 0, 133, 0, 0, 0, 0, 0, 401, 49, + 52, 50, 134, 135, 136, 0, 138, 139, 140, 141, + 142, 143, 0, 0, 131, 137, 122, 114, 129, 116, + 132, 0, 0, 0, 121, 0, 0, 0, 0, 46, + 377, 384, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 215, 0, 0, 0, 0, 217, 0, 29, 30, + 31, 219, 0, 0, 0, 0, 0, 0, 220, 33, + 0, 0, 0, 0, 0, 0, 35, 222, 0, 0, + 223, 37, 0, 38, 0, 0, 0, 39, 0, 40, + 42, 43, 0, 0, 45, 0, 0, 0, 47, 0, + 48, 0, 0, 0, 0, 0, 225, 0, 226, 0, + 0, 0, 53, 49, 52, 50, 227, 54, 228, 55, + 229, 57, 230, 58, 231, 232, 0, 0, 44, 56, + 32, 216, 224, 218, 0, 41, 0, 0, 0, 0, + 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, + 217, 0, 29, 30, 31, 219, 0, 0, 0, 0, + 0, 0, 220, 221, 0, 0, 0, 0, 0, 0, + 35, 222, 0, 0, 223, 37, 0, 38, 0, 0, + 0, 39, 0, 40, 42, 43, 0, 0, 45, 0, + 0, 0, 47, 0, 48, 0, 0, 0, 0, 0, + 225, 0, 226, 0, 0, 0, 53, 49, 52, 50, + 227, 54, 228, 55, 229, 57, 230, 58, 231, 232, + 0, 0, 44, 56, 32, 216, 224, 218, 0, 41, + 0, 0, 0, 0, 0, 0, 0, 46, 34, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 603, + 112, 113, 0, 0, 605, 117, 607, 30, 31, 608, + 0, 120, 0, 0, 0, 123, 610, 611, 0, 0, + 0, 0, 0, 0, 35, 612, 127, 128, 223, 37, + 0, 38, 0, 0, 0, 39, 0, 40, 614, 43, + 0, 0, 616, 0, 0, 0, 47, 0, 48, 0, + 0, 0, 0, 0, 617, 0, 226, 0, 0, 0, + 618, 49, 52, 50, 619, 620, 621, 55, 623, 624, + 625, 626, 627, 628, 0, 0, 615, 622, 609, 604, + 613, 606, 132, 41, 0, 0, 121, 0, 0, 0, + 0, 46, 377, 384, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 368, 112, 113, 0, 0, 370, 117, + 372, 30, 31, 373, 0, 120, 0, 0, 0, 123, + 375, 376, 0, 0, 0, 0, 0, 0, 35, 378, + 127, 128, 223, 37, 0, 38, 0, 0, 0, 39, + 0, 40, 380, 43, 0, 0, 382, 0, 0, 0, + 47, 0, 48, 0, -286, 0, 0, 0, 383, 0, + 226, 0, 0, 0, 385, 49, 52, 50, 386, 387, + 388, 55, 390, 391, 392, 393, 394, 395, 0, 0, + 381, 389, 374, 369, 379, 371, 132, 41, 0, 0, + 121, 0, 0, 0, 0, 46, 377, 384, 0, 0, + 0, 0, 0, 0, 0, 0, 0, - 315, 478, 645, 153, 673, 465, 460, 501, 458, 461, - 184, 456, 396, 498, 488, 503, 440, 444, 436, 428, - 657, 667, 656, 644, 403, 630, 642, 629, 447, 634, - 450, 627, 315, 143, 553, 184, 255, 250, 149, 447, - 146, 353, 151, 349, 541, 531, 450, 534, 315, 179, - 538, 166, 172, 184, 322, 189, 620, 191, 16, 255, - 207, 250, 239, 586, 174, 250, 255, 587, 184, 447, - 265, 0, 577, 515, 584, 472, 559, 333, 450, 412, - 207, 514, 517, 471, 248, 467, 517, 565, 557, 207, - 315, 569, 315, 364, 207, 207, 207, 189, 249, 207, - 207, 207, 496, 0, 207, 315, 495, 412, 469, 358, - 333, 412, 207, 315, 62, 279, 413, 62, 0, 297, - 283, 486, 298, 244, 62, 241, 183, 62, 62, 62, - 262, 425, 299, 300, 301, 320, 364, 324, 62, 62, - 505, 506, 189, 262, 413, 0, 207, 0, 413, 472, - 0, 207, 593, 207, 62, 62, 507, 508, 62, 207, - 509, 62, 62, 510, 183, 316, 62, 318, 462, 149, - 188, 513, 62, 347, 463, 351, 62, 181, 355, 62, - 343, 357, 404, 62, 396, 462, 342, 262, 345, 207, - 108, 207, 171, 168, 207, 396, 62, 207, 207, 62, - 62, 183, 463, 207, 62, 62, 104, 62, 92, 62, - 406, 91, 249, 62, 97, 462, 364, 102, 62, 110, - 463, 420, 62, 482, 62, 396, 207, 96, 90, 62, - 207, 189, 207, 0, 95, 62, 62, 62, 62, 63, - 94, 72, 93, 62, 0, 62, 62, 62, 86, 62, - 397, 100, 99, 98, 108, 79, 62, 410, 149, 422, - 660, 659, 517, 62, 74, 71, 415, 661, 0, 62, - 0, 70, 62, 311, 69, 311, 311, 62, 283, 0, - 283, 283, 283, 110, 178, 62, 311, 311, 364, 364, - 283, 283, 283, 517, 329, 339, 62, 332, 330, 0, - 326, 283, 525, 0, 207, 207, 62, 308, 313, 310, - 0, 283, 62, 62, 516, 526, 0, 283, 283, 306, - 291, 286, 62, 62, 0, 517, 62, 283, 283, 302, - 303, 283, 576, 304, 643, 573, 0, 0, 0, 0, - 0, 517, 0, 0, 517, 0, 0, 0, 0, 0, - 525, 0, 0, 525, 545, 546, 547, 548, 552, 549, - 550, 0, 516, 526, 0, 516, 526, 589, 0, 0, - 0, 0, 0, 0, 443, 446, 638, 639, 545, 546, - 547, 548, 552, 549, 550, 589, 0, 0, 0, 0, - 0, 0, 0, 0, 591, 592, 545, 546, 547, 548, - 552, 549, 550, 581, 0, 0, 0, 0, 0, 0, - 0, 0, 582, 583, 545, 546, 547, 548, 552, 549, - 550, 0, 581, 0, 0, 0, 0, 565, 0, 640, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 488, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 16, 150, 636, 543, 536, 654, 540, 334, 154, 682, + 676, 144, 256, 643, 638, 451, 639, 448, 504, 489, + 397, 316, 266, 651, 185, 586, 629, 251, 185, 323, + 596, 595, 566, 653, 665, 593, 666, 466, 448, 568, + 180, 451, 457, 459, 316, 316, 499, 251, 147, 462, + 470, 256, 461, 448, 437, 429, 441, 185, 354, 445, + 173, 451, 185, 240, 192, 562, 404, 473, 472, 0, + 316, 175, 533, 502, 152, 167, 208, 251, 256, 190, + 516, 479, 190, 208, 208, 413, 263, 208, 316, 0, + 397, 365, 515, 208, 518, 518, 208, 0, 62, 670, + 464, 0, 208, 62, 652, 509, 208, 208, 62, 350, + 463, 423, 62, 190, 511, 426, 398, 62, 62, 510, + 464, 411, 150, 414, 468, 62, 334, 184, 62, 62, + 182, 280, 62, 302, 301, 250, 284, 62, 62, 463, + 208, 62, 189, 300, 413, 62, 317, 62, 172, 208, + 299, 62, 298, 506, 62, 169, 507, 150, 62, 497, + 508, 518, 62, 496, 319, 416, 574, 86, 62, 321, + 413, 62, 62, 93, 62, 514, 95, 96, 397, 97, + 62, 263, 414, 62, 90, 208, 316, 91, 62, 62, + 62, 184, 92, 405, 62, 94, 316, 208, 108, 250, + 62, 249, 190, 343, 348, 407, 102, 358, 414, 208, + 104, 352, 208, 208, 365, 208, 62, 208, 669, 668, + 208, 325, 100, 208, 62, 365, 69, 208, 110, 397, + 602, 242, 62, 62, 70, 71, 62, 208, 473, 72, + 245, 359, 62, 487, 62, 63, 0, 62, 263, 463, + 518, 62, 74, 62, 0, 578, 421, 79, 62, 98, + 464, 62, 344, 62, 208, 184, 365, 99, 312, 62, + 62, 0, 346, 284, 284, 284, 62, 292, 287, 62, + 62, 284, 208, 303, 284, 284, 304, 305, 312, 62, + 340, 108, 62, 284, 284, 365, 312, 284, 312, 62, + 309, 284, 62, 284, 284, 307, 518, 284, 0, 312, + 333, 208, 0, 483, 284, 527, 330, 327, 331, 356, + 311, 110, 179, 0, 0, 590, 0, 517, 528, 582, + 574, 314, 649, 0, 0, 208, 0, 0, 518, 547, + 548, 549, 550, 554, 551, 552, 0, 527, 0, 0, + 0, 0, 598, 447, 489, 0, 0, 0, 0, 517, + 528, 600, 601, 547, 548, 549, 550, 554, 551, 552, + 0, 0, 0, 0, 590, 0, 0, 0, 0, 0, + 0, 0, 444, 591, 592, 547, 548, 549, 550, 554, + 551, 552, 598, 0, 0, 0, 0, 0, 0, 0, + 0, 647, 648, 547, 548, 549, 550, 554, 551, 552, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 585, + 0, 0, 0, 0, 0, 0, 0, 0, 518, 0, + 0, 0, 0, 0, 0, 0, 0, 527, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, + 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; const short QQmlJSGrammar::action_check [] = { - 8, 61, 60, 8, 48, 1, 0, 2, 55, 79, - 33, 1, 60, 48, 7, 79, 66, 60, 17, 8, - 36, 66, 29, 8, 60, 37, 60, 33, 79, 33, - 1, 33, 2, 36, 20, 55, 8, 79, 7, 61, - 55, 60, 29, 7, 5, 1, 5, 48, 48, 33, - 33, 5, 7, 33, 17, 37, 31, 36, 55, 8, - 33, 7, 60, 77, 7, 33, 7, 7, 60, 36, - 61, 36, 60, 7, 36, 8, 36, 16, 36, 36, - 7, 55, 34, 36, 7, 7, 7, 7, 36, 55, - 7, 36, 7, 7, 36, 7, 7, 7, 36, 2, - 36, 7, 33, 7, 55, 7, 36, 7, 55, 33, - 60, 7, -1, 8, 33, 8, 60, 42, 36, -1, - 36, 8, -1, 60, 33, 33, 61, 62, 53, 36, - 8, 36, 8, -1, 33, 36, 8, 50, 36, -1, - 8, 54, 8, 40, 15, 8, 15, 8, 40, 8, - 8, -1, -1, 24, 51, 15, -1, 10, 15, 51, - 8, 56, 50, 92, 93, 34, 54, 60, 8, 56, - 61, 62, 61, 62, 34, 61, 62, 34, 56, 61, - 62, 61, 62, 8, 60, 40, 61, 62, 60, 40, - 56, 7, 60, 6, 61, 62, 51, 60, 15, 60, - 51, 60, 55, 61, 7, 61, 62, 20, 56, 61, - 62, 92, 93, 15, 61, 62, 12, 34, 29, 36, - 60, 8, 24, 15, 29, 25, 12, 27, 25, -1, - 27, 7, 15, 12, 29, 29, 61, 62, 38, 7, - -1, 38, 34, -1, 36, 61, 62, 25, 29, 27, - 25, 34, 27, 36, 61, 62, 25, 29, 27, 8, - 38, 57, -1, 38, 75, 33, 25, 63, 27, 38, - 75, 57, 29, -1, 61, 62, 87, 63, 57, 38, - 75, 75, 87, 90, 63, 61, 62, 25, 25, 27, - 27, 36, 87, 87, 75, 25, 25, 27, 27, 7, - 38, 38, 15, 75, 7, 8, 87, -1, 38, 38, - 61, 62, 61, 62, -1, 87, 61, 62, 75, 15, - 25, 34, 27, 36, 18, 19, 15, 95, 18, 19, - 87, 18, 19, 38, 18, 19, -1, 33, 34, -1, - 36, -1, -1, 94, 33, 34, -1, 36, -1, 47, - -1, 45, 46, 61, 62, 45, 46, -1, 45, 46, - -1, 45, 46, 61, 62, 23, 24, -1, -1, 23, - 24, -1, -1, -1, 32, 23, 24, 35, 32, 37, - -1, 35, 29, 37, 32, 23, 24, 35, 29, 37, - -1, 23, 24, 29, 32, -1, 94, 35, 29, 37, - 32, 29, -1, 35, 25, 37, 27, 99, 100, 101, - 102, 103, 104, -1, 29, -1, -1, 38, -1, 66, - 67, 68, -1, -1, -1, 66, 67, 68, -1, -1, - 66, 67, 68, -1, -1, 66, 67, 68, 66, 67, - 68, -1, -1, -1, -1, -1, 29, -1, 95, 96, - 97, 66, 67, 68, 95, 96, 97, -1, -1, 95, - 96, 97, -1, -1, 95, 96, 97, 95, 96, 97, - 29, -1, -1, -1, -1, -1, -1, -1, 29, -1, - 95, 96, 97, 66, 67, 68, 23, 24, 29, -1, - -1, 29, -1, -1, 31, 32, 29, -1, 35, -1, - 37, -1, -1, 36, -1, -1, -1, 66, 67, 68, - -1, 29, 95, 96, 97, 66, 67, 68, 36, -1, - -1, -1, -1, -1, -1, 66, 67, 68, 66, 67, - 68, -1, -1, 66, 67, 68, 95, 96, 97, 15, - -1, -1, -1, -1, 95, 96, 97, 15, 66, 67, - 68, -1, -1, 29, 95, 96, 97, 95, 96, 97, - -1, 29, 95, 96, 97, 29, -1, -1, -1, -1, - 29, -1, 36, 29, -1, -1, -1, 95, 96, 97, - -1, -1, -1, -1, -1, 29, -1, -1, -1, -1, - 66, 67, 68, -1, -1, -1, -1, -1, 66, 67, - 68, -1, 66, 67, 68, 61, 62, 66, 67, 68, - 66, 67, 68, -1, -1, -1, -1, 61, 62, 95, - 96, 97, 66, 67, 68, -1, 29, 95, 96, 97, - -1, 95, 96, 97, -1, -1, 95, 96, 97, 95, - 96, 97, 29, -1, -1, 29, -1, -1, 15, -1, - -1, 95, 96, 97, -1, -1, -1, -1, 61, 62, - -1, -1, 29, 66, 67, 68, -1, -1, -1, -1, - -1, -1, -1, -1, 61, 62, -1, 61, 62, 66, - 67, 68, 66, 67, 68, -1, -1, -1, -1, -1, - -1, -1, 95, 96, 97, -1, -1, -1, -1, 66, - 67, 68, -1, -1, -1, -1, -1, -1, 95, 96, - 97, 95, 96, 97, -1, -1, -1, -1, -1, -1, - -1, 3, -1, -1, -1, -1, -1, -1, 95, 96, - 97, 13, -1, -1, -1, 17, -1, -1, -1, -1, - 29, -1, -1, -1, 26, -1, 28, -1, -1, 31, - -1, -1, -1, -1, -1, -1, -1, 39, -1, 41, - 42, -1, -1, -1, -1, -1, -1, 49, -1, -1, - 52, 53, 61, 62, -1, -1, 58, 66, 67, 68, - -1, -1, 64, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 80, -1, - -1, -1, -1, -1, -1, -1, 95, 96, 97, -1, - -1, -1, -1, -1, -1, -1, 12, 13, 3, -1, - -1, -1, -1, -1, -1, -1, 22, -1, 13, -1, - -1, -1, 17, 29, -1, -1, -1, 33, 34, -1, - 36, 26, -1, 28, -1, -1, -1, 43, -1, -1, - -1, 47, -1, -1, 39, -1, 41, 42, -1, -1, - -1, -1, -1, -1, 49, -1, -1, 52, 53, 65, - 66, 67, 68, 58, 70, -1, -1, -1, -1, 64, - -1, -1, -1, -1, -1, 81, 82, 83, -1, -1, - -1, -1, 88, -1, -1, 80, -1, -1, -1, 95, - 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, - -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, - -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, - -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, - 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 81, 82, 83, -1, -1, -1, -1, 88, -1, - -1, -1, -1, -1, -1, 95, 96, 97, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 12, 13, -1, - -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, - -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, - -1, 36, -1, -1, -1, -1, -1, -1, 43, -1, - -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 67, 68, -1, 70, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 81, 82, 83, -1, - -1, -1, -1, 88, -1, -1, -1, -1, -1, -1, - 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 10, -1, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, - -1, -1, -1, -1, -1, 43, -1, -1, -1, 47, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, - 68, -1, 70, -1, -1, -1, -1, 75, -1, -1, - -1, -1, -1, 81, 82, 83, 84, 85, -1, -1, - 88, -1, -1, -1, -1, -1, -1, 95, 96, 97, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, - -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, - -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, - -1, -1, 33, 34, -1, 36, -1, -1, -1, -1, - -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, 55, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, - -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, - 81, 82, 83, 84, 85, -1, -1, 88, -1, -1, - -1, -1, -1, -1, 95, 96, 97, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 10, -1, 12, 13, - -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, - -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, - 34, -1, 36, -1, -1, -1, -1, -1, -1, 43, - -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, - -1, 55, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 65, 66, 67, 68, -1, 70, -1, -1, -1, - -1, 75, -1, -1, -1, -1, -1, 81, 82, 83, - 84, 85, -1, -1, 88, -1, -1, -1, -1, -1, - -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, - -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, - -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, - 68, -1, 70, -1, 72, -1, 74, -1, 76, -1, - -1, -1, -1, 81, 82, 83, -1, -1, -1, -1, - 88, -1, -1, -1, -1, -1, -1, 95, 96, 97, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, - -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, - 72, -1, 74, 75, 76, -1, -1, -1, -1, 81, - 82, 83, -1, -1, -1, -1, 88, -1, -1, -1, - -1, -1, -1, 95, 96, 97, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 7, -1, -1, -1, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, - -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, - 72, -1, 74, -1, 76, -1, -1, -1, -1, 81, - 82, 83, -1, -1, -1, -1, 88, -1, -1, -1, - -1, -1, -1, 95, 96, 97, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 8, -1, -1, 11, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, - -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, - 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, - 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, 56, -1, -1, -1, -1, -1, -1, - -1, -1, 65, 66, 67, 68, -1, 70, -1, 72, - -1, 74, -1, 76, -1, -1, -1, -1, 81, 82, - 83, -1, -1, -1, -1, 88, -1, -1, -1, -1, - -1, -1, 95, 96, 97, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, - -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, - -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, - 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, - 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, - -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, - -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, - 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, - -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, - -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 8, -1, -1, 11, 12, 13, -1, - -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, - -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, - -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, - -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, - -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 67, 68, -1, 70, -1, 72, -1, 74, - -1, 76, -1, -1, -1, -1, 81, 82, 83, -1, - -1, -1, -1, 88, -1, -1, -1, -1, -1, -1, - 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 8, -1, -1, 11, 12, 13, -1, -1, - -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, - -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, - 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, - -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, - 56, -1, -1, -1, -1, -1, -1, -1, -1, 65, - 66, 67, 68, -1, 70, -1, 72, -1, 74, -1, - 76, -1, -1, -1, -1, 81, 82, 83, -1, -1, - -1, -1, 88, -1, -1, -1, -1, -1, -1, 95, - 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, - -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, - 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, - 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, - -1, 51, -1, 53, -1, -1, -1, -1, -1, -1, - -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, - 70, -1, 72, 73, 74, -1, 76, -1, 78, -1, - -1, 81, 82, 83, -1, -1, -1, -1, 88, -1, - -1, -1, -1, -1, -1, 95, 96, 97, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, - -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, - -1, -1, -1, -1, -1, 29, 30, -1, -1, 33, - 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, - 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, - -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, - -1, 65, 66, 67, 68, 69, 70, -1, 72, 73, - 74, -1, 76, -1, 78, -1, -1, 81, 82, 83, - -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, - -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, - -1, 29, 30, -1, -1, 33, 34, -1, 36, -1, - -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, - -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, - -1, -1, -1, 61, -1, -1, -1, 65, 66, 67, - 68, 69, 70, -1, 72, 73, 74, -1, 76, -1, - 78, -1, -1, 81, 82, 83, -1, -1, -1, -1, - 88, -1, -1, -1, -1, -1, -1, 95, 96, 97, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, - 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, - -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, - -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, - -1, 66, 67, 68, 69, 70, 71, -1, 73, 74, - 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, - 85, 86, 87, -1, -1, -1, -1, -1, -1, -1, - 95, 96, 97, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, - -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, - 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, - 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, - -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, - -1, 73, 74, 75, 76, 77, 78, -1, -1, 81, - 82, 83, 84, 85, 86, 87, -1, -1, -1, -1, - -1, -1, -1, 95, 96, 97, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, - 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, - -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, - 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, -1, -1, -1, -1, -1, 65, 66, 67, 68, - 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, - -1, -1, 81, 82, 83, 84, 85, 86, 87, -1, - -1, -1, -1, -1, -1, -1, 95, 96, 97, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, - 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, - 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, - -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, - -1, 47, -1, -1, -1, -1, -1, -1, -1, 55, - -1, -1, -1, 59, -1, -1, -1, -1, -1, 65, - 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, - 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, - 86, 87, -1, -1, -1, -1, -1, -1, -1, 95, - 96, 97, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 4, -1, -1, -1, -1, 9, -1, 11, 12, - 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, - -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, - 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, - 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, -1, -1, -1, 59, -1, 61, -1, - -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, - 83, 84, 85, 86, -1, 88, -1, -1, -1, -1, - -1, -1, 95, 96, 97, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 4, -1, -1, -1, -1, 9, - -1, 11, 12, 13, 14, -1, -1, -1, -1, -1, - -1, 21, 22, -1, -1, -1, -1, -1, -1, 29, - 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, - 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, - -1, 51, -1, 53, -1, -1, -1, -1, -1, 59, - -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, - -1, 81, 82, 83, 84, 85, 86, -1, 88, -1, - -1, -1, -1, -1, -1, 95, 96, 97, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, - -1, -1, 9, 10, 11, 12, 13, 14, -1, 16, - -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, - -1, -1, 29, 30, 31, 32, 33, 34, -1, 36, - -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, - 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, - -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, -1, -1, 81, 82, 83, 84, 85, 86, - 87, 88, -1, -1, -1, -1, -1, -1, 95, 96, - 97, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 4, 5, 6, -1, -1, 9, 10, 11, 12, 13, - 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, - -1, -1, -1, -1, -1, 29, 30, 31, 32, 33, - 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, - 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, - -1, 55, -1, -1, -1, 59, -1, 61, -1, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, - 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, - -1, 95, 96, 97, -1, -1, -1, -1, -1, -1, - -1, -1, -1, + 7, 33, 33, 7, 55, 8, 36, 36, 7, 7, + 7, 36, 36, 7, 7, 7, 33, 36, 7, 55, + 33, 55, 7, 7, 36, 36, 17, 7, 7, 34, + 8, 7, 7, 7, 36, 5, 7, 33, 20, 55, + 66, 5, 29, 33, 66, 33, 29, 33, 29, 7, + 60, 60, 29, 7, 55, 61, 7, 5, 1, 79, + 60, 33, 7, 36, 33, 60, 8, 7, 36, 36, + 33, 37, 29, 2, 36, 36, 8, 33, 8, 1, + 33, 1, 37, 33, 8, 2, 7, -1, -1, 36, + -1, -1, 36, 1, -1, 60, 55, 0, -1, 33, + 60, 7, 2, 55, 8, 36, 2, 48, 17, 16, + 33, 60, 7, 48, 60, 48, 8, 36, 36, 8, + 36, 60, 36, 61, 60, 36, 36, 15, 8, 55, + 7, 8, 8, 8, 61, 60, 48, 8, 6, 40, + 77, 8, 40, 40, 8, -1, 34, 60, -1, 8, + 51, 79, 20, 51, 51, 40, 61, 62, 42, 61, + 62, 8, 61, 62, 79, 8, 51, 56, 60, 53, + 61, 62, 50, 15, 61, 62, 54, 15, 61, 62, + 60, 15, 61, 62, 60, 60, 24, 61, 62, 60, + 24, 15, 34, 60, 8, 61, 62, 61, 8, 93, + 94, 60, 31, 93, 94, 61, 62, 61, 62, 56, + 34, 50, 8, 56, 29, 54, 10, 8, 25, 7, + 27, 61, 62, 15, -1, 7, 7, -1, -1, 29, + 29, 38, 12, 61, 62, 7, 25, -1, 27, 29, + 8, 55, 34, -1, 36, 29, 56, 12, -1, 38, + 90, 33, 25, -1, 27, 25, 25, 27, 27, 12, + 75, 55, 29, -1, 60, 38, -1, 95, 38, 38, + 61, 62, 87, 61, 62, 75, 75, 57, 8, 8, + 61, 62, 25, 63, 27, 75, -1, 87, 87, 61, + 62, 75, 57, 61, 62, 38, 15, 87, 63, 25, + 15, 27, 29, 87, 57, 25, -1, 27, 75, 25, + 63, 27, 38, 36, 96, 34, -1, 36, 38, 34, + 87, 36, 38, 25, 25, 27, 27, 56, 25, -1, + 27, 61, 62, 25, 15, 27, 38, 38, 61, 62, + -1, 38, 18, 19, 18, 19, 38, 47, 75, 18, + 19, -1, 33, 34, -1, 36, 18, 19, -1, -1, + 87, 61, 62, -1, -1, -1, -1, 15, -1, 45, + 46, 45, 46, -1, -1, 29, 45, 46, -1, 15, + 23, 24, -1, 45, 46, 33, 34, -1, 36, 32, + -1, -1, 35, -1, 37, 95, -1, -1, 34, -1, + 36, 100, 101, 102, 103, 104, 105, 23, 24, -1, + -1, -1, 66, 67, 68, 31, 32, 23, 24, 35, + -1, 37, -1, -1, -1, 31, 32, 23, 24, 35, + 29, 37, -1, -1, -1, 31, 32, 23, 24, 35, + 29, 37, 96, 97, 98, 31, 32, 23, 24, 35, + 29, 37, -1, -1, 29, 31, 32, 29, -1, 35, + -1, 37, -1, 29, -1, -1, 29, 66, 67, 68, + -1, -1, 23, 24, 29, -1, -1, 66, 67, 68, + -1, 32, -1, -1, 35, -1, 37, 66, 67, 68, + -1, 66, 67, 68, 66, 67, 68, 96, 97, 98, + 66, 67, 68, 66, 67, 68, -1, 96, 97, 98, + -1, 66, 67, 68, -1, -1, -1, 96, 97, 98, + -1, 96, 97, 98, 96, 97, 98, -1, -1, -1, + 96, 97, 98, 96, 97, 98, 15, 29, -1, 15, + 29, 96, 97, 98, 36, 29, -1, 36, -1, -1, + 29, -1, 36, 29, -1, -1, -1, 29, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 66, 67, 68, 66, 67, 68, + -1, -1, 66, 67, 68, -1, -1, 66, 67, 68, + 66, 67, 68, -1, 66, 67, 68, -1, -1, -1, + 29, -1, -1, -1, 96, 97, 98, 96, 97, 98, + 29, -1, 96, 97, 98, -1, -1, 96, 97, 98, + 96, 97, 98, 29, 96, 97, 98, -1, -1, -1, + -1, -1, 61, 62, -1, -1, 15, 66, 67, 68, + -1, -1, 61, 62, -1, -1, -1, 66, 67, 68, + 29, -1, -1, -1, -1, 61, 62, -1, -1, -1, + 66, 67, 68, 29, -1, -1, 29, 96, 97, 98, + -1, -1, -1, -1, -1, -1, -1, 96, 97, 98, + -1, -1, -1, -1, -1, -1, -1, 66, 67, 68, + 96, 97, 98, -1, -1, 61, 62, -1, 61, 62, + 66, 67, 68, 66, 67, 68, -1, -1, -1, -1, + -1, -1, -1, -1, 3, -1, -1, 96, 97, 98, + -1, -1, -1, -1, 13, -1, -1, -1, 17, 29, + 96, 97, 98, 96, 97, 98, -1, 26, -1, 28, + -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, + 39, -1, 41, 42, -1, -1, -1, -1, -1, -1, + 49, 61, 62, 52, 53, -1, 66, 67, 68, 58, + -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 80, -1, -1, -1, -1, 96, 97, 98, -1, + -1, -1, -1, -1, -1, -1, 12, 13, 3, -1, + -1, -1, -1, -1, -1, -1, 22, -1, 13, -1, + -1, -1, 17, 29, -1, -1, -1, 33, 34, -1, + 36, 26, -1, 28, -1, -1, -1, 43, -1, -1, + -1, 47, -1, -1, 39, -1, 41, 42, -1, -1, + -1, -1, -1, -1, 49, -1, -1, 52, 53, 65, + 66, 67, 68, 58, 70, -1, -1, -1, -1, 64, + -1, -1, -1, -1, -1, 81, 82, 83, -1, -1, + -1, -1, 88, -1, -1, 80, -1, -1, -1, -1, + 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, + -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 65, 66, 67, 68, + -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 81, 82, 83, -1, -1, -1, -1, 88, + -1, -1, -1, -1, -1, -1, -1, 96, 97, 98, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, + 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, + -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, + 33, 34, -1, 36, -1, -1, -1, -1, -1, -1, + 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 65, 66, 67, 68, -1, 70, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 81, 82, + 83, -1, -1, -1, -1, 88, -1, -1, -1, -1, + -1, -1, -1, 96, 97, 98, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 10, -1, 12, 13, -1, + -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, + -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, -1, -1, -1, -1, -1, -1, 43, -1, + -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 65, 66, 67, 68, -1, 70, -1, -1, -1, -1, + 75, -1, -1, -1, -1, -1, 81, 82, 83, 84, + 85, -1, -1, 88, -1, -1, 91, -1, -1, -1, + -1, 96, 97, 98, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 10, -1, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, + 47, -1, -1, -1, -1, -1, -1, -1, 55, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, + 67, 68, -1, 70, -1, -1, -1, -1, 75, -1, + -1, -1, -1, -1, 81, 82, 83, 84, 85, -1, + -1, 88, -1, -1, 91, -1, -1, -1, -1, 96, + 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 10, -1, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, + -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, + -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 65, 66, 67, 68, + -1, 70, -1, -1, -1, -1, 75, -1, -1, -1, + -1, -1, 81, 82, 83, 84, 85, -1, -1, 88, + -1, -1, 91, -1, -1, -1, -1, 96, 97, 98, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, + 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, + 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, + -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, + 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, + -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, + 72, -1, 74, -1, 76, -1, -1, -1, -1, 81, + 82, 83, -1, -1, -1, -1, 88, -1, -1, -1, + -1, -1, -1, -1, 96, 97, 98, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, + 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, + -1, 72, -1, 74, -1, 76, -1, -1, -1, -1, + 81, 82, 83, -1, -1, -1, -1, 88, -1, -1, + -1, -1, -1, -1, -1, 96, 97, 98, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, + 74, 75, 76, -1, -1, -1, -1, 81, 82, 83, + -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, + -1, -1, 96, 97, 98, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, + -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, + 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, + -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, + -1, -1, 96, 97, 98, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, + -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, + 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, + -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, + -1, -1, 96, 97, 98, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, + -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, + 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, + -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, + -1, -1, 96, 97, 98, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, + -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, + 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, + -1, -1, -1, -1, 88, -1, -1, -1, -1, -1, + -1, -1, 96, 97, 98, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, 30, -1, -1, 33, 34, -1, 36, + -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, + 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, + -1, -1, -1, -1, 61, -1, -1, -1, 65, 66, + 67, 68, 69, 70, -1, 72, 73, 74, -1, 76, + -1, 78, -1, -1, 81, 82, 83, -1, -1, -1, + -1, 88, -1, -1, -1, -1, -1, -1, -1, 96, + 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, + -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, + 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, + 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, + -1, 51, -1, 53, -1, -1, -1, -1, -1, -1, + -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, + 70, -1, 72, 73, 74, -1, 76, -1, 78, -1, + -1, 81, 82, 83, -1, -1, -1, -1, 88, -1, + -1, -1, -1, -1, -1, -1, 96, 97, 98, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, + 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, + -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, + 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, + 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, + 53, -1, -1, -1, -1, -1, -1, -1, 61, -1, + -1, -1, 65, 66, 67, 68, 69, 70, -1, 72, + 73, 74, -1, 76, -1, 78, -1, -1, 81, 82, + 83, -1, -1, -1, -1, 88, -1, -1, -1, -1, + -1, -1, -1, 96, 97, 98, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, + 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, + -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, + 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 43, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 59, -1, -1, -1, -1, -1, -1, 66, 67, 68, + 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, + -1, -1, 81, 82, 83, 84, 85, 86, 87, -1, + -1, -1, 91, -1, -1, -1, -1, 96, 97, 98, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, + 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, + -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, + -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, + -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, + 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, + 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, + 85, 86, 87, -1, -1, -1, 91, -1, -1, -1, + -1, 96, 97, 98, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, + 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, + 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, + 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, + -1, -1, -1, -1, 65, 66, 67, 68, 69, 70, + 71, -1, 73, 74, 75, 76, 77, 78, -1, -1, + 81, 82, 83, 84, 85, 86, 87, -1, -1, -1, + 91, -1, -1, -1, -1, 96, 97, 98, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, + -1, -1, 9, 10, 11, -1, -1, 14, -1, 16, + -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, + -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, + 47, -1, -1, -1, -1, -1, -1, -1, 55, -1, + -1, -1, 59, -1, -1, -1, -1, -1, 65, 66, + 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, + 77, 78, -1, -1, 81, 82, 83, 84, 85, 86, + 87, -1, -1, -1, 91, -1, -1, -1, -1, 96, + 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 4, -1, -1, -1, -1, 9, -1, 11, 12, + 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, + -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, + 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, + 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, + 53, -1, -1, -1, -1, -1, 59, -1, 61, -1, + -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, + 83, 84, 85, 86, -1, 88, -1, -1, -1, -1, + -1, -1, -1, 96, 97, 98, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, + 9, -1, 11, 12, 13, 14, -1, -1, -1, -1, + -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, + 29, 30, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, + 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + -1, -1, 81, 82, 83, 84, 85, 86, -1, 88, + -1, -1, -1, -1, -1, -1, -1, 96, 97, 98, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, + 5, 6, -1, -1, 9, 10, 11, 12, 13, 14, + -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, + -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, + -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, + -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, + -1, -1, -1, -1, 59, -1, 61, -1, -1, -1, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, + 85, 86, 87, 88, -1, -1, 91, -1, -1, -1, + -1, 96, 97, 98, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, + 11, 12, 13, 14, -1, 16, -1, -1, -1, 20, + 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, + 31, 32, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, 55, -1, -1, -1, 59, -1, + 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, + 81, 82, 83, 84, 85, 86, 87, 88, -1, -1, + 91, -1, -1, -1, -1, 96, 97, 98, -1, -1, + -1, -1, -1, -1, -1, -1, -1, - 3, 42, 9, 77, 18, 3, 25, 42, 18, 25, - 18, 105, 18, 42, 42, 3, 100, 3, 103, 3, - 14, 18, 14, 22, 42, 18, 22, 32, 3, 18, - 25, 32, 3, 3, 14, 18, 18, 18, 42, 3, - 42, 3, 42, 3, 18, 32, 25, 32, 3, 3, - 18, 42, 42, 18, 3, 18, 22, 18, 3, 18, - 18, 18, 18, 32, 42, 18, 18, 18, 18, 3, - 3, -1, 18, 2, 22, 18, 18, 18, 25, 14, - 18, 4, 14, 2, 2, 2, 14, 19, 32, 18, - 3, 19, 3, 2, 18, 18, 18, 18, 4, 18, - 18, 18, 38, -1, 18, 3, 42, 14, 3, 18, - 18, 14, 18, 3, 54, 54, 51, 54, -1, 59, - 59, 45, 59, 45, 54, 46, 56, 54, 54, 54, - 2, 45, 59, 59, 59, 2, 2, 2, 54, 54, - 56, 56, 18, 2, 51, -1, 18, -1, 51, 18, - -1, 18, 18, 18, 54, 54, 56, 56, 54, 18, - 56, 54, 54, 56, 56, 78, 54, 78, 56, 42, - 46, 109, 54, 2, 56, 2, 54, 50, 2, 54, - 78, 2, 2, 54, 18, 56, 94, 2, 78, 18, - 18, 18, 70, 68, 18, 18, 54, 18, 18, 54, - 54, 56, 56, 18, 54, 54, 64, 54, 58, 54, - 44, 58, 4, 54, 59, 56, 2, 66, 54, 47, - 56, 44, 54, 92, 54, 18, 18, 59, 58, 54, - 18, 18, 18, -1, 59, 54, 54, 54, 54, 57, - 59, 57, 59, 54, -1, 54, 54, 54, 59, 54, - 43, 60, 60, 60, 18, 60, 54, 45, 42, 46, - 11, 12, 14, 54, 62, 56, 50, 19, -1, 54, - -1, 56, 54, 54, 56, 54, 54, 54, 59, -1, - 59, 59, 59, 47, 48, 54, 54, 54, 2, 2, - 59, 59, 59, 14, 71, 76, 54, 76, 76, -1, - 69, 59, 23, -1, 18, 18, 54, 65, 76, 76, - -1, 59, 54, 54, 35, 36, -1, 59, 59, 67, - 61, 63, 54, 54, -1, 14, 54, 59, 59, 61, - 61, 59, 5, 61, 23, 5, -1, -1, -1, -1, - -1, 14, -1, -1, 14, -1, -1, -1, -1, -1, - 23, -1, -1, 23, 25, 26, 27, 28, 29, 30, - 31, -1, 35, 36, -1, 35, 36, 14, -1, -1, - -1, -1, -1, -1, 88, 88, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 14, -1, -1, -1, -1, - -1, -1, -1, -1, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 14, -1, -1, -1, -1, -1, -1, - -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, - 31, -1, 14, -1, -1, -1, -1, 19, -1, 21, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1}; + 3, 43, 32, 18, 32, 9, 18, 18, 78, 18, + 18, 3, 18, 18, 32, 25, 18, 3, 3, 43, + 18, 3, 3, 22, 18, 18, 22, 18, 18, 3, + 18, 32, 32, 22, 14, 22, 14, 3, 3, 18, + 3, 25, 106, 18, 3, 3, 43, 18, 43, 25, + 3, 18, 25, 3, 104, 3, 101, 18, 3, 3, + 43, 25, 18, 18, 18, 14, 43, 18, 2, -1, + 3, 43, 32, 43, 43, 43, 18, 18, 18, 18, + 2, 43, 18, 18, 18, 14, 2, 18, 3, -1, + 18, 2, 4, 18, 14, 14, 18, -1, 55, 19, + 57, -1, 18, 55, 23, 57, 18, 18, 55, 3, + 57, 47, 55, 18, 57, 46, 44, 55, 55, 57, + 57, 46, 43, 52, 2, 55, 18, 57, 55, 55, + 51, 55, 55, 60, 60, 4, 60, 55, 55, 57, + 18, 55, 47, 60, 14, 55, 79, 55, 71, 18, + 60, 55, 60, 57, 55, 69, 57, 43, 55, 39, + 57, 14, 55, 43, 79, 51, 19, 60, 55, 2, + 14, 55, 55, 60, 55, 110, 60, 60, 18, 60, + 55, 2, 52, 55, 59, 18, 3, 59, 55, 55, + 55, 57, 59, 2, 55, 60, 3, 18, 18, 4, + 55, 2, 18, 95, 2, 45, 67, 2, 52, 18, + 65, 2, 18, 18, 2, 18, 55, 18, 11, 12, + 18, 2, 61, 18, 55, 2, 57, 18, 48, 18, + 18, 47, 55, 55, 57, 57, 55, 18, 18, 58, + 46, 18, 55, 46, 55, 58, -1, 55, 2, 57, + 14, 55, 63, 55, -1, 19, 45, 61, 55, 61, + 57, 55, 79, 55, 18, 57, 2, 61, 55, 55, + 55, -1, 79, 60, 60, 60, 55, 62, 64, 55, + 55, 60, 18, 62, 60, 60, 62, 62, 55, 55, + 77, 18, 55, 60, 60, 2, 55, 60, 55, 55, + 66, 60, 55, 60, 60, 68, 14, 60, -1, 55, + 77, 18, -1, 93, 60, 23, 72, 70, 77, 2, + 77, 48, 49, -1, -1, 14, -1, 35, 36, 5, + 19, 77, 21, -1, -1, 18, -1, -1, 14, 25, + 26, 27, 28, 29, 30, 31, -1, 23, -1, -1, + -1, -1, 14, 89, 43, -1, -1, -1, -1, 35, + 36, 23, 24, 25, 26, 27, 28, 29, 30, 31, + -1, -1, -1, -1, 14, -1, -1, -1, -1, -1, + -1, -1, 89, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 14, -1, -1, -1, -1, -1, -1, -1, + -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, + -1, -1, -1, -1, -1, -1, -1, -1, 14, -1, + -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, + 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1 +}; QT_END_NAMESPACE diff --git a/src/qml/parser/qqmljsgrammar_p.h b/src/qml/parser/qqmljsgrammar_p.h index b4f762d28b..aa8450f218 100644 --- a/src/qml/parser/qqmljsgrammar_p.h +++ b/src/qml/parser/qqmljsgrammar_p.h @@ -59,153 +59,154 @@ QT_BEGIN_NAMESPACE class QQmlJSGrammar { public: - enum VariousConstants { - EOF_SYMBOL = 0, - REDUCE_HERE = 106, - SHIFT_THERE = 105, - T_AND = 1, - T_AND_AND = 2, - T_AND_EQ = 3, - T_AS = 94, - T_AUTOMATIC_SEMICOLON = 62, - T_BREAK = 4, - T_CASE = 5, - T_CATCH = 6, - T_COLON = 7, - T_COMMA = 8, - T_COMMENT = 89, - T_COMPATIBILITY_SEMICOLON = 90, - T_CONST = 84, - T_CONTINUE = 9, - T_DEBUGGER = 86, - T_DEFAULT = 10, - T_DELETE = 11, - T_DIVIDE_ = 12, - T_DIVIDE_EQ = 13, - T_DO = 14, - T_DOT = 15, - T_ELSE = 16, - T_EQ = 17, - T_EQ_EQ = 18, - T_EQ_EQ_EQ = 19, - T_ERROR = 98, - T_FALSE = 83, - T_FEED_JS_EXPRESSION = 102, - T_FEED_JS_PROGRAM = 104, - T_FEED_JS_SOURCE_ELEMENT = 103, - T_FEED_JS_STATEMENT = 101, - T_FEED_UI_OBJECT_MEMBER = 100, - T_FEED_UI_PROGRAM = 99, - T_FINALLY = 20, - T_FOR = 21, - T_FUNCTION = 22, - T_GE = 23, - T_GET = 96, - T_GT = 24, - T_GT_GT = 25, - T_GT_GT_EQ = 26, - T_GT_GT_GT = 27, - T_GT_GT_GT_EQ = 28, - T_IDENTIFIER = 29, - T_IF = 30, - T_IMPORT = 92, - T_IN = 31, - T_INSTANCEOF = 32, - T_LBRACE = 33, - T_LBRACKET = 34, - T_LE = 35, - T_LET = 85, - T_LPAREN = 36, - T_LT = 37, - T_LT_LT = 38, - T_LT_LT_EQ = 39, - T_MINUS = 40, - T_MINUS_EQ = 41, - T_MINUS_MINUS = 42, - T_MULTILINE_STRING_LITERAL = 88, - T_NEW = 43, - T_NOT = 44, - T_NOT_EQ = 45, - T_NOT_EQ_EQ = 46, - T_NULL = 81, - T_NUMERIC_LITERAL = 47, - T_ON = 95, - T_OR = 48, - T_OR_EQ = 49, - T_OR_OR = 50, - T_PLUS = 51, - T_PLUS_EQ = 52, - T_PLUS_PLUS = 53, - T_PRAGMA = 93, - T_PROPERTY = 66, - T_PUBLIC = 91, - T_QUESTION = 54, - T_RBRACE = 55, - T_RBRACKET = 56, - T_READONLY = 68, - T_REMAINDER = 57, - T_REMAINDER_EQ = 58, - T_RESERVED_WORD = 87, - T_RETURN = 59, - T_RPAREN = 60, - T_SEMICOLON = 61, - T_SET = 97, - T_SIGNAL = 67, - T_STAR = 63, - T_STAR_EQ = 64, - T_STRING_LITERAL = 65, - T_SWITCH = 69, - T_THIS = 70, - T_THROW = 71, - T_TILDE = 72, - T_TRUE = 82, - T_TRY = 73, - T_TYPEOF = 74, - T_VAR = 75, - T_VOID = 76, - T_WHILE = 77, - T_WITH = 78, - T_XOR = 79, - T_XOR_EQ = 80, - - ACCEPT_STATE = 678, - RULE_COUNT = 363, - STATE_COUNT = 679, - TERMINAL_COUNT = 107, - NON_TERMINAL_COUNT = 111, - - GOTO_INDEX_OFFSET = 679, - GOTO_INFO_OFFSET = 3203, - GOTO_CHECK_OFFSET = 3203 - }; - - static const char *const spell []; - static const short lhs []; - static const short rhs []; - static const short goto_default []; - static const short action_default []; - static const short action_index []; - static const short action_info []; - static const short action_check []; - - static inline int nt_action (int state, int nt) - { - const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; - if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) - return goto_default [nt]; - - return action_info [GOTO_INFO_OFFSET + yyn]; - } - - static inline int t_action (int state, int token) - { - const int yyn = action_index [state] + token; - - if (yyn < 0 || action_check [yyn] != token) - return - action_default [state]; - - return action_info [yyn]; - } + enum VariousConstants { + EOF_SYMBOL = 0, + REDUCE_HERE = 107, + SHIFT_THERE = 106, + T_AND = 1, + T_AND_AND = 2, + T_AND_EQ = 3, + T_AS = 95, + T_AUTOMATIC_SEMICOLON = 62, + T_BREAK = 4, + T_CASE = 5, + T_CATCH = 6, + T_COLON = 7, + T_COMMA = 8, + T_COMMENT = 89, + T_COMPATIBILITY_SEMICOLON = 90, + T_CONST = 84, + T_CONTINUE = 9, + T_DEBUGGER = 86, + T_DEFAULT = 10, + T_DELETE = 11, + T_DIVIDE_ = 12, + T_DIVIDE_EQ = 13, + T_DO = 14, + T_DOT = 15, + T_ELSE = 16, + T_ENUM = 91, + T_EQ = 17, + T_EQ_EQ = 18, + T_EQ_EQ_EQ = 19, + T_ERROR = 99, + T_FALSE = 83, + T_FEED_JS_EXPRESSION = 103, + T_FEED_JS_PROGRAM = 105, + T_FEED_JS_SOURCE_ELEMENT = 104, + T_FEED_JS_STATEMENT = 102, + T_FEED_UI_OBJECT_MEMBER = 101, + T_FEED_UI_PROGRAM = 100, + T_FINALLY = 20, + T_FOR = 21, + T_FUNCTION = 22, + T_GE = 23, + T_GET = 97, + T_GT = 24, + T_GT_GT = 25, + T_GT_GT_EQ = 26, + T_GT_GT_GT = 27, + T_GT_GT_GT_EQ = 28, + T_IDENTIFIER = 29, + T_IF = 30, + T_IMPORT = 93, + T_IN = 31, + T_INSTANCEOF = 32, + T_LBRACE = 33, + T_LBRACKET = 34, + T_LE = 35, + T_LET = 85, + T_LPAREN = 36, + T_LT = 37, + T_LT_LT = 38, + T_LT_LT_EQ = 39, + T_MINUS = 40, + T_MINUS_EQ = 41, + T_MINUS_MINUS = 42, + T_MULTILINE_STRING_LITERAL = 88, + T_NEW = 43, + T_NOT = 44, + T_NOT_EQ = 45, + T_NOT_EQ_EQ = 46, + T_NULL = 81, + T_NUMERIC_LITERAL = 47, + T_ON = 96, + T_OR = 48, + T_OR_EQ = 49, + T_OR_OR = 50, + T_PLUS = 51, + T_PLUS_EQ = 52, + T_PLUS_PLUS = 53, + T_PRAGMA = 94, + T_PROPERTY = 66, + T_PUBLIC = 92, + T_QUESTION = 54, + T_RBRACE = 55, + T_RBRACKET = 56, + T_READONLY = 68, + T_REMAINDER = 57, + T_REMAINDER_EQ = 58, + T_RESERVED_WORD = 87, + T_RETURN = 59, + T_RPAREN = 60, + T_SEMICOLON = 61, + T_SET = 98, + T_SIGNAL = 67, + T_STAR = 63, + T_STAR_EQ = 64, + T_STRING_LITERAL = 65, + T_SWITCH = 69, + T_THIS = 70, + T_THROW = 71, + T_TILDE = 72, + T_TRUE = 82, + T_TRY = 73, + T_TYPEOF = 74, + T_VAR = 75, + T_VOID = 76, + T_WHILE = 77, + T_WITH = 78, + T_XOR = 79, + T_XOR_EQ = 80, + + ACCEPT_STATE = 687, + RULE_COUNT = 367, + STATE_COUNT = 688, + TERMINAL_COUNT = 108, + NON_TERMINAL_COUNT = 112, + + GOTO_INDEX_OFFSET = 688, + GOTO_INFO_OFFSET = 3217, + GOTO_CHECK_OFFSET = 3217 + }; + + static const char *const spell[]; + static const short lhs[]; + static const short rhs[]; + static const short goto_default[]; + static const short action_default[]; + static const short action_index[]; + static const short action_info[]; + static const short action_check[]; + + static inline int nt_action (int state, int nt) + { + const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt; + if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt) + return goto_default [nt]; + + return action_info [GOTO_INFO_OFFSET + yyn]; + } + + static inline int t_action (int state, int token) + { + const int yyn = action_index [state] + token; + + if (yyn < 0 || action_check [yyn] != token) + return - action_default [state]; + + return action_info [yyn]; + } }; diff --git a/src/qml/parser/qqmljskeywords_p.h b/src/qml/parser/qqmljskeywords_p.h index 8b789526a5..20daf545a9 100644 --- a/src/qml/parser/qqmljskeywords_p.h +++ b/src/qml/parser/qqmljskeywords_p.h @@ -181,7 +181,7 @@ static inline int classify4(const QChar *s, bool qmlMode) { else if (s[1].unicode() == 'n') { if (s[2].unicode() == 'u') { if (s[3].unicode() == 'm') { - return Lexer::T_ENUM; + return qmlMode ? int(Lexer::T_ENUM) : int(Lexer::T_RESERVED_WORD); } } } diff --git a/src/qml/parser/qqmljslexer_p.h b/src/qml/parser/qqmljslexer_p.h index af5597b625..11d8081713 100644 --- a/src/qml/parser/qqmljslexer_p.h +++ b/src/qml/parser/qqmljslexer_p.h @@ -99,7 +99,6 @@ public: T_CHAR = T_RESERVED_WORD, T_CLASS = T_RESERVED_WORD, T_DOUBLE = T_RESERVED_WORD, - T_ENUM = T_RESERVED_WORD, T_EXPORT = T_RESERVED_WORD, T_EXTENDS = T_RESERVED_WORD, T_FINAL = T_RESERVED_WORD, diff --git a/src/qml/parser/qqmljsparser.cpp b/src/qml/parser/qqmljsparser.cpp index 636b959097..3844fe4473 100644 --- a/src/qml/parser/qqmljsparser.cpp +++ b/src/qml/parser/qqmljsparser.cpp @@ -656,49 +656,71 @@ case 75: { sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node); } break; -case 83: { +case 76: { + AST::UiEnumDeclaration *enumDeclaration = new (pool) AST::UiEnumDeclaration(stringRef(2), sym(4).UiEnumMemberList->finish()); + enumDeclaration->enumToken = loc(1); + enumDeclaration->rbraceToken = loc(5); + sym(1).Node = enumDeclaration; + break; +} + +case 77: { + AST::UiEnumMemberList *node = new (pool) AST::UiEnumMemberList(stringRef(1)); + node->memberToken = loc(1); + sym(1).Node = node; + break; +} + +case 78: { + AST::UiEnumMemberList *node = new (pool) AST::UiEnumMemberList(sym(1).UiEnumMemberList, stringRef(3)); + node->memberToken = loc(3); + sym(1).Node = node; + break; +} + +case 86: { AST::ThisExpression *node = new (pool) AST::ThisExpression(); node->thisToken = loc(1); sym(1).Node = node; } break; -case 84: { +case 87: { AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1)); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 85: { +case 88: { AST::NullExpression *node = new (pool) AST::NullExpression(); node->nullToken = loc(1); sym(1).Node = node; } break; -case 86: { +case 89: { AST::TrueLiteral *node = new (pool) AST::TrueLiteral(); node->trueToken = loc(1); sym(1).Node = node; } break; -case 87: { +case 90: { AST::FalseLiteral *node = new (pool) AST::FalseLiteral(); node->falseToken = loc(1); sym(1).Node = node; } break; -case 88: { +case 91: { AST::NumericLiteral *node = new (pool) AST::NumericLiteral(sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 89: -case 90: { +case 92: +case 93: { AST::StringLiteral *node = new (pool) AST::StringLiteral(stringRef(1)); node->literalToken = loc(1); sym(1).Node = node; } break; -case 91: { +case 94: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -714,7 +736,7 @@ case 91: { sym(1).Node = node; } break; -case 92: { +case 95: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -730,28 +752,28 @@ case 92: { sym(1).Node = node; } break; -case 93: { +case 96: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral((AST::Elision *) 0); node->lbracketToken = loc(1); node->rbracketToken = loc(2); sym(1).Node = node; } break; -case 94: { +case 97: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).Elision->finish()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 95: { +case 98: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 96: { +case 99: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (), (AST::Elision *) 0); node->lbracketToken = loc(1); @@ -760,7 +782,7 @@ case 96: { sym(1).Node = node; } break; -case 97: { +case 100: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (), sym(4).Elision->finish()); node->lbracketToken = loc(1); @@ -769,7 +791,7 @@ case 97: { sym(1).Node = node; } break; -case 98: { +case 101: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = new (pool) AST::ObjectLiteral( @@ -781,7 +803,7 @@ case 98: { sym(1).Node = node; } break; -case 99: { +case 102: { AST::ObjectLiteral *node = new (pool) AST::ObjectLiteral( sym(2).PropertyAssignmentList->finish ()); node->lbraceToken = loc(1); @@ -789,14 +811,14 @@ case 99: { sym(1).Node = node; } break; -case 100: { +case 103: { AST::NestedExpression *node = new (pool) AST::NestedExpression(sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 101: { +case 104: { if (AST::ArrayMemberExpression *mem = AST::cast(sym(1).Expression)) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken, QLatin1String("Ignored annotation"))); @@ -816,48 +838,48 @@ case 101: { } } break; -case 102: { +case 105: { sym(1).Node = new (pool) AST::ElementList((AST::Elision *) 0, sym(1).Expression); } break; -case 103: { +case 106: { sym(1).Node = new (pool) AST::ElementList(sym(1).Elision->finish(), sym(2).Expression); } break; -case 104: { +case 107: { AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList, (AST::Elision *) 0, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 105: { +case 108: { AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList, sym(3).Elision->finish(), sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 106: { +case 109: { AST::Elision *node = new (pool) AST::Elision(); node->commaToken = loc(1); sym(1).Node = node; } break; -case 107: { +case 110: { AST::Elision *node = new (pool) AST::Elision(sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 108: { +case 111: { AST::PropertyNameAndValue *node = new (pool) AST::PropertyNameAndValue( sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 109: { +case 112: { AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter( sym(2).PropertyName, sym(6).FunctionBody); node->getSetToken = loc(1); @@ -868,7 +890,7 @@ case 109: { sym(1).Node = node; } break; -case 110: { +case 113: { AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter( sym(2).PropertyName, sym(4).FormalParameterList, sym(7).FunctionBody); node->getSetToken = loc(1); @@ -879,56 +901,56 @@ case 110: { sym(1).Node = node; } break; -case 111: { +case 114: { sym(1).Node = new (pool) AST::PropertyAssignmentList(sym(1).PropertyAssignment); } break; -case 112: { +case 115: { AST::PropertyAssignmentList *node = new (pool) AST::PropertyAssignmentList( sym(1).PropertyAssignmentList, sym(3).PropertyAssignment); node->commaToken = loc(2); sym(1).Node = node; } break; -case 113: { +case 116: { AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1)); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 114: { +case 117: { AST::StringLiteralPropertyName *node = new (pool) AST::StringLiteralPropertyName(stringRef(1)); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 115: { +case 118: { AST::NumericLiteralPropertyName *node = new (pool) AST::NumericLiteralPropertyName(sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 116: { +case 119: { AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1)); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 153: { +case 157: { AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 154: { +case 158: { AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3)); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 155: { +case 159: { AST::NewMemberExpression *node = new (pool) AST::NewMemberExpression(sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -936,384 +958,384 @@ case 155: { sym(1).Node = node; } break; -case 157: { +case 161: { AST::NewExpression *node = new (pool) AST::NewExpression(sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 158: { +case 162: { AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 159: { +case 163: { AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 160: { +case 164: { AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 161: { +case 165: { AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3)); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 162: { +case 166: { sym(1).Node = 0; } break; -case 163: { +case 167: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 164: { +case 168: { sym(1).Node = new (pool) AST::ArgumentList(sym(1).Expression); } break; -case 165: { +case 169: { AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 169: { +case 173: { AST::PostIncrementExpression *node = new (pool) AST::PostIncrementExpression(sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 170: { +case 174: { AST::PostDecrementExpression *node = new (pool) AST::PostDecrementExpression(sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 172: { +case 176: { AST::DeleteExpression *node = new (pool) AST::DeleteExpression(sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 173: { +case 177: { AST::VoidExpression *node = new (pool) AST::VoidExpression(sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 174: { +case 178: { AST::TypeOfExpression *node = new (pool) AST::TypeOfExpression(sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 175: { +case 179: { AST::PreIncrementExpression *node = new (pool) AST::PreIncrementExpression(sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 176: { +case 180: { AST::PreDecrementExpression *node = new (pool) AST::PreDecrementExpression(sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 177: { +case 181: { AST::UnaryPlusExpression *node = new (pool) AST::UnaryPlusExpression(sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 178: { +case 182: { AST::UnaryMinusExpression *node = new (pool) AST::UnaryMinusExpression(sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 179: { +case 183: { AST::TildeExpression *node = new (pool) AST::TildeExpression(sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 180: { +case 184: { AST::NotExpression *node = new (pool) AST::NotExpression(sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 182: { +case 186: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 183: { +case 187: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 184: { +case 188: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 186: { +case 190: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 187: { +case 191: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 189: { +case 193: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 190: { +case 194: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 191: { +case 195: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 193: { +case 197: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 194: { +case 198: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 195: { +case 199: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 196: { +case 200: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 197: { +case 201: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 198: { +case 202: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 200: { +case 204: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 201: { +case 205: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 202: { +case 206: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 203: { +case 207: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 204: { +case 208: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 206: { +case 210: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 207: { +case 211: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 208: { +case 212: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 209: { +case 213: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 211: { +case 215: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 212: { +case 216: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 213: { +case 217: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 214: { +case 218: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 216: { +case 220: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 218: { +case 222: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 220: { +case 224: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 222: { +case 226: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 224: { +case 228: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 226: { +case 230: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 228: { +case 232: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 230: { +case 234: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 232: { +case 236: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 234: { +case 238: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 236: { +case 240: { AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1321,7 +1343,7 @@ case 236: { sym(1).Node = node; } break; -case 238: { +case 242: { AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1329,112 +1351,112 @@ case 238: { sym(1).Node = node; } break; -case 240: { +case 244: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 242: { +case 246: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 243: { +case 247: { sym(1).ival = QSOperator::Assign; } break; -case 244: { +case 248: { sym(1).ival = QSOperator::InplaceMul; } break; -case 245: { +case 249: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 246: { +case 250: { sym(1).ival = QSOperator::InplaceMod; } break; -case 247: { +case 251: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 248: { +case 252: { sym(1).ival = QSOperator::InplaceSub; } break; -case 249: { +case 253: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 250: { +case 254: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 251: { +case 255: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 252: { +case 256: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 253: { +case 257: { sym(1).ival = QSOperator::InplaceXor; } break; -case 254: { +case 258: { sym(1).ival = QSOperator::InplaceOr; } break; -case 256: { +case 260: { AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 257: { +case 261: { sym(1).Node = 0; } break; -case 260: { +case 264: { AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 261: { +case 265: { sym(1).Node = 0; } break; -case 278: { +case 282: { AST::Block *node = new (pool) AST::Block(sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 279: { +case 283: { sym(1).Node = new (pool) AST::StatementList(sym(1).Statement); } break; -case 280: { +case 284: { sym(1).Node = new (pool) AST::StatementList(sym(1).StatementList, sym(2).Statement); } break; -case 281: { +case 285: { sym(1).Node = 0; } break; -case 282: { +case 286: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 284: { +case 288: { AST::VariableDeclaration::VariableScope s = AST::VariableDeclaration::FunctionScope; if (sym(1).ival == T_LET) s = AST::VariableDeclaration::BlockScope; @@ -1447,82 +1469,82 @@ case 284: { sym(1).Node = node; } break; -case 285: { +case 289: { sym(1).ival = T_LET; } break; -case 286: { +case 290: { sym(1).ival = T_CONST; } break; -case 287: { +case 291: { sym(1).ival = T_VAR; } break; -case 288: { +case 292: { sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration); } break; -case 289: { +case 293: { AST::VariableDeclarationList *node = new (pool) AST::VariableDeclarationList( sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 290: { +case 294: { sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration); } break; -case 291: { +case 295: { sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 292: { +case 296: { AST::VariableDeclaration::VariableScope s = AST::VariableDeclaration::FunctionScope; AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression, s); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 293: { +case 297: { AST::VariableDeclaration::VariableScope s = AST::VariableDeclaration::FunctionScope; AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression, s); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 294: { +case 298: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 295: { +case 299: { sym(1).Node = 0; } break; -case 297: { +case 301: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 298: { +case 302: { sym(1).Node = 0; } break; -case 300: { +case 304: { AST::EmptyStatement *node = new (pool) AST::EmptyStatement(); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 302: { +case 306: { AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 303: { +case 307: { AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1531,7 +1553,7 @@ case 303: { sym(1).Node = node; } break; -case 304: { +case 308: { AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1539,7 +1561,7 @@ case 304: { sym(1).Node = node; } break; -case 307: { +case 311: { AST::DoWhileStatement *node = new (pool) AST::DoWhileStatement(sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1549,7 +1571,7 @@ case 307: { sym(1).Node = node; } break; -case 308: { +case 312: { AST::WhileStatement *node = new (pool) AST::WhileStatement(sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1557,7 +1579,7 @@ case 308: { sym(1).Node = node; } break; -case 309: { +case 313: { AST::ForStatement *node = new (pool) AST::ForStatement(sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1568,7 +1590,7 @@ case 309: { sym(1).Node = node; } break; -case 310: { +case 314: { AST::VariableDeclaration::VariableScope s = AST::VariableDeclaration::FunctionScope; AST::LocalForStatement *node = new (pool) AST::LocalForStatement( sym(4).VariableDeclarationList->finish(s), sym(6).Expression, @@ -1582,7 +1604,7 @@ case 310: { sym(1).Node = node; } break; -case 311: { +case 315: { AST:: ForEachStatement *node = new (pool) AST::ForEachStatement(sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1592,7 +1614,7 @@ case 311: { sym(1).Node = node; } break; -case 312: { +case 316: { AST::LocalForEachStatement *node = new (pool) AST::LocalForEachStatement( sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1603,14 +1625,14 @@ case 312: { sym(1).Node = node; } break; -case 314: { +case 318: { AST::ContinueStatement *node = new (pool) AST::ContinueStatement(); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 316: { +case 320: { AST::ContinueStatement *node = new (pool) AST::ContinueStatement(stringRef(2)); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1618,14 +1640,14 @@ case 316: { sym(1).Node = node; } break; -case 318: { +case 322: { AST::BreakStatement *node = new (pool) AST::BreakStatement(QStringRef()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 320: { +case 324: { AST::BreakStatement *node = new (pool) AST::BreakStatement(stringRef(2)); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1633,14 +1655,14 @@ case 320: { sym(1).Node = node; } break; -case 322: { +case 326: { AST::ReturnStatement *node = new (pool) AST::ReturnStatement(sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 323: { +case 327: { AST::WithStatement *node = new (pool) AST::WithStatement(sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1648,7 +1670,7 @@ case 323: { sym(1).Node = node; } break; -case 324: { +case 328: { AST::SwitchStatement *node = new (pool) AST::SwitchStatement(sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1656,83 +1678,83 @@ case 324: { sym(1).Node = node; } break; -case 325: { +case 329: { AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 326: { +case 330: { AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(5); sym(1).Node = node; } break; -case 327: { +case 331: { sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClause); } break; -case 328: { +case 332: { sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClauses, sym(2).CaseClause); } break; -case 329: { +case 333: { sym(1).Node = 0; } break; -case 330: { +case 334: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 331: { +case 335: { AST::CaseClause *node = new (pool) AST::CaseClause(sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 332: { +case 336: { AST::DefaultClause *node = new (pool) AST::DefaultClause(sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 333: { +case 337: { AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 335: { +case 339: { AST::ThrowStatement *node = new (pool) AST::ThrowStatement(sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 336: { +case 340: { AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 337: { +case 341: { AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 338: { +case 342: { AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 339: { +case 343: { AST::Catch *node = new (pool) AST::Catch(stringRef(3), sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1741,20 +1763,20 @@ case 339: { sym(1).Node = node; } break; -case 340: { +case 344: { AST::Finally *node = new (pool) AST::Finally(sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 342: { +case 346: { AST::DebuggerStatement *node = new (pool) AST::DebuggerStatement(); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 344: { +case 348: { AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1765,7 +1787,7 @@ case 344: { sym(1).Node = node; } break; -case 345: { +case 349: { AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (! stringRef(2).isNull()) @@ -1777,7 +1799,7 @@ case 345: { sym(1).Node = node; } break; -case 346: { +case 350: { AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(6).FunctionBody); node->functionToken = loc(1); node->lparenToken = loc(2); @@ -1787,56 +1809,56 @@ case 346: { sym(1).Node = node; } break; -case 347: { +case 351: { AST::FormalParameterList *node = new (pool) AST::FormalParameterList(stringRef(1)); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 348: { +case 352: { AST::FormalParameterList *node = new (pool) AST::FormalParameterList(sym(1).FormalParameterList, stringRef(3)); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 349: { +case 353: { sym(1).Node = 0; } break; -case 350: { +case 354: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 351: { +case 355: { sym(1).Node = 0; } break; -case 353: { +case 357: { sym(1).Node = new (pool) AST::FunctionBody(sym(1).SourceElements->finish ()); } break; -case 355: { +case 359: { sym(1).Node = new (pool) AST::Program(sym(1).SourceElements->finish ()); } break; -case 356: { +case 360: { sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElement); } break; -case 357: { +case 361: { sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElements, sym(2).SourceElement); } break; -case 358: { +case 362: { sym(1).Node = new (pool) AST::StatementSourceElement(sym(1).Statement); } break; -case 359: { +case 363: { sym(1).Node = new (pool) AST::FunctionSourceElement(sym(1).FunctionDeclaration); } break; -case 360: { +case 364: { sym(1).Node = 0; } break; diff --git a/src/qml/parser/qqmljsparser_p.h b/src/qml/parser/qqmljsparser_p.h index f382cd7563..6273ed48b3 100644 --- a/src/qml/parser/qqmljsparser_p.h +++ b/src/qml/parser/qqmljsparser_p.h @@ -125,6 +125,7 @@ public: AST::UiArrayMemberList *UiArrayMemberList; AST::UiQualifiedId *UiQualifiedId; AST::UiQualifiedPragmaId *UiQualifiedPragmaId; + AST::UiEnumMemberList *UiEnumMemberList; }; public: @@ -246,9 +247,9 @@ protected: -#define J_SCRIPT_REGEXPLITERAL_RULE1 91 +#define J_SCRIPT_REGEXPLITERAL_RULE1 94 -#define J_SCRIPT_REGEXPLITERAL_RULE2 92 +#define J_SCRIPT_REGEXPLITERAL_RULE2 95 QT_QML_END_NAMESPACE diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index ee5b38717b..d2a7970a84 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -295,7 +295,8 @@ public: QList *errors); bool resolveType(const QHashedStringRef &type, int *vmajor, int *vminor, - QQmlType** type_return, QList *errors); + QQmlType** type_return, QList *errors, + QQmlImport::RecursionRestriction recursionRestriction = QQmlImport::PreventRecursion); QUrl baseUrl; QString base; @@ -620,7 +621,8 @@ QString QQmlImports::versionString(int vmaj, int vmin, ImportVersion version) */ bool QQmlImports::resolveType(const QHashedStringRef &type, QQmlType** type_return, int *vmaj, int *vmin, - QQmlImportNamespace** ns_return, QList *errors) const + QQmlImportNamespace** ns_return, QList *errors, + QQmlImport::RecursionRestriction recursionRestriction) const { QQmlImportNamespace* ns = d->findQualifiedNamespace(type); if (ns) { @@ -629,7 +631,7 @@ bool QQmlImports::resolveType(const QHashedStringRef &type, return true; } if (type_return) { - if (d->resolveType(type,vmaj,vmin,type_return, errors)) { + if (d->resolveType(type,vmaj,vmin,type_return, errors, recursionRestriction)) { if (qmlImportTrace()) { #define RESOLVE_TYPE_DEBUG qDebug().nospace() << "QQmlImports(" << qPrintable(baseUrl().toString()) \ << ')' << "::resolveType: " << type.toString() << " => " @@ -712,7 +714,8 @@ bool QQmlImports::resolveType(QQmlImportNamespace* ns, const QHashedStringRef &t bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef& type, int *vmajor, int *vminor, - QQmlType** type_return, QString *base, bool *typeRecursionDetected) const + QQmlType** type_return, QString *base, bool *typeRecursionDetected, + QQmlImport::RecursionRestriction recursionRestriction) const { if (majversion >= 0 && minversion >= 0) { QQmlType *t = QQmlMetaType::qmlType(type, uri, majversion, minversion); @@ -747,7 +750,7 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, if (resolveLocalUrl(*base, c.fileName) != componentUrl) continue; // failed attempt to access an internal type } - if (*base == componentUrl) { + if (recursionRestriction == QQmlImport::PreventRecursion && *base == componentUrl) { if (typeRecursionDetected) *typeRecursionDetected = true; continue; // no recursion @@ -790,7 +793,7 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, } if (exists) { - if (base && (*base == qmlUrl)) { // no recursion + if (recursionRestriction == QQmlImport::PreventRecursion && base && (*base == qmlUrl)) { // no recursion if (typeRecursionDetected) *typeRecursionDetected = true; } else { @@ -806,7 +809,8 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, } bool QQmlImportsPrivate::resolveType(const QHashedStringRef& type, int *vmajor, int *vminor, - QQmlType** type_return, QList *errors) + QQmlType** type_return, QList *errors, + QQmlImport::RecursionRestriction recursionRestriction) { QQmlImportNamespace *s = 0; int dot = type.indexOf(Dot); @@ -835,7 +839,7 @@ bool QQmlImportsPrivate::resolveType(const QHashedStringRef& type, int *vmajor, } QHashedStringRef unqualifiedtype = dot < 0 ? type : QHashedStringRef(type.constData()+dot+1, type.length()-dot-1); if (s) { - if (s->resolveType(typeLoader,unqualifiedtype,vmajor,vminor,type_return, &base, errors)) + if (s->resolveType(typeLoader,unqualifiedtype,vmajor,vminor,type_return, &base, errors, recursionRestriction)) return true; if (s->imports.count() == 1 && !s->imports.at(0)->isLibrary && type_return && s != &unqualifiedset) { // qualified, and only 1 url @@ -858,13 +862,14 @@ QQmlImportInstance *QQmlImportNamespace::findImport(const QString &uri) const bool QQmlImportNamespace::resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef &type, int *vmajor, int *vminor, QQmlType** type_return, - QString *base, QList *errors) + QString *base, QList *errors, + QQmlImport::RecursionRestriction recursionRestriction) { bool typeRecursionDetected = false; for (int i=0; iresolveType(typeLoader, type, vmajor, vminor, type_return, - base, &typeRecursionDetected)) { + base, &typeRecursionDetected, recursionRestriction)) { if (qmlCheckTypes()) { // check for type clashes for (int j = i+1; j::const_iterator it = nameSpace->imports.constBegin(); + it != nameSpace->imports.constEnd(); ++it) { + if ((*it)->uri == importUri) + return true; + } + } + QQmlImportInstance *inserted = addImportToNamespace(nameSpace, importUri, url, vmaj, vmin, QV4::CompiledData::Import::ImportFile, errors, isImplicitImport); Q_ASSERT(inserted); diff --git a/src/qml/qml/qqmlimport_p.h b/src/qml/qml/qqmlimport_p.h index 7c691a468c..1a50d5c16a 100644 --- a/src/qml/qml/qqmlimport_p.h +++ b/src/qml/qml/qqmlimport_p.h @@ -70,6 +70,10 @@ class QQmlImportDatabase; class QQmlTypeLoader; class QQmlTypeLoaderQmldirContent; +namespace QQmlImport { + enum RecursionRestriction { PreventRecursion, AllowRecursion }; +} + struct QQmlImportInstance { QString uri; // e.g. QtQuick @@ -87,7 +91,8 @@ struct QQmlImportInstance bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef &type, int *vmajor, int *vminor, QQmlType** type_return, - QString *base = 0, bool *typeRecursionDetected = 0) const; + QString *base = 0, bool *typeRecursionDetected = 0, + QQmlImport::RecursionRestriction recursionRestriction = QQmlImport::PreventRecursion) const; }; class QQmlImportNamespace @@ -102,7 +107,8 @@ public: bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef& type, int *vmajor, int *vminor, QQmlType** type_return, - QString *base = 0, QList *errors = 0); + QString *base = 0, QList *errors = 0, + QQmlImport::RecursionRestriction recursionRestriction = QQmlImport::PreventRecursion); // Prefix when used as a qualified import. Otherwise empty. QHashedString prefix; @@ -128,7 +134,8 @@ public: QQmlType** type_return, int *version_major, int *version_minor, QQmlImportNamespace** ns_return, - QList *errors = 0) const; + QList *errors = 0, + QQmlImport::RecursionRestriction recursionRestriction = QQmlImport::PreventRecursion) const; bool resolveType(QQmlImportNamespace*, const QHashedStringRef& type, QQmlType** type_return, int *version_major, int *version_minor) const; diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 0672618225..b75508e1e5 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -160,8 +160,9 @@ public: ~QQmlTypePrivate(); void init() const; - void initEnums() const; + void initEnums(const QQmlPropertyCache *cache = 0) const; void insertEnums(const QMetaObject *metaObject) const; + void insertEnumsFromPropertyCache(const QQmlPropertyCache *cache) const; QQmlType::RegistrationType regType; @@ -500,75 +501,17 @@ QQmlType *QQmlType::resolveCompositeBaseType(QQmlEnginePrivate *engine) const return QQmlMetaType::qmlType(mo); } -int QQmlType::resolveCompositeEnumValue(QQmlEnginePrivate *engine, const QString &name, bool *ok) const +QQmlPropertyCache *QQmlType::compositePropertyCache(QQmlEnginePrivate *engine) const { + // similar logic to resolveCompositeBaseType Q_ASSERT(isComposite()); - *ok = false; - QQmlType *type = resolveCompositeBaseType(engine); - if (!type) - return -1; - return type->enumValue(engine, name, ok); -} - -int QQmlType::resolveCompositeScopedEnumIndex(QQmlEnginePrivate *engine, const QV4::String *name, bool *ok) const -{ - Q_ASSERT(isComposite()); - *ok = false; - QQmlType *type = resolveCompositeBaseType(engine); - if (!type) - return -1; - return type->scopedEnumIndex(engine, name, ok); -} - -int QQmlType::resolveCompositeScopedEnumIndex(QQmlEnginePrivate *engine, const QString &name, bool *ok) const -{ - Q_ASSERT(isComposite()); - *ok = false; - QQmlType *type = resolveCompositeBaseType(engine); - if (!type) - return -1; - return type->scopedEnumIndex(engine, name, ok); -} - - -int QQmlType::resolveCompositeScopedEnumValue(QQmlEnginePrivate *engine, int index, const QV4::String *name, bool *ok) const -{ - Q_ASSERT(isComposite()); - *ok = false; - QQmlType *type = resolveCompositeBaseType(engine); - if (!type) - return -1; - return type->scopedEnumValue(engine, index, name, ok); -} - -int QQmlType::resolveCompositeScopedEnumValue(QQmlEnginePrivate *engine, int index, const QString &name, bool *ok) const -{ - Q_ASSERT(isComposite()); - *ok = false; - QQmlType *type = resolveCompositeBaseType(engine); - if (!type) - return -1; - return type->scopedEnumValue(engine, index, name, ok); -} - -int QQmlType::resolveCompositeScopedEnumValue(QQmlEnginePrivate *engine, const QByteArray &scopedName, const QByteArray &name, bool *ok) const -{ - Q_ASSERT(isComposite()); - *ok = false; - QQmlType *type = resolveCompositeBaseType(engine); - if (!type) - return -1; - return type->scopedEnumValue(engine, scopedName, name, ok); -} - -int QQmlType::resolveCompositeScopedEnumValue(QQmlEnginePrivate *engine, const QStringRef &scopedName, const QStringRef &name, bool *ok) const -{ - Q_ASSERT(isComposite()); - *ok = false; - QQmlType *type = resolveCompositeBaseType(engine); - if (!type) - return -1; - return type->scopedEnumValue(engine, scopedName, name, ok); + if (!engine) + return 0; + QQmlRefPointer td(engine->typeLoader.getType(sourceUrl()), QQmlRefPointer::Adopt); + if (td.isNull() || !td->isComplete()) + return 0; + QV4::CompiledData::CompilationUnit *compilationUnit = td->compilationUnit(); + return compilationUnit->rootPropertyCache(); } static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo, @@ -737,7 +680,7 @@ void QQmlTypePrivate::init() const lock.unlock(); } -void QQmlTypePrivate::initEnums() const +void QQmlTypePrivate::initEnums(const QQmlPropertyCache *cache) const { if (isEnumSetup) return; @@ -746,6 +689,8 @@ void QQmlTypePrivate::initEnums() const QMutexLocker lock(metaTypeDataLock()); if (isEnumSetup) return; + if (cache) + insertEnumsFromPropertyCache(cache); if (baseMetaObject) // could be singleton type without metaobject insertEnums(baseMetaObject); @@ -784,6 +729,31 @@ void QQmlTypePrivate::insertEnums(const QMetaObject *metaObject) const } } +void QQmlTypePrivate::insertEnumsFromPropertyCache(const QQmlPropertyCache *cache) const +{ + const QMetaObject *cppMetaObject = cache->firstCppMetaObject(); + + while (cache && cache->metaObject() != cppMetaObject) { + QStringHash *scoped = new QStringHash(); + + int count = cache->qmlEnumCount(); + for (int ii = 0; ii < count; ++ii) { + QQmlEnumData *enumData = cache->qmlEnum(ii); + + for (int jj = 0; jj < enumData->values.count(); ++jj) { + const QQmlEnumValue &value = enumData->values.at(jj); + enums.insert(value.namedValue, value.value); + scoped->insert(value.namedValue, value.value); + } + scopedEnums << scoped; + scopedEnumIndex.insert(enumData->name, scopedEnums.count()-1); + } + cache = cache->parent(); + } + insertEnums(cppMetaObject); +} + + QByteArray QQmlType::typeName() const { if (d->regType == SingletonType || d->regType == CompositeSingletonType) @@ -1033,11 +1003,11 @@ QUrl QQmlType::sourceUrl() const int QQmlType::enumValue(QQmlEnginePrivate *engine, const QHashedStringRef &name, bool *ok) const { Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeEnumValue(engine, name.toString(), ok); + const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0; + *ok = true; - d->initEnums(); + d->initEnums(cache); int *rv = d->enums.value(name); if (rv) @@ -1050,11 +1020,11 @@ int QQmlType::enumValue(QQmlEnginePrivate *engine, const QHashedStringRef &name, int QQmlType::enumValue(QQmlEnginePrivate *engine, const QHashedCStringRef &name, bool *ok) const { Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeEnumValue(engine, name.toUtf16(), ok); + const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0; + *ok = true; - d->initEnums(); + d->initEnums(cache); int *rv = d->enums.value(name); if (rv) @@ -1067,11 +1037,10 @@ int QQmlType::enumValue(QQmlEnginePrivate *engine, const QHashedCStringRef &name int QQmlType::enumValue(QQmlEnginePrivate *engine, const QV4::String *name, bool *ok) const { Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeEnumValue(engine, name->toQString(), ok); + const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0; *ok = true; - d->initEnums(); + d->initEnums(cache); int *rv = d->enums.value(name); if (rv) @@ -1084,11 +1053,10 @@ int QQmlType::enumValue(QQmlEnginePrivate *engine, const QV4::String *name, bool int QQmlType::scopedEnumIndex(QQmlEnginePrivate *engine, const QV4::String *name, bool *ok) const { Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeScopedEnumIndex(engine, name, ok); + const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0; *ok = true; - d->initEnums(); + d->initEnums(cache); int *rv = d->scopedEnumIndex.value(name); if (rv) @@ -1101,11 +1069,10 @@ int QQmlType::scopedEnumIndex(QQmlEnginePrivate *engine, const QV4::String *name int QQmlType::scopedEnumIndex(QQmlEnginePrivate *engine, const QString &name, bool *ok) const { Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeScopedEnumIndex(engine, name, ok); + const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0; *ok = true; - d->initEnums(); + d->initEnums(cache); int *rv = d->scopedEnumIndex.value(name); if (rv) @@ -1117,9 +1084,8 @@ int QQmlType::scopedEnumIndex(QQmlEnginePrivate *engine, const QString &name, bo int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, int index, const QV4::String *name, bool *ok) const { + Q_UNUSED(engine) Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeScopedEnumValue(engine, index, name, ok); *ok = true; Q_ASSERT(index > -1 && index < d->scopedEnums.count()); @@ -1133,9 +1099,8 @@ int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, int index, const QV4::S int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, int index, const QString &name, bool *ok) const { + Q_UNUSED(engine) Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeScopedEnumValue(engine, index, name, ok); *ok = true; Q_ASSERT(index > -1 && index < d->scopedEnums.count()); @@ -1150,11 +1115,10 @@ int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, int index, const QStrin int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, const QByteArray &scopedEnumName, const QByteArray &name, bool *ok) const { Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeScopedEnumValue(engine, scopedEnumName, name, ok); + const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0; *ok = true; - d->initEnums(); + d->initEnums(cache); int *rv = d->scopedEnumIndex.value(QHashedCStringRef(scopedEnumName.constData(), scopedEnumName.length())); if (rv) { @@ -1172,11 +1136,10 @@ int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, const QByteArray &scope int QQmlType::scopedEnumValue(QQmlEnginePrivate *engine, const QStringRef &scopedEnumName, const QStringRef &name, bool *ok) const { Q_ASSERT(ok); - if (isComposite()) - return resolveCompositeScopedEnumValue(engine, scopedEnumName, name, ok); + const QQmlPropertyCache *cache = isComposite() ? compositePropertyCache(engine) : 0; *ok = true; - d->initEnums(); + d->initEnums(cache); int *rv = d->scopedEnumIndex.value(QHashedStringRef(scopedEnumName)); if (rv) { diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h index 4dd28bbd36..ead4f130ec 100644 --- a/src/qml/qml/qqmlmetatype_p.h +++ b/src/qml/qml/qqmlmetatype_p.h @@ -135,6 +135,7 @@ public: struct QQmlMetaTypeData; class QHashedCStringRef; +class QQmlPropertyCache; class Q_QML_PRIVATE_EXPORT QQmlType { public: @@ -227,13 +228,7 @@ public: private: QQmlType *superType() const; QQmlType *resolveCompositeBaseType(QQmlEnginePrivate *engine) const; - int resolveCompositeEnumValue(QQmlEnginePrivate *engine, const QString &name, bool *ok) const; - int resolveCompositeScopedEnumIndex(QQmlEnginePrivate *engine, const QV4::String *, bool *ok) const; - int resolveCompositeScopedEnumIndex(QQmlEnginePrivate *engine, const QString &name, bool *ok) const; - int resolveCompositeScopedEnumValue(QQmlEnginePrivate *engine, int index, const QV4::String *, bool *ok) const; - int resolveCompositeScopedEnumValue(QQmlEnginePrivate *engine, int index, const QString &name, bool *ok) const; - int resolveCompositeScopedEnumValue(QQmlEnginePrivate *engine, const QByteArray &scopedName, const QByteArray &name, bool *ok) const; - int resolveCompositeScopedEnumValue(QQmlEnginePrivate *engine, const QStringRef &scopedName, const QStringRef &name, bool *ok) const; + QQmlPropertyCache *compositePropertyCache(QQmlEnginePrivate *engine) const; friend class QQmlTypePrivate; friend struct QQmlMetaTypeData; diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index d18159841c..15b9fe8312 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -321,12 +321,13 @@ QQmlPropertyCache *QQmlPropertyCache::copy() } QQmlPropertyCache *QQmlPropertyCache::copyAndReserve(int propertyCount, int methodCount, - int signalCount) + int signalCount, int enumCount) { QQmlPropertyCache *rv = copy(propertyCount + methodCount + signalCount); rv->propertyIndexCache.reserve(propertyCount); rv->methodIndexCache.reserve(methodCount); rv->signalHandlerIndexCache.reserve(signalCount); + rv->enumCache.reserve(enumCount); rv->_metaObject = 0; return rv; @@ -421,6 +422,14 @@ void QQmlPropertyCache::appendMethod(const QString &name, QQmlPropertyData::Flag setNamedProperty(name, methodIndex + methodOffset(), methodIndexCache.data() + methodIndex, (old != 0)); } +void QQmlPropertyCache::appendEnum(const QString &name, const QVector &values) +{ + QQmlEnumData data; + data.name = name; + data.values = values; + enumCache.append(data); +} + // Returns this property cache's metaObject, creating it if necessary. const QMetaObject *QQmlPropertyCache::createMetaObject() { @@ -1245,6 +1254,16 @@ void QQmlPropertyCache::toMetaObjectBuilder(QMetaObjectBuilder &builder) method.setReturnType(returnType); } + for (int ii = 0; ii < enumCache.count(); ++ii) { + const QQmlEnumData &enumData = enumCache.at(ii); + QMetaEnumBuilder enumeration = builder.addEnumerator(enumData.name.toUtf8()); + enumeration.setIsScoped(true); + for (int jj = 0; jj < enumData.values.count(); ++jj) { + const QQmlEnumValue &value = enumData.values.at(jj); + enumeration.addKey(value.namedValue.toUtf8(), value.value); + } + } + if (!_defaultPropertyName.isEmpty()) { QQmlPropertyData *dp = property(_defaultPropertyName, 0, 0); if (dp && dp->coreIndex() >= propertyIndexCacheStart) { diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 64be1cb206..392768c1b1 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -349,6 +349,20 @@ private: bool notFullyResolved() const { return _flags.notFullyResolved; } }; +struct QQmlEnumValue +{ + QQmlEnumValue() : value(-1) {} + QQmlEnumValue(const QString &n, int v) : namedValue(n), value(v) {} + QString namedValue; + int value; +}; + +struct QQmlEnumData +{ + QString name; + QVector values; +}; + class QQmlPropertyCacheMethodArguments; class Q_QML_PRIVATE_EXPORT QQmlPropertyCache : public QQmlRefCount, public QQmlCleanup { @@ -374,13 +388,14 @@ public: QQmlPropertyRawData::Flags signalFlags = QQmlPropertyData::Flags()); QQmlPropertyCache *copyAndReserve(int propertyCount, - int methodCount, int signalCount); + int methodCount, int signalCount, int enumCount); void appendProperty(const QString &, QQmlPropertyRawData::Flags flags, int coreIndex, int propType, int notifyIndex); void appendSignal(const QString &, QQmlPropertyRawData::Flags, int coreIndex, const int *types = 0, const QList &names = QList()); void appendMethod(const QString &, QQmlPropertyData::Flags flags, int coreIndex, const QList &names = QList()); + void appendEnum(const QString &, const QVector &); const QMetaObject *metaObject() const; const QMetaObject *createMetaObject(); @@ -395,6 +410,7 @@ public: QQmlPropertyData *property(int) const; QQmlPropertyData *method(int) const; QQmlPropertyData *signal(int index) const; + QQmlEnumData *qmlEnum(int) const; int methodIndexToSignalIndex(int) const; QString defaultPropertyName() const; @@ -434,6 +450,7 @@ public: inline int methodOffset() const; inline int signalCount() const; inline int signalOffset() const; + inline int qmlEnumCount() const; static bool isDynamicMetaObject(const QMetaObject *); @@ -507,6 +524,7 @@ private: IndexCache signalHandlerIndexCache; StringCache stringCache; AllowedRevisionCache allowedRevisionCache; + QVector enumCache; bool _hasPropertyOverrides : 1; bool _ownMetaObject : 1; @@ -747,6 +765,14 @@ inline QQmlPropertyData *QQmlPropertyCache::signal(int index) const return ensureResolved(rv); } +inline QQmlEnumData *QQmlPropertyCache::qmlEnum(int index) const +{ + if (index < 0 || index >= enumCache.count()) + return 0; + + return const_cast(&enumCache.at(index)); +} + inline int QQmlPropertyCache::methodIndexToSignalIndex(int index) const { if (index < 0 || index >= (methodIndexCacheStart + methodIndexCache.count())) @@ -817,6 +843,11 @@ int QQmlPropertyCache::signalOffset() const return signalHandlerIndexCacheStart; } +int QQmlPropertyCache::qmlEnumCount() const +{ + return enumCache.count(); +} + bool QQmlPropertyCache::callJSFactoryMethod(QObject *object, void **args) const { if (_jsFactoryMethodIndex != -1) { diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index e4293596d8..151a7cd883 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -2651,6 +2651,10 @@ void QQmlTypeData::resolveTypes() m_resolvedTypes.insert(unresolvedRef.key(), ref); } + + // ### this allows enums to work without explicit import or instantiation of the type + if (!m_implicitImportLoaded) + loadImplicitImport(); } QQmlCompileError QQmlTypeData::buildTypeResolutionCaches( diff --git a/src/qml/qml/qqmltypenamecache.cpp b/src/qml/qml/qqmltypenamecache.cpp index c8e2b92c29..35ef8ada57 100644 --- a/src/qml/qml/qqmltypenamecache.cpp +++ b/src/qml/qml/qqmltypenamecache.cpp @@ -140,7 +140,7 @@ QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QHashedStringRef &name, return result; } -QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QV4::String *name) const +QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QV4::String *name, QQmlImport::RecursionRestriction recursionRestriction) const { Result result = query(m_namedImports, name); @@ -156,7 +156,7 @@ QQmlTypeNameCache::Result QQmlTypeNameCache::query(const QV4::String *name) cons QQmlImportNamespace *typeNamespace = 0; QList errors; QQmlType *t = 0; - bool typeFound = m_imports.resolveType(typeName, &t, 0, 0, &typeNamespace, &errors); + bool typeFound = m_imports.resolveType(typeName, &t, 0, 0, &typeNamespace, &errors, recursionRestriction); if (typeFound) { return Result(t); } diff --git a/src/qml/qml/qqmltypenamecache_p.h b/src/qml/qml/qqmltypenamecache_p.h index 7cdcbe91b6..f7ba2a91b7 100644 --- a/src/qml/qml/qqmltypenamecache_p.h +++ b/src/qml/qml/qqmltypenamecache_p.h @@ -90,7 +90,7 @@ public: }; Result query(const QHashedStringRef &) const; Result query(const QHashedStringRef &, const void *importNamespace) const; - Result query(const QV4::String *) const; + Result query(const QV4::String *, QQmlImport::RecursionRestriction recursionRestriction = QQmlImport::PreventRecursion) const; Result query(const QV4::String *, const void *importNamespace) const; private: -- cgit v1.2.3 From 61887379b0c823953b61120532055fcbd881aadd Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Jul 2017 14:39:45 +0200 Subject: Add support for QEvent::LanguageChange Respond to the language change event by refreshing all binding expressions. For constant string translation bindings we must now create special QQmlBinding instances instead of a one-time property write meta-call upon instantiation. Those however are more lightweight than an entire JavaScript expression. In addition this provides a slot to explicitly trigger a re-evaluation of bindings, to make it a little easier to discover for the developer. [ChangeLog][QtQml][QQmlEngine] Added retranslate() slot and QEvent::LanguageChange support to refresh bindings when changing the language at run-time. Task-number: QTBUG-15602 Change-Id: Ide174648e1d8a5738acb88e15495018d0869d7bc Reviewed-by: Michael Brasser --- src/qml/compiler/qv4compileddata_p.h | 3 ++- src/qml/qml/qqmlbinding.cpp | 46 +++++++++++++++++++++++++++++++- src/qml/qml/qqmlbinding_p.h | 2 ++ src/qml/qml/qqmlengine.cpp | 24 +++++++++++++++++ src/qml/qml/qqmlengine.h | 4 +++ src/qml/qml/qqmljavascriptexpression.cpp | 7 ++++- src/qml/qml/qqmljavascriptexpression_p.h | 2 ++ src/qml/qml/qqmlobjectcreator.cpp | 21 ++++++++------- src/qml/qml/qqmlobjectcreator_p.h | 2 +- 9 files changed, 97 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 386f3ae922..b28f77e6e6 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -361,7 +361,8 @@ struct Q_QML_PRIVATE_EXPORT Binding static QString escapedString(const QString &string); - bool evaluatesToString() const { return type == Type_String || type == Type_Translation || type == Type_TranslationById; } + bool containsTranslations() const { return type == Type_Translation || type == Type_TranslationById; } + bool evaluatesToString() const { return type == Type_String || containsTranslations(); } QString valueAsString(const Unit *unit) const; QString valueAsScriptString(const Unit *unit) const; diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 62288a5845..0ccb4e8e4e 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -195,7 +195,7 @@ class QQmlNonbindingBinding: public QQmlBinding { protected: void doUpdate(const DeleteWatcher &watcher, - QQmlPropertyData::WriteFlags flags, QV4::Scope &scope) Q_DECL_OVERRIDE Q_DECL_FINAL + QQmlPropertyData::WriteFlags flags, QV4::Scope &scope) Q_DECL_OVERRIDE { auto ep = QQmlEnginePrivate::get(scope.engine); ep->referenceScarceResources(); @@ -296,6 +296,50 @@ protected: } }; +class QQmlTranslationBinding : public GenericBinding { +public: + QQmlTranslationBinding(QV4::CompiledData::CompilationUnit *compilationUnit, const QV4::CompiledData::Binding *binding) + { + setCompilationUnit(compilationUnit); + m_binding = binding; + setSourceLocation(QQmlSourceLocation(compilationUnit->fileName(), binding->valueLocation.line, binding->valueLocation.column)); + } + + void doUpdate(const DeleteWatcher &watcher, + QQmlPropertyData::WriteFlags flags, QV4::Scope &) Q_DECL_OVERRIDE Q_DECL_FINAL + { + if (watcher.wasDeleted()) + return; + + if (!isAddedToObject() || hasError()) + return; + + const QString result = m_binding->valueAsString(m_compilationUnit->data); + + Q_ASSERT(targetObject()); + + QQmlPropertyData *pd; + QQmlPropertyData vpd; + getPropertyData(&pd, &vpd); + Q_ASSERT(pd); + doStore(result, pd, flags); + } + +private: + const QV4::CompiledData::Binding *m_binding; +}; + +QQmlBinding *QQmlBinding::createTranslationBinding(QV4::CompiledData::CompilationUnit *unit, const QV4::CompiledData::Binding *binding, QObject *obj, QQmlContextData *ctxt) +{ + QQmlTranslationBinding *b = new QQmlTranslationBinding(unit, binding); + + b->setNotifyOnValueChanged(true); + b->QQmlJavaScriptExpression::setContext(ctxt); + b->setScopeObject(obj); + + return b; +} + Q_NEVER_INLINE bool QQmlBinding::slowWrite(const QQmlPropertyData &core, const QQmlPropertyData &valueTypeData, const QV4::Value &result, diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h index 0f2fb329f5..1c894148e4 100644 --- a/src/qml/qml/qqmlbinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -77,6 +77,8 @@ public: const QString &url = QString(), quint16 lineNumber = 0); static QQmlBinding *create(const QQmlPropertyData *property, QV4::Function *function, QObject *obj, QQmlContextData *ctxt, QV4::ExecutionContext *scope); + static QQmlBinding *createTranslationBinding(QV4::CompiledData::CompilationUnit *unit, const QV4::CompiledData::Binding *binding, + QObject *obj, QQmlContextData *ctxt); ~QQmlBinding(); void setTarget(const QQmlProperty &); diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index c0cabe4dd0..38a2978712 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1327,6 +1327,27 @@ void QQmlEngine::setOutputWarningsToStandardError(bool enabled) d->outputWarningsToMsgLog = enabled; } +/*! + Refreshes all binding expressions that use strings marked for translation. + + Call this function after you have installed a new translator with + QCoreApplication::installTranslator, to ensure that your user-interface + shows up-to-date translations. + + \note Due to a limitation in the implementation, this function + refreshes all the engine's bindings, not only those that use strings + marked for translation. + This may be optimized in a future release. + + \since 5.10 +*/ +void QQmlEngine::retranslate() +{ + Q_D(QQmlEngine); + if (QQmlContextData *firstChildContext = QQmlContextData::get(d->rootContext)->childContexts) + firstChildContext->refreshExpressions(); +} + /*! Returns the QQmlContext for the \a object, or 0 if no context has been set. @@ -1447,6 +1468,9 @@ bool QQmlEngine::event(QEvent *e) Q_D(QQmlEngine); if (e->type() == QEvent::User) d->doDeleteInEngineThread(); + else if (e->type() == QEvent::LanguageChange) { + retranslate(); + } return QJSEngine::event(e); } diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h index 8cada954fe..2bf4c0497b 100644 --- a/src/qml/qml/qqmlengine.h +++ b/src/qml/qml/qqmlengine.h @@ -144,6 +144,10 @@ public: bool outputWarningsToStandardError() const; void setOutputWarningsToStandardError(bool); +public Q_SLOTS: + void retranslate(); + +public: static QQmlContext *contextForObject(const QObject *); static void setContextForObject(QObject *, QQmlContext *); diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 9587b3961f..214cfff6b2 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -461,7 +461,12 @@ void QQmlJavaScriptExpression::setupFunction(QV4::ExecutionContext *qmlContext, return; m_qmlScope.set(qmlContext->engine(), *qmlContext); m_v4Function = f; - m_compilationUnit = m_v4Function->compilationUnit; + setCompilationUnit(m_v4Function->compilationUnit); +} + +void QQmlJavaScriptExpression::setCompilationUnit(QV4::CompiledData::CompilationUnit *compilationUnit) +{ + m_compilationUnit = compilationUnit; } void QQmlJavaScriptExpression::clearActiveGuards() diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h index 646cc5ab3d..b540959331 100644 --- a/src/qml/qml/qqmljavascriptexpression_p.h +++ b/src/qml/qml/qqmljavascriptexpression_p.h @@ -160,11 +160,13 @@ protected: } void setupFunction(QV4::ExecutionContext *qmlContext, QV4::Function *f); + void setCompilationUnit(QV4::CompiledData::CompilationUnit *compilationUnit); private: friend class QQmlContextData; friend class QQmlPropertyCapture; friend void QQmlJavaScriptExpressionGuard_callback(QQmlNotifierEndpoint *, void **); + friend class QQmlTranslationBinding; QQmlDelayedError *m_error; diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index b73cbaa563..9206395c8f 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -801,17 +801,13 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con && !_valueTypeProperty) QQmlPropertyPrivate::removeBinding(_bindingTarget, QQmlPropertyIndex(property->coreIndex())); - if (binding->type == QV4::CompiledData::Binding::Type_Script) { - QV4::Function *runtimeFunction = compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex]; - - QV4::Scope scope(v4); - QV4::Scoped qmlContext(scope, currentQmlContext()); - + if (binding->type == QV4::CompiledData::Binding::Type_Script || binding->containsTranslations()) { if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression) { + QV4::Function *runtimeFunction = compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex]; int signalIndex = _propertyCache->methodIndexToSignalIndex(property->coreIndex()); QQmlBoundSignal *bs = new QQmlBoundSignal(_bindingTarget, signalIndex, _scopeObject, engine); QQmlBoundSignalExpression *expr = new QQmlBoundSignalExpression(_bindingTarget, signalIndex, - context, _scopeObject, runtimeFunction, qmlContext); + context, _scopeObject, runtimeFunction, currentQmlContext()); bs->takeExpression(expr); } else { @@ -827,7 +823,12 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con prop = _valueTypeProperty; subprop = property; } - qmlBinding = QQmlBinding::create(prop, runtimeFunction, _scopeObject, context, qmlContext); + if (binding->containsTranslations()) { + qmlBinding = QQmlBinding::createTranslationBinding(compilationUnit, binding, _scopeObject, context); + } else { + QV4::Function *runtimeFunction = compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex]; + qmlBinding = QQmlBinding::create(prop, runtimeFunction, _scopeObject, context, currentQmlContext()); + } qmlBinding->setTarget(_bindingTarget, *prop, subprop); sharedState->allCreatedBindings.push(QQmlAbstractBinding::Ptr(qmlBinding)); @@ -1026,12 +1027,12 @@ void QQmlObjectCreator::registerObjectWithContextById(const QV4::CompiledData::O context->setIdProperty(object->id, instance); } -QV4::Heap::QmlContext *QQmlObjectCreator::currentQmlContext() +QV4::QmlContext *QQmlObjectCreator::currentQmlContext() { if (!_qmlContext->isManaged()) _qmlContext->setM(QV4::QmlContext::create(v4->rootContext(), context, _scopeObject)); - return _qmlContext->d(); + return _qmlContext; } QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isContextObject) diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h index 982324be3c..45c14f0963 100644 --- a/src/qml/qml/qqmlobjectcreator_p.h +++ b/src/qml/qml/qqmlobjectcreator_p.h @@ -122,7 +122,7 @@ private: void registerObjectWithContextById(const QV4::CompiledData::Object *object, QObject *instance) const; - QV4::Heap::QmlContext *currentQmlContext(); + QV4::QmlContext *currentQmlContext(); enum Phase { Startup, -- cgit v1.2.3 From 5d072dbb583050fe9338ca65e1c2b159c3f77692 Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Fri, 14 Jul 2017 12:16:03 +0200 Subject: Software Adaptation: Fix nested clipping logic Task-number: QTBUG-61939 Change-Id: Ibb7f242241df0a7a418ab4f268487e72d5595622 Reviewed-by: Eirik Aavitsland --- .../adaptations/software/qsgsoftwarerenderablenodeupdater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp index 4937565aa9..666f1d0616 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp @@ -83,7 +83,7 @@ void QSGSoftwareRenderableNodeUpdater::endVisit(QSGTransformNode *) bool QSGSoftwareRenderableNodeUpdater::visit(QSGClipNode *node) { // Make sure to translate the clip rect into world coordinates - if (m_clipState.count() == 1) { + if (m_clipState.count() == 0 || m_clipState.top().isNull()) { m_clipState.push(m_transformState.top().map(QRegion(node->clipRect().toRect()))); m_hasClip = true; } else { @@ -97,7 +97,7 @@ bool QSGSoftwareRenderableNodeUpdater::visit(QSGClipNode *node) void QSGSoftwareRenderableNodeUpdater::endVisit(QSGClipNode *) { m_clipState.pop(); - if (m_clipState.count() == 1) + if (m_clipState.count() == 0 || m_clipState.top().isNull()) m_hasClip = false; } -- cgit v1.2.3 From fd1612d9b640fa80c49d3de17f8707318df6640c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 17 Jul 2017 11:26:19 +0200 Subject: QQuickWindowQmlImpl: declare attached properties in the header QQuickWindowQmlImpl is inherited by QQuickApplicationWindow in Qt Quick Controls 2, which must register revisions (qmlRegisterRevision) in base classes to make revisioned base class members available in AppWindow. The fact that QQuickWindowQmlImpl provides attached properties must be declared in the header so that qmlRegisterRevision in Qt Quick Controls 2 does not lose the Window-attached properties. Task-number: QTBUG-61935 Change-Id: I634c8fe980b06279610953d9ded2c27d8627d5ea Reviewed-by: Simon Hausmann --- src/quick/items/qquickwindowmodule.cpp | 2 -- src/quick/items/qquickwindowmodule_p.h | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickwindowmodule.cpp b/src/quick/items/qquickwindowmodule.cpp index a5234d4f77..c1cc02568c 100644 --- a/src/quick/items/qquickwindowmodule.cpp +++ b/src/quick/items/qquickwindowmodule.cpp @@ -204,6 +204,4 @@ void QQuickWindowModule::defineModule() QT_END_NAMESPACE -QML_DECLARE_TYPEINFO(QQuickWindowQmlImpl, QML_HAS_ATTACHED_PROPERTIES) - #include "moc_qquickwindowmodule_p.cpp" diff --git a/src/quick/items/qquickwindowmodule_p.h b/src/quick/items/qquickwindowmodule_p.h index 16130bc8a0..869d5b9a8e 100644 --- a/src/quick/items/qquickwindowmodule_p.h +++ b/src/quick/items/qquickwindowmodule_p.h @@ -54,10 +54,10 @@ #include #include #include +#include QT_BEGIN_NAMESPACE -class QQuickWindowAttached; class QQuickWindowQmlImplPrivate; class Q_QUICK_PRIVATE_EXPORT QQuickWindowQmlImpl : public QQuickWindow, public QQmlParserStatus @@ -105,4 +105,7 @@ public: QT_END_NAMESPACE +QML_DECLARE_TYPE(QQuickWindowQmlImpl) +QML_DECLARE_TYPEINFO(QQuickWindowQmlImpl, QML_HAS_ATTACHED_PROPERTIES) + #endif -- cgit v1.2.3 From 9dc9424d1873b1bc3b5ed056d4dda7f6c76e15ae Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Jul 2017 09:44:05 +0200 Subject: Fix linking if apps using QQmlPropertyMap when using version scripts Avoid the use of the QObject constructor that takes a QObjectPrivate in the inline QQmlPropertyMap constructor. Task-number: QTBUG-46433 Change-Id: I62e3c80e28334ce5a4c3d2249abfada45a8dccb3 Reviewed-by: Thiago Macieira --- src/qml/util/qqmlpropertymap.cpp | 12 +++--------- src/qml/util/qqmlpropertymap.h | 6 ++---- 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/qml/util/qqmlpropertymap.cpp b/src/qml/util/qqmlpropertymap.cpp index 6e6554f2c3..b54e8d901a 100644 --- a/src/qml/util/qqmlpropertymap.cpp +++ b/src/qml/util/qqmlpropertymap.cpp @@ -186,9 +186,8 @@ int QQmlPropertyMapMetaObject::createProperty(const char *name, const char *valu Constructs a bindable map with parent object \a parent. */ QQmlPropertyMap::QQmlPropertyMap(QObject *parent) -: QObject(*allocatePrivate(), parent) +: QQmlPropertyMap(&staticMetaObject, parent) { - init(metaObject()); } /*! @@ -339,18 +338,13 @@ QVariant QQmlPropertyMap::updateValue(const QString &key, const QVariant &input) } /*! \internal */ -void QQmlPropertyMap::init(const QMetaObject *staticMetaObject) +QQmlPropertyMap::QQmlPropertyMap(const QMetaObject *staticMetaObject, QObject *parent) + : QObject(*(new QQmlPropertyMapPrivate), parent) { Q_D(QQmlPropertyMap); d->mo = new QQmlPropertyMapMetaObject(this, d, staticMetaObject); } -/*! \internal */ -QObjectPrivate *QQmlPropertyMap::allocatePrivate() -{ - return new QQmlPropertyMapPrivate; -} - /*! \fn void QQmlPropertyMap::valueChanged(const QString &key, const QVariant &value) This signal is emitted whenever one of the values in the map is changed. \a key diff --git a/src/qml/util/qqmlpropertymap.h b/src/qml/util/qqmlpropertymap.h index 01048f3662..8c5ecce48e 100644 --- a/src/qml/util/qqmlpropertymap.h +++ b/src/qml/util/qqmlpropertymap.h @@ -80,15 +80,13 @@ protected: template QQmlPropertyMap(DerivedType *derived, QObject *parentObj) - : QObject(*allocatePrivate(), parentObj) + : QQmlPropertyMap(&DerivedType::staticMetaObject, parentObj) { Q_UNUSED(derived) - init(&DerivedType::staticMetaObject); } private: - void init(const QMetaObject *staticMetaObject); - static QObjectPrivate *allocatePrivate(); + QQmlPropertyMap(const QMetaObject *staticMetaObject, QObject *parent); Q_DECLARE_PRIVATE(QQmlPropertyMap) Q_DISABLE_COPY(QQmlPropertyMap) -- cgit v1.2.3 From 65e52acf4027c6c6731942e8a67f8e30e26c9655 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 18 Jul 2017 16:17:23 +0200 Subject: Export QQuickWindowAttached fd1612d9 broke the qqc2 build: error: undefined reference to 'QQuickWindowAttached::staticMetaObject' Change-Id: Ia52f0e124fa81fecdee0ed006837a93636aa9622 Reviewed-by: Simon Hausmann --- src/quick/items/qquickwindowattached_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickwindowattached_p.h b/src/quick/items/qquickwindowattached_p.h index 3212508fd8..191f22137c 100644 --- a/src/quick/items/qquickwindowattached_p.h +++ b/src/quick/items/qquickwindowattached_p.h @@ -51,6 +51,7 @@ // We mean it. // +#include #include #include @@ -59,7 +60,7 @@ QT_BEGIN_NAMESPACE class QQuickItem; class QQuickWindow; -class Q_AUTOTEST_EXPORT QQuickWindowAttached : public QObject +class Q_QUICK_PRIVATE_EXPORT QQuickWindowAttached : public QObject { Q_OBJECT -- cgit v1.2.3 From 6b8695dbdbb381566c28d5d10d9de14e8eb99205 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 22 Jul 2017 13:13:39 -0700 Subject: Use __builtin_trap in GCC too It has had that for longer than Clang has existed. Change-Id: I84e45059a888497fb55ffffd14d3c03160312537 Reviewed-by: Simon Hausmann --- src/3rdparty/masm/wtf/Assertions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/3rdparty/masm/wtf/Assertions.h b/src/3rdparty/masm/wtf/Assertions.h index af65f5325c..491e434498 100644 --- a/src/3rdparty/masm/wtf/Assertions.h +++ b/src/3rdparty/masm/wtf/Assertions.h @@ -167,7 +167,7 @@ WTF_EXPORT_PRIVATE void WTFInstallReportBacktraceOnCrashHook(); Signals are ignored by the crash reporter on OS X so we must do better. */ #ifndef CRASH -#if COMPILER(CLANG) +#if COMPILER(CLANG) || COMPILER(GCC) #define CRASH() \ (WTFReportBacktrace(), \ WTFInvokeCrashHook(), \ -- cgit v1.2.3 From a51e7963e9a5b2a35c982e77f636ac4ca9a8cbc4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 24 Jul 2017 13:53:58 +0200 Subject: Ensure same glyph cache is used for same font at different sizes This was fixed in Qt 5.9.0 by 9921b48c83490b450241d6c172f1375ab4efb6b1, but refactoring caused this change to be lost. This is just porting the fix to the refactored class hierarchy. Task-number: QTBUG-60696 Change-Id: I4f95cc7bdd49580ae623a03a7f9cc5242599b6c2 Reviewed-by: Robin Burchell --- src/quick/scenegraph/qsgcontext_p.h | 2 +- src/quick/scenegraph/qsgdefaultrendercontext.cpp | 25 ++++++++++++++++++++++-- src/quick/scenegraph/qsgdefaultrendercontext_p.h | 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h index 6ff8f4a76e..84a2523f26 100644 --- a/src/quick/scenegraph/qsgcontext_p.h +++ b/src/quick/scenegraph/qsgcontext_p.h @@ -194,7 +194,7 @@ protected: QMutex m_mutex; QHash m_textures; QSet m_texturesToDelete; - QHash m_glyphCaches; + QHash m_glyphCaches; QSet m_fontEnginesToClean; }; diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp index 29600ef0ca..34bb554db6 100644 --- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp +++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp @@ -271,6 +271,26 @@ void QSGDefaultRenderContext::compileShader(QSGMaterialShader *shader, QSGMateri } } +QString QSGDefaultRenderContext::fontKey(const QRawFont &font) +{ + QFontEngine *fe = QRawFontPrivate::get(font)->fontEngine; + if (!fe->faceId().filename.isEmpty()) { + QByteArray keyName = fe->faceId().filename; + if (font.style() != QFont::StyleNormal) + keyName += QByteArray(" I"); + if (font.weight() != QFont::Normal) + keyName += ' ' + QByteArray::number(font.weight()); + keyName += QByteArray(" DF"); + return QString::fromUtf8(keyName); + } else { + return QString::fromLatin1("%1_%2_%3_%4") + .arg(font.familyName()) + .arg(font.styleName()) + .arg(font.weight()) + .arg(font.style()); + } +} + void QSGDefaultRenderContext::initializeShader(QSGMaterialShader *shader) { shader->program()->bind(); @@ -293,10 +313,11 @@ QT_END_NAMESPACE QSGDistanceFieldGlyphCache *QSGDefaultRenderContext::distanceFieldGlyphCache(const QRawFont &font) { - QSGDistanceFieldGlyphCache *cache = m_glyphCaches.value(font, 0); + QString key = fontKey(font); + QSGDistanceFieldGlyphCache *cache = m_glyphCaches.value(key, 0); if (!cache) { cache = new QSGDefaultDistanceFieldGlyphCache(openglContext(), font); - m_glyphCaches.insert(font, cache); + m_glyphCaches.insert(key, cache); } return cache; diff --git a/src/quick/scenegraph/qsgdefaultrendercontext_p.h b/src/quick/scenegraph/qsgdefaultrendercontext_p.h index 0aed46b658..2537a06988 100644 --- a/src/quick/scenegraph/qsgdefaultrendercontext_p.h +++ b/src/quick/scenegraph/qsgdefaultrendercontext_p.h @@ -96,6 +96,8 @@ public: int maxTextureSize() const override { return m_maxTextureSize; } protected: + static QString fontKey(const QRawFont &font); + QOpenGLContext *m_gl; QSGDepthStencilBufferManager *m_depthStencilManager; int m_maxTextureSize; -- cgit v1.2.3 From a2db480db51748b381f18987790b5f2de8c0c911 Mon Sep 17 00:00:00 2001 From: Berthold Krevert Date: Sun, 16 Jul 2017 21:43:05 +0200 Subject: Check for GL_NV_path_rendering extension If resolving of glProgramPathFragmentInput fails, the nvpr renderer should not report that it is supported, so that the shape item can fallback to the geometry renderer. Task-number: QTBUG-61913 Change-Id: I0795b1dedc330432884d5214ee2492c757055a54 Reviewed-by: Laszlo Agocs --- src/imports/shapes/qquicknvprfunctions.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/qquicknvprfunctions.cpp b/src/imports/shapes/qquicknvprfunctions.cpp index 0b92d4b4c0..409a59be7f 100644 --- a/src/imports/shapes/qquicknvprfunctions.cpp +++ b/src/imports/shapes/qquicknvprfunctions.cpp @@ -87,6 +87,8 @@ QSurfaceFormat QQuickNvprFunctions::format() return fmt; } +#define PROC(type, name) reinterpret_cast(ctx->getProcAddress(#name)) + /*! \return true if GL_NV_path_rendering is supported with the current OpenGL context. @@ -114,6 +116,10 @@ bool QQuickNvprFunctions::isSupported() if (!ctx->hasExtension(QByteArrayLiteral("GL_NV_path_rendering"))) return false; + // Check that GL_NV_Path_rendering extension is at least API revision 1.3 + if (!PROC(PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC, glProgramPathFragmentInputGenNV)) + return false; + // Do not check for DSA as the string may not be exposed on ES // drivers, yet the functions we need are resolvable. #if 0 @@ -199,8 +205,6 @@ bool QQuickNvprFunctions::createFragmentOnlyPipeline(const char *fragmentShaderS return true; } -#define PROC(type, name) reinterpret_cast(ctx->getProcAddress(#name)) - bool QQuickNvprFunctionsPrivate::resolve() { QOpenGLContext *ctx = QOpenGLContext::currentContext(); -- cgit v1.2.3 From 9c515a6de24bc8d5709136cc099ceeae8e3e642c Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 25 Jul 2017 13:14:21 +0200 Subject: Do not (dis)connectNotify on dynamically created model item objects These item objects are direct subclasses of QObject, and cannot override connectNotify/disconnectNotify. This prevents the creation of the backing QMetaObject during disconnect, which happens during destruction, which in turn will call back into the model that is being destroyed. Task-number: QTBUG-59704 Change-Id: I7f997e5d2fda242b38e67b9147224d72aa4508ba Reviewed-by: Simon Hausmann --- src/qml/qml/qqmljavascriptexpression.cpp | 4 ++-- src/qml/qml/qqmljavascriptexpression_p.h | 2 +- src/qml/qml/qqmlnotifier.cpp | 9 ++++++--- src/qml/qml/qqmlnotifier_p.h | 10 ++++++---- src/qml/types/qqmllistmodel.cpp | 10 +++------- 5 files changed, 18 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 9d4e46e254..eec5d1ae57 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -283,7 +283,7 @@ void QQmlPropertyCapture::captureProperty(QQmlNotifier *n, Duration duration) \a n is in the signal index range (see QObjectPrivate::signalIndex()). */ -void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, Duration duration) +void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, Duration duration, bool doNotify) { if (watcher->wasDeleted()) return; @@ -319,7 +319,7 @@ void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, Duration dur Q_ASSERT(g->isConnected(o, n)); } else { g = QQmlJavaScriptExpressionGuard::New(expression, engine); - g->connect(o, n, engine); + g->connect(o, n, engine, doNotify); } if (duration == Permanently) diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h index 646cc5ab3d..eeed272793 100644 --- a/src/qml/qml/qqmljavascriptexpression_p.h +++ b/src/qml/qml/qqmljavascriptexpression_p.h @@ -204,7 +204,7 @@ public: static void registerQmlDependencies(const QV4::CompiledData::Function *compiledFunction, const QV4::Scope &scope); void captureProperty(QQmlNotifier *, Duration duration = OnlyOnce); - void captureProperty(QObject *, int, int, Duration duration = OnlyOnce); + void captureProperty(QObject *, int, int, Duration duration = OnlyOnce, bool doNotify = true); QQmlEngine *engine; QQmlJavaScriptExpression *expression; diff --git a/src/qml/qml/qqmlnotifier.cpp b/src/qml/qml/qqmlnotifier.cpp index 538ca822ee..938e2b77e2 100644 --- a/src/qml/qml/qqmlnotifier.cpp +++ b/src/qml/qml/qqmlnotifier.cpp @@ -117,7 +117,7 @@ void QQmlNotifier::emitNotify(QQmlNotifierEndpoint *endpoint, void **a) \a sourceSignal MUST be in the signal index range (see QObjectPrivate::signalIndex()). This is different from QMetaMethod::methodIndex(). */ -void QQmlNotifierEndpoint::connect(QObject *source, int sourceSignal, QQmlEngine *engine) +void QQmlNotifierEndpoint::connect(QObject *source, int sourceSignal, QQmlEngine *engine, bool doNotify) { disconnect(); @@ -142,8 +142,11 @@ void QQmlNotifierEndpoint::connect(QObject *source, int sourceSignal, QQmlEngine QQmlPropertyPrivate::flushSignal(source, sourceSignal); QQmlData *ddata = QQmlData::get(source, true); ddata->addNotify(sourceSignal, this); - QObjectPrivate * const priv = QObjectPrivate::get(source); - priv->connectNotify(QMetaObjectPrivate::signal(source->metaObject(), sourceSignal)); + if (doNotify) { + needsConnectNotify = doNotify; + QObjectPrivate * const priv = QObjectPrivate::get(source); + priv->connectNotify(QMetaObjectPrivate::signal(source->metaObject(), sourceSignal)); + } } QT_END_NAMESPACE diff --git a/src/qml/qml/qqmlnotifier_p.h b/src/qml/qml/qqmlnotifier_p.h index dad79e0e55..6e91369793 100644 --- a/src/qml/qml/qqmlnotifier_p.h +++ b/src/qml/qml/qqmlnotifier_p.h @@ -100,7 +100,7 @@ public: inline bool isConnected(QObject *source, int sourceSignal) const; inline bool isConnected(QQmlNotifier *) const; - void connect(QObject *source, int sourceSignal, QQmlEngine *engine); + void connect(QObject *source, int sourceSignal, QQmlEngine *engine, bool doNotify = true); inline void connect(QQmlNotifier *); inline void disconnect(); @@ -121,9 +121,10 @@ private: inline QQmlNotifier *senderAsNotifier() const; Callback callback:4; + int needsConnectNotify:1; // The index is in the range returned by QObjectPrivate::signalIndex(). // This is different from QMetaMethod::methodIndex(). - signed int sourceSignal:28; + signed int sourceSignal:27; }; QQmlNotifier::QQmlNotifier() @@ -155,7 +156,7 @@ void QQmlNotifier::notify() } QQmlNotifierEndpoint::QQmlNotifierEndpoint(Callback callback) -: next(0), prev(0), senderPtr(0), callback(callback), sourceSignal(-1) +: next(0), prev(0), senderPtr(0), callback(callback), needsConnectNotify(false), sourceSignal(-1) { } @@ -205,7 +206,8 @@ void QQmlNotifierEndpoint::disconnect() if (sourceSignal != -1) { QObject * const obj = senderAsObject(); QObjectPrivate * const priv = QObjectPrivate::get(obj); - priv->disconnectNotify(QMetaObjectPrivate::signal(obj->metaObject(), sourceSignal)); + if (needsConnectNotify) + priv->disconnectNotify(QMetaObjectPrivate::signal(obj->metaObject(), sourceSignal)); } if (isNotifying()) *((qintptr *)(senderPtr & ~0x1)) = 0; diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index 4d8f213284..9d0f1afb32 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -1361,13 +1361,9 @@ ReturnedValue ModelObject::get(const Managed *m, String *name, bool *hasProperty if (QQmlEngine *qmlEngine = that->engine()->qmlEngine()) { QQmlEnginePrivate *ep = QQmlEnginePrivate::get(qmlEngine); - if (ep && ep->propertyCapture) { - QObjectPrivate *op = QObjectPrivate::get(that->object()); - // Temporarily hide the dynamic meta-object, to prevent it from being created when the capture - // triggers a QObject::connectNotify() by calling obj->metaObject(). - QScopedValueRollback metaObjectBlocker(op->metaObject, 0); - ep->propertyCapture->captureProperty(that->object(), -1, role->index); - } + if (ep && ep->propertyCapture) + ep->propertyCapture->captureProperty(that->object(), -1, role->index, + QQmlPropertyCapture::OnlyOnce, false); } const int elementIndex = that->d()->m_elementIndex; -- cgit v1.2.3 From 264989606420f940cdab14f3f39362b9c82c3885 Mon Sep 17 00:00:00 2001 From: Wieland Hagen Date: Tue, 25 Jul 2017 12:46:38 +0200 Subject: Fix QQuickFramebufferObject::Renderer::invalidateFramebufferObject() invalidateFramebufferObject() sets the invalidatePending flag, which should then trigger the deletion of the old FBO and allocation via Renderer::createFramebufferObject(). This does only happen though, if the size has changed. Instead, always create a new FBO if invalidateFramebufferObject() has been called, regardless of whether the size changes or not. Change-Id: I849cb858afac89038343457c6362233c34956d58 Task-number: QTBUG-54434 Reviewed-by: Laszlo Agocs --- src/quick/items/qquickframebufferobject.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp index 3c00e956cc..042ee21aec 100644 --- a/src/quick/items/qquickframebufferobject.cpp +++ b/src/quick/items/qquickframebufferobject.cpp @@ -312,14 +312,12 @@ QSGNode *QQuickFramebufferObject::updatePaintNode(QSGNode *node, UpdatePaintNode n->devicePixelRatio = window()->effectiveDevicePixelRatio(); desiredFboSize *= n->devicePixelRatio; - if (n->fbo && (d->followsItemSize || n->invalidatePending)) { - if (n->fbo->size() != desiredFboSize) { - delete n->fbo; - n->fbo = 0; - delete n->msDisplayFbo; - n->msDisplayFbo = 0; - n->invalidatePending = false; - } + if (n->fbo && ((d->followsItemSize && n->fbo->size() != desiredFboSize) || n->invalidatePending)) { + delete n->fbo; + n->fbo = 0; + delete n->msDisplayFbo; + n->msDisplayFbo = 0; + n->invalidatePending = false; } if (!n->fbo) { -- cgit v1.2.3 From 39061af50cc3092289cdd71d17802139590ecb59 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 24 Jul 2017 15:00:37 +0200 Subject: Fix memory leak in QSGAtlasTexture::Manager::create() Parent the Atlas to the manager. Task-number: QTBUG-61754 Change-Id: Ida8b0622d1dbcaafa622f72a1d210969fa61d5bf Reviewed-by: Laszlo Agocs --- src/quick/scenegraph/util/qsgatlastexture.cpp | 7 ++++--- src/quick/scenegraph/util/qsgatlastexture_p.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index 22f0b13f46..d5f836a525 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -116,7 +116,7 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel) Texture *t = 0; if (image.width() < m_atlas_size_limit && image.height() < m_atlas_size_limit) { if (!m_atlas) - m_atlas = new Atlas(m_atlas_size); + m_atlas = new Atlas(m_atlas_size, this); // t may be null for atlas allocation failure t = m_atlas->create(image); if (t && !hasAlphaChannel && t->hasAlphaChannel()) @@ -125,8 +125,9 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel) return t; } -Atlas::Atlas(const QSize &size) - : m_allocator(size) +Atlas::Atlas(const QSize &size, QObject *parent) + : QObject(parent) + , m_allocator(size) , m_texture_id(0) , m_size(size) , m_atlas_transient_image_threshold(0) diff --git a/src/quick/scenegraph/util/qsgatlastexture_p.h b/src/quick/scenegraph/util/qsgatlastexture_p.h index 3dee539547..0bb07e8e89 100644 --- a/src/quick/scenegraph/util/qsgatlastexture_p.h +++ b/src/quick/scenegraph/util/qsgatlastexture_p.h @@ -88,7 +88,7 @@ private: class Atlas : public QObject { public: - Atlas(const QSize &size); + Atlas(const QSize &size, QObject *parent); ~Atlas(); void invalidate(); -- cgit v1.2.3 From 5952cb93cc93702124aaa5dec938581b0312761a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 24 Jul 2017 12:56:48 +0200 Subject: Fix compilation with namespace I am not sure why this hasn't failed in CI, but the function is declared inside the namespace, so the definition needs to go in there as well. Seems to be a merge error all the way back to 5.8. Change-Id: Iedd25d3e9e756c55cc302da90bab11535bdc1b01 Reviewed-by: Simon Hausmann --- src/quick/scenegraph/qsgdefaultrendercontext.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp index e42979934e..b343f89cc0 100644 --- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp +++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp @@ -289,9 +289,6 @@ QSGDefaultRenderContext *QSGDefaultRenderContext::from(QOpenGLContext *context) return qobject_cast(context->property(QSG_RENDERCONTEXT_PROPERTY).value()); } -QT_END_NAMESPACE - - QSGDistanceFieldGlyphCache *QSGDefaultRenderContext::distanceFieldGlyphCache(const QRawFont &font) { if (!m_distanceFieldCacheManager) @@ -306,4 +303,6 @@ QSGDistanceFieldGlyphCache *QSGDefaultRenderContext::distanceFieldGlyphCache(con return cache; } +QT_END_NAMESPACE + #include "moc_qsgdefaultrendercontext_p.cpp" -- cgit v1.2.3 From ed90226834f8d4ef76149e995e2aecff68e4df43 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 26 Jul 2017 12:13:03 +0200 Subject: Fix loading of QML plugins with old IID in static builds After commit 709f6370884b110def2e4665df8fa7bbf5fae734 we required the use of QQmlExtensionInterface_iid in qml plugins for static linkage. This mean that plugins using the "/1.0" variant would also continue to load, but those not would fail to load. This is annoying when porting apps from older Qt versions. To make the upgrade path easier, let's just support both IIDs. [ChangeLog][Qml] Fix loading of static qml plugins using the old plugin interface id Change-Id: I1c662b1fedad3f32b7dea1eddc32838d2eb9f3be Reviewed-by: J-P Nurmi --- src/qml/qml/qqmlextensioninterface.h | 3 +++ src/qml/qml/qqmlimport.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/qml/qml/qqmlextensioninterface.h b/src/qml/qml/qqmlextensioninterface.h index ef56d5e312..62b9b26569 100644 --- a/src/qml/qml/qqmlextensioninterface.h +++ b/src/qml/qml/qqmlextensioninterface.h @@ -66,7 +66,10 @@ public: Q_DECLARE_INTERFACE(QQmlTypesExtensionInterface, "org.qt-project.Qt.QQmlTypesExtensionInterface/1.0") +// NOTE: When changing this to a new version and deciding to add backup code to +// continue to support the previous version, make sure to support both of these iids. #define QQmlExtensionInterface_iid "org.qt-project.Qt.QQmlExtensionInterface/1.0" +#define QQmlExtensionInterface_iid_old "org.qt-project.Qt.QQmlExtensionInterface" Q_DECLARE_INTERFACE(QQmlExtensionInterface, QQmlExtensionInterface_iid) diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index ee5b38717b..ec748d1ca9 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -966,8 +966,8 @@ static QVector makePlugins() // the list the first time called to only contain QML plugins: const auto staticPlugins = QPluginLoader::staticPlugins(); for (const QStaticPlugin &plugin : staticPlugins) { - if (plugin.metaData().value(QLatin1String("IID")).toString() - == QLatin1String(QQmlExtensionInterface_iid)) { + const QString iid = plugin.metaData().value(QLatin1String("IID")).toString(); + if (iid == QLatin1String(QQmlExtensionInterface_iid) || iid == QLatin1String(QQmlExtensionInterface_iid_old)) { plugins.append(plugin); } } -- cgit v1.2.3 From bb199cc8ad4111808260f6255312b08c7d81dcbc Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 4 Mar 2016 11:34:59 +0100 Subject: QQuickTextInput: Don't move the cursor after internalInsert() has done so internalInsert() will set the cursor to the right position which accounts for any input mask set on the control as well. Therefore it will already be placed at the next correct position and should not be changed again after that. Task-number: QTBUG-40943 Change-Id: Ic80193ee94d2aa002b5a14a88df719a5a2cf51b1 Reviewed-by: Mitch Curtis --- src/quick/items/qquicktextinput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index a378359c95..43899ba457 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -3407,10 +3407,10 @@ void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event) if (!event->commitString().isEmpty()) { internalInsert(event->commitString()); cursorPositionChanged = true; + } else { + m_cursor = qBound(0, c, m_text.length()); } - m_cursor = qBound(0, c, m_text.length()); - for (int i = 0; i < event->attributes().size(); ++i) { const QInputMethodEvent::Attribute &a = event->attributes().at(i); if (a.type == QInputMethodEvent::Selection) { -- cgit v1.2.3 From 08569a0981308f2d3c164d89aa4a00f321fd8e21 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 27 Jul 2017 11:47:28 +0200 Subject: QJSEngine: document limitation of dynamic QObject properties Dynamic QObject properties can not be accessed through C++ (via QJSValue) nor JavaScript. Task-number: QTBUG-38181 Change-Id: I78bb9898fef615a647234ae8df444e8855870258 Reviewed-by: Simon Hausmann --- src/qml/doc/snippets/code/src_script_qjsengine.cpp | 13 +++++++++++++ src/qml/jsapi/qjsengine.cpp | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/doc/snippets/code/src_script_qjsengine.cpp b/src/qml/doc/snippets/code/src_script_qjsengine.cpp index c9bd7dfcd9..0305574d34 100644 --- a/src/qml/doc/snippets/code/src_script_qjsengine.cpp +++ b/src/qml/doc/snippets/code/src_script_qjsengine.cpp @@ -91,3 +91,16 @@ myEngine.evaluate("button.checkable = true"); qDebug() << scriptButton.property("checkable").toBool(); scriptButton.property("show").call(); // call the show() slot //! [5] + + +//! [6] +QJSEngine engine; + +QObject *myQObject = new QObject(); +myQObject->setProperty("dynamicProperty", 3); + +QJSValue myScriptQObject = engine.newQObject(myQObject); +engine.globalObject().setProperty("myObject", myScriptQObject); + +qDebug() << engine.evaluate("myObject.dynamicProperty").toInt(); +//! [6] diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index e4c150057a..c678f8037a 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -175,9 +175,14 @@ Q_DECLARE_METATYPE(QList) called from the script to create a new QObject instance with JavaScriptOwnership. + \snippet code/src_script_qjsengine.cpp 5 + \section2 Dynamic QObject Properties - \snippet code/src_script_qjsengine.cpp 5 + Dynamic QObject properties are not supported. For example, the following code + will not work: + + \snippet code/src_script_qjsengine.cpp 6 \section1 Extensions -- cgit v1.2.3 From 50bc2ac834502b2051dccaaec22da010a3ef5e70 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Wed, 26 Jul 2017 17:28:43 +0200 Subject: Add QDebugStateSaver to operator<<(QDebug, const QSGRootNode) CID 54558 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE) 4. end_of_path: Changing format state of stream d for category basefield without later restoring it. Coverity-Id: 54558 Change-Id: Iad6e6103684c57d3ab98e78e7c91e23731632913 Reviewed-by: Simon Hausmann --- src/quick/scenegraph/coreapi/qsgnode.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index e400928d4e..264b30b897 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -1582,6 +1582,7 @@ QDebug operator<<(QDebug d, const QSGRootNode *n) d << "RootNode(null)"; return d; } + QDebugStateSaver saver(d); d << "RootNode" << hex << (const void *) n << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); #ifdef QSG_RUNTIME_DESCRIPTION d << QSGNodePrivate::description(n); -- cgit v1.2.3 From ce5436a9a07b5593529afc0a259e55d5c716e41c Mon Sep 17 00:00:00 2001 From: Berthold Krevert Date: Thu, 27 Jul 2017 20:09:01 +0200 Subject: Rename property to rendererType This follows the documentation. Change-Id: I74d8d2b45546717c6a6b252af9370c6670ef1b78 Reviewed-by: Laszlo Agocs --- src/imports/shapes/plugins.qmltypes | 2 +- src/imports/shapes/qquickshape_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/plugins.qmltypes b/src/imports/shapes/plugins.qmltypes index c7c079991d..b8a7c532e0 100644 --- a/src/imports/shapes/plugins.qmltypes +++ b/src/imports/shapes/plugins.qmltypes @@ -31,7 +31,7 @@ Module { "Processing": 2 } } - Property { name: "renderer"; type: "RendererType"; isReadonly: true } + Property { name: "rendererType"; type: "RendererType"; isReadonly: true } Property { name: "asynchronous"; type: "bool" } Property { name: "vendorExtensionsEnabled"; type: "bool" } Property { name: "status"; type: "Status"; isReadonly: true } diff --git a/src/imports/shapes/qquickshape_p.h b/src/imports/shapes/qquickshape_p.h index db0b449c6c..3a630aacbc 100644 --- a/src/imports/shapes/qquickshape_p.h +++ b/src/imports/shapes/qquickshape_p.h @@ -223,7 +223,7 @@ private: class QQuickShape : public QQuickItem { Q_OBJECT - Q_PROPERTY(RendererType renderer READ rendererType NOTIFY rendererChanged) + Q_PROPERTY(RendererType rendererType READ rendererType NOTIFY rendererChanged) Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged) Q_PROPERTY(bool vendorExtensionsEnabled READ vendorExtensionsEnabled WRITE setVendorExtensionsEnabled NOTIFY vendorExtensionsEnabledChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) -- cgit v1.2.3 From 5e8347fdbab98d721f031634a9f6c8b217072d34 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 28 Jul 2017 11:54:44 +0200 Subject: Move shapes-related shaders to under the shapes plugin Do not leave them in quick/items' qrc. Change-Id: I12360a54caa368219a7a80645f92af66aa9de9ba Reviewed-by: Mitch Curtis --- src/imports/shapes/plugin.cpp | 1 + src/imports/shapes/qquickshapegenericrenderer.cpp | 4 ++-- src/imports/shapes/qquickshapenvprrenderer.cpp | 8 ++++---- src/imports/shapes/shaders/blit.frag | 9 +++++++++ src/imports/shapes/shaders/blit.vert | 12 ++++++++++++ src/imports/shapes/shaders/blit_core.frag | 13 +++++++++++++ src/imports/shapes/shaders/blit_core.vert | 14 ++++++++++++++ src/imports/shapes/shaders/lineargradient.frag | 9 +++++++++ src/imports/shapes/shaders/lineargradient.vert | 15 +++++++++++++++ src/imports/shapes/shaders/lineargradient_core.frag | 12 ++++++++++++ src/imports/shapes/shaders/lineargradient_core.vert | 17 +++++++++++++++++ src/imports/shapes/shapes.pro | 2 ++ src/imports/shapes/shapes.qrc | 12 ++++++++++++ src/quick/items/items.qrc | 4 ---- src/quick/items/shaders/lineargradient.frag | 9 --------- src/quick/items/shaders/lineargradient.vert | 15 --------------- src/quick/items/shaders/lineargradient_core.frag | 12 ------------ src/quick/items/shaders/lineargradient_core.vert | 17 ----------------- 18 files changed, 122 insertions(+), 63 deletions(-) create mode 100644 src/imports/shapes/shaders/blit.frag create mode 100644 src/imports/shapes/shaders/blit.vert create mode 100644 src/imports/shapes/shaders/blit_core.frag create mode 100644 src/imports/shapes/shaders/blit_core.vert create mode 100644 src/imports/shapes/shaders/lineargradient.frag create mode 100644 src/imports/shapes/shaders/lineargradient.vert create mode 100644 src/imports/shapes/shaders/lineargradient_core.frag create mode 100644 src/imports/shapes/shaders/lineargradient_core.vert create mode 100644 src/imports/shapes/shapes.qrc delete mode 100644 src/quick/items/shaders/lineargradient.frag delete mode 100644 src/quick/items/shaders/lineargradient.vert delete mode 100644 src/quick/items/shaders/lineargradient_core.frag delete mode 100644 src/quick/items/shaders/lineargradient_core.vert (limited to 'src') diff --git a/src/imports/shapes/plugin.cpp b/src/imports/shapes/plugin.cpp index ae0d02da93..1729fc88b4 100644 --- a/src/imports/shapes/plugin.cpp +++ b/src/imports/shapes/plugin.cpp @@ -47,6 +47,7 @@ static void initResources() #ifdef QT_STATIC Q_INIT_RESOURCE(qmake_QtQuick_Shapes); #endif + Q_INIT_RESOURCE(shapes); } QT_BEGIN_NAMESPACE diff --git a/src/imports/shapes/qquickshapegenericrenderer.cpp b/src/imports/shapes/qquickshapegenericrenderer.cpp index ca5f2a0e91..41bab83582 100644 --- a/src/imports/shapes/qquickshapegenericrenderer.cpp +++ b/src/imports/shapes/qquickshapegenericrenderer.cpp @@ -703,9 +703,9 @@ QSGMaterialType QQuickShapeLinearGradientShader::type; QQuickShapeLinearGradientShader::QQuickShapeLinearGradientShader() { setShaderSourceFile(QOpenGLShader::Vertex, - QStringLiteral(":/qt-project.org/items/shaders/lineargradient.vert")); + QStringLiteral(":/qt-project.org/shapes/shaders/lineargradient.vert")); setShaderSourceFile(QOpenGLShader::Fragment, - QStringLiteral(":/qt-project.org/items/shaders/lineargradient.frag")); + QStringLiteral(":/qt-project.org/shapes/shaders/lineargradient.frag")); } void QQuickShapeLinearGradientShader::initialize() diff --git a/src/imports/shapes/qquickshapenvprrenderer.cpp b/src/imports/shapes/qquickshapenvprrenderer.cpp index f3f8d807ec..57306a4d53 100644 --- a/src/imports/shapes/qquickshapenvprrenderer.cpp +++ b/src/imports/shapes/qquickshapenvprrenderer.cpp @@ -835,11 +835,11 @@ bool QQuickNvprBlitter::create() m_program = new QOpenGLShaderProgram; if (QOpenGLContext::currentContext()->format().profile() == QSurfaceFormat::CoreProfile) { - m_program->addCacheableShaderFromSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/items/shaders/shadereffect_core.vert")); - m_program->addCacheableShaderFromSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/items/shaders/shadereffect_core.frag")); + m_program->addCacheableShaderFromSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/shapes/shaders/blit_core.vert")); + m_program->addCacheableShaderFromSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/shapes/shaders/blit_core.frag")); } else { - m_program->addCacheableShaderFromSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/items/shaders/shadereffect.vert")); - m_program->addCacheableShaderFromSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/items/shaders/shadereffect.frag")); + m_program->addCacheableShaderFromSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/shapes/shaders/blit.vert")); + m_program->addCacheableShaderFromSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/shapes/shaders/blit.frag")); } m_program->bindAttributeLocation("qt_Vertex", 0); m_program->bindAttributeLocation("qt_MultiTexCoord0", 1); diff --git a/src/imports/shapes/shaders/blit.frag b/src/imports/shapes/shaders/blit.frag new file mode 100644 index 0000000000..505f0db179 --- /dev/null +++ b/src/imports/shapes/shaders/blit.frag @@ -0,0 +1,9 @@ +varying highp vec2 qt_TexCoord0; + +uniform sampler2D source; +uniform lowp float qt_Opacity; + +void main() +{ + gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity; +} diff --git a/src/imports/shapes/shaders/blit.vert b/src/imports/shapes/shaders/blit.vert new file mode 100644 index 0000000000..f8306bd945 --- /dev/null +++ b/src/imports/shapes/shaders/blit.vert @@ -0,0 +1,12 @@ +uniform highp mat4 qt_Matrix; + +attribute highp vec4 qt_Vertex; +attribute highp vec2 qt_MultiTexCoord0; + +varying highp vec2 qt_TexCoord0; + +void main() +{ + qt_TexCoord0 = qt_MultiTexCoord0; + gl_Position = qt_Matrix * qt_Vertex; +} diff --git a/src/imports/shapes/shaders/blit_core.frag b/src/imports/shapes/shaders/blit_core.frag new file mode 100644 index 0000000000..7073808fba --- /dev/null +++ b/src/imports/shapes/shaders/blit_core.frag @@ -0,0 +1,13 @@ +#version 150 core + +in vec2 qt_TexCoord0; + +out vec4 fragColor; + +uniform sampler2D source; +uniform float qt_Opacity; + +void main() +{ + fragColor = texture(source, qt_TexCoord0) * qt_Opacity; +} diff --git a/src/imports/shapes/shaders/blit_core.vert b/src/imports/shapes/shaders/blit_core.vert new file mode 100644 index 0000000000..5246441da3 --- /dev/null +++ b/src/imports/shapes/shaders/blit_core.vert @@ -0,0 +1,14 @@ +#version 150 core + +in vec4 qt_Vertex; +in vec2 qt_MultiTexCoord0; + +out vec2 qt_TexCoord0; + +uniform mat4 qt_Matrix; + +void main() +{ + qt_TexCoord0 = qt_MultiTexCoord0; + gl_Position = qt_Matrix * qt_Vertex; +} diff --git a/src/imports/shapes/shaders/lineargradient.frag b/src/imports/shapes/shaders/lineargradient.frag new file mode 100644 index 0000000000..7f4a739109 --- /dev/null +++ b/src/imports/shapes/shaders/lineargradient.frag @@ -0,0 +1,9 @@ +uniform sampler2D gradTabTexture; +uniform highp float opacity; + +varying highp float gradTabIndex; + +void main() +{ + gl_FragColor = texture2D(gradTabTexture, vec2(gradTabIndex, 0.5)) * opacity; +} diff --git a/src/imports/shapes/shaders/lineargradient.vert b/src/imports/shapes/shaders/lineargradient.vert new file mode 100644 index 0000000000..eb21b8886b --- /dev/null +++ b/src/imports/shapes/shaders/lineargradient.vert @@ -0,0 +1,15 @@ +attribute vec4 vertexCoord; +attribute vec4 vertexColor; + +uniform mat4 matrix; +uniform vec2 gradStart; +uniform vec2 gradEnd; + +varying float gradTabIndex; + +void main() +{ + vec2 gradVec = gradEnd - gradStart; + gradTabIndex = dot(gradVec, vertexCoord.xy - gradStart) / (gradVec.x * gradVec.x + gradVec.y * gradVec.y); + gl_Position = matrix * vertexCoord; +} diff --git a/src/imports/shapes/shaders/lineargradient_core.frag b/src/imports/shapes/shaders/lineargradient_core.frag new file mode 100644 index 0000000000..5908acfa67 --- /dev/null +++ b/src/imports/shapes/shaders/lineargradient_core.frag @@ -0,0 +1,12 @@ +#version 150 core + +uniform sampler2D gradTabTexture; +uniform float opacity; + +in float gradTabIndex; +out vec4 fragColor; + +void main() +{ + fragColor = texture(gradTabTexture, vec2(gradTabIndex, 0.5)) * opacity; +} diff --git a/src/imports/shapes/shaders/lineargradient_core.vert b/src/imports/shapes/shaders/lineargradient_core.vert new file mode 100644 index 0000000000..60b56f38e3 --- /dev/null +++ b/src/imports/shapes/shaders/lineargradient_core.vert @@ -0,0 +1,17 @@ +#version 150 core + +in vec4 vertexCoord; +in vec4 vertexColor; + +uniform mat4 matrix; +uniform vec2 gradStart; +uniform vec2 gradEnd; + +out float gradTabIndex; + +void main() +{ + vec2 gradVec = gradEnd - gradStart; + gradTabIndex = dot(gradVec, vertexCoord.xy - gradStart) / (gradVec.x * gradVec.x + gradVec.y * gradVec.y); + gl_Position = matrix * vertexCoord; +} diff --git a/src/imports/shapes/shapes.pro b/src/imports/shapes/shapes.pro index 80e6a22142..4406474c3f 100644 --- a/src/imports/shapes/shapes.pro +++ b/src/imports/shapes/shapes.pro @@ -28,4 +28,6 @@ qtConfig(opengl) { qquickshapenvprrenderer.cpp } +RESOURCES += shapes.qrc + load(qml_plugin) diff --git a/src/imports/shapes/shapes.qrc b/src/imports/shapes/shapes.qrc new file mode 100644 index 0000000000..65ee2007f9 --- /dev/null +++ b/src/imports/shapes/shapes.qrc @@ -0,0 +1,12 @@ + + + shaders/blit.vert + shaders/blit.frag + shaders/blit_core.frag + shaders/blit_core.vert + shaders/lineargradient.vert + shaders/lineargradient.frag + shaders/lineargradient_core.vert + shaders/lineargradient_core.frag + + diff --git a/src/quick/items/items.qrc b/src/quick/items/items.qrc index da9bf0c828..6aaf757c29 100644 --- a/src/quick/items/items.qrc +++ b/src/quick/items/items.qrc @@ -8,9 +8,5 @@ shaders/shadereffect_core.vert shaders/shadereffectfallback_core.frag shaders/shadereffectfallback_core.vert - shaders/lineargradient.vert - shaders/lineargradient.frag - shaders/lineargradient_core.vert - shaders/lineargradient_core.frag diff --git a/src/quick/items/shaders/lineargradient.frag b/src/quick/items/shaders/lineargradient.frag deleted file mode 100644 index 7f4a739109..0000000000 --- a/src/quick/items/shaders/lineargradient.frag +++ /dev/null @@ -1,9 +0,0 @@ -uniform sampler2D gradTabTexture; -uniform highp float opacity; - -varying highp float gradTabIndex; - -void main() -{ - gl_FragColor = texture2D(gradTabTexture, vec2(gradTabIndex, 0.5)) * opacity; -} diff --git a/src/quick/items/shaders/lineargradient.vert b/src/quick/items/shaders/lineargradient.vert deleted file mode 100644 index eb21b8886b..0000000000 --- a/src/quick/items/shaders/lineargradient.vert +++ /dev/null @@ -1,15 +0,0 @@ -attribute vec4 vertexCoord; -attribute vec4 vertexColor; - -uniform mat4 matrix; -uniform vec2 gradStart; -uniform vec2 gradEnd; - -varying float gradTabIndex; - -void main() -{ - vec2 gradVec = gradEnd - gradStart; - gradTabIndex = dot(gradVec, vertexCoord.xy - gradStart) / (gradVec.x * gradVec.x + gradVec.y * gradVec.y); - gl_Position = matrix * vertexCoord; -} diff --git a/src/quick/items/shaders/lineargradient_core.frag b/src/quick/items/shaders/lineargradient_core.frag deleted file mode 100644 index 5908acfa67..0000000000 --- a/src/quick/items/shaders/lineargradient_core.frag +++ /dev/null @@ -1,12 +0,0 @@ -#version 150 core - -uniform sampler2D gradTabTexture; -uniform float opacity; - -in float gradTabIndex; -out vec4 fragColor; - -void main() -{ - fragColor = texture(gradTabTexture, vec2(gradTabIndex, 0.5)) * opacity; -} diff --git a/src/quick/items/shaders/lineargradient_core.vert b/src/quick/items/shaders/lineargradient_core.vert deleted file mode 100644 index 60b56f38e3..0000000000 --- a/src/quick/items/shaders/lineargradient_core.vert +++ /dev/null @@ -1,17 +0,0 @@ -#version 150 core - -in vec4 vertexCoord; -in vec4 vertexColor; - -uniform mat4 matrix; -uniform vec2 gradStart; -uniform vec2 gradEnd; - -out float gradTabIndex; - -void main() -{ - vec2 gradVec = gradEnd - gradStart; - gradTabIndex = dot(gradVec, vertexCoord.xy - gradStart) / (gradVec.x * gradVec.x + gradVec.y * gradVec.y); - gl_Position = matrix * vertexCoord; -} -- cgit v1.2.3 From e26ac7911613cb9c572b81820e427fbd0a5874f6 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 31 Jul 2017 14:59:04 +0200 Subject: shapes: Rip out more JS API leftovers None of the removed code is ever hit in practice since the public JS API has been removed some time ago. Let's follow it up with removing the internal details since such an API is not going to come back in the near future. Change-Id: I721ab296a7a2acb3a5f61ce705da7aa66d3ad765 Reviewed-by: Mitch Curtis --- src/imports/shapes/qquickshape.cpp | 134 +++++---------------- src/imports/shapes/qquickshape_p_p.h | 103 +++------------- src/imports/shapes/qquickshapegenericrenderer.cpp | 7 -- src/imports/shapes/qquickshapegenericrenderer_p.h | 1 - src/imports/shapes/qquickshapenvprrenderer.cpp | 84 ------------- src/imports/shapes/qquickshapenvprrenderer_p.h | 2 - src/imports/shapes/qquickshapesoftwarerenderer.cpp | 8 -- src/imports/shapes/qquickshapesoftwarerenderer_p.h | 1 - 8 files changed, 49 insertions(+), 291 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/qquickshape.cpp b/src/imports/shapes/qquickshape.cpp index 3d90ca0c1f..b8a138507a 100644 --- a/src/imports/shapes/qquickshape.cpp +++ b/src/imports/shapes/qquickshape.cpp @@ -77,50 +77,6 @@ QQuickShapeStrokeFillParams::QQuickShapeStrokeFillParams() dashPattern << 4 << 2; // 4 * strokeWidth dash followed by 2 * strokeWidth space } -QPainterPath QQuickShapePathCommands::toPainterPath() const -{ - QPainterPath p; - int coordIdx = 0; - for (int i = 0; i < cmd.count(); ++i) { - switch (cmd[i]) { - case QQuickShapePathCommands::MoveTo: - p.moveTo(coords[coordIdx], coords[coordIdx + 1]); - coordIdx += 2; - break; - case QQuickShapePathCommands::LineTo: - p.lineTo(coords[coordIdx], coords[coordIdx + 1]); - coordIdx += 2; - break; - case QQuickShapePathCommands::QuadTo: - p.quadTo(coords[coordIdx], coords[coordIdx + 1], - coords[coordIdx + 2], coords[coordIdx + 3]); - coordIdx += 4; - break; - case QQuickShapePathCommands::CubicTo: - p.cubicTo(coords[coordIdx], coords[coordIdx + 1], - coords[coordIdx + 2], coords[coordIdx + 3], - coords[coordIdx + 4], coords[coordIdx + 5]); - coordIdx += 6; - break; - case QQuickShapePathCommands::ArcTo: - // does not map to the QPainterPath API; reuse the helper code from QQuickSvgParser - QQuickSvgParser::pathArc(p, - coords[coordIdx], coords[coordIdx + 1], // radius - coords[coordIdx + 2], // xAxisRotation - !qFuzzyIsNull(coords[coordIdx + 6]), // useLargeArc - !qFuzzyIsNull(coords[coordIdx + 5]), // sweep flag - coords[coordIdx + 3], coords[coordIdx + 4], // end - p.currentPosition().x(), p.currentPosition().y()); - coordIdx += 7; - break; - default: - qWarning("Unknown JS path command: %d", cmd[i]); - break; - } - } - return p; -} - /*! \qmltype ShapePath \instantiates QQuickShapePath @@ -815,7 +771,7 @@ static void vpe_append(QQmlListProperty *property, QObject *obj) QQuickShapePrivate *d = QQuickShapePrivate::get(item); QQuickShapePath *path = qobject_cast(obj); if (path) - d->qmlData.sp.append(path); + d->sp.append(path); QQuickItemPrivate::data_append(property, obj); @@ -830,10 +786,10 @@ static void vpe_clear(QQmlListProperty *property) QQuickShape *item = static_cast(property->object); QQuickShapePrivate *d = QQuickShapePrivate::get(item); - for (QQuickShapePath *p : d->qmlData.sp) + for (QQuickShapePath *p : d->sp) QObject::disconnect(p, SIGNAL(shapePathChanged()), item, SLOT(_q_shapePathChanged())); - d->qmlData.sp.clear(); + d->sp.clear(); QQuickItemPrivate::data_clear(property); @@ -872,7 +828,7 @@ void QQuickShape::componentComplete() QQuickItem::componentComplete(); - for (QQuickShapePath *p : d->qmlData.sp) + for (QQuickShapePath *p : d->sp) connect(p, SIGNAL(shapePathChanged()), this, SLOT(_q_shapePathChanged())); d->_q_shapePathChanged(); @@ -1010,65 +966,37 @@ void QQuickShapePrivate::sync() renderer->setAsyncCallback(q_asyncShapeReady, this); } - if (!jsData.isValid()) { - // Standard route: The path and stroke/fill parameters are provided via - // QML elements. - const int count = qmlData.sp.count(); - renderer->beginSync(count); - - for (int i = 0; i < count; ++i) { - QQuickShapePath *p = qmlData.sp[i]; - int &dirty(QQuickShapePathPrivate::get(p)->dirty); - - if (dirty & QQuickShapePathPrivate::DirtyPath) - renderer->setPath(i, p); - if (dirty & QQuickShapePathPrivate::DirtyStrokeColor) - renderer->setStrokeColor(i, p->strokeColor()); - if (dirty & QQuickShapePathPrivate::DirtyStrokeWidth) - renderer->setStrokeWidth(i, p->strokeWidth()); - if (dirty & QQuickShapePathPrivate::DirtyFillColor) - renderer->setFillColor(i, p->fillColor()); - if (dirty & QQuickShapePathPrivate::DirtyFillRule) - renderer->setFillRule(i, p->fillRule()); - if (dirty & QQuickShapePathPrivate::DirtyStyle) { - renderer->setJoinStyle(i, p->joinStyle(), p->miterLimit()); - renderer->setCapStyle(i, p->capStyle()); - } - if (dirty & QQuickShapePathPrivate::DirtyDash) - renderer->setStrokeStyle(i, p->strokeStyle(), p->dashOffset(), p->dashPattern()); - if (dirty & QQuickShapePathPrivate::DirtyFillGradient) - renderer->setFillGradient(i, p->fillGradient()); - - dirty = 0; - } - - renderer->endSync(useAsync); - } else { - - // ### there is no public API to reach this code path atm - Q_UNREACHABLE(); - - // Path and stroke/fill params provided from JavaScript. This avoids - // QObjects at the expense of not supporting changes afterwards. - const int count = jsData.paths.count(); - renderer->beginSync(count); - - for (int i = 0; i < count; ++i) { - renderer->setJSPath(i, jsData.paths[i]); - const QQuickShapeStrokeFillParams sfp(jsData.sfp[i]); - renderer->setStrokeColor(i, sfp.strokeColor); - renderer->setStrokeWidth(i, sfp.strokeWidth); - renderer->setFillColor(i, sfp.fillColor); - renderer->setFillRule(i, sfp.fillRule); - renderer->setJoinStyle(i, sfp.joinStyle, sfp.miterLimit); - renderer->setCapStyle(i, sfp.capStyle); - renderer->setStrokeStyle(i, sfp.strokeStyle, sfp.dashOffset, sfp.dashPattern); - renderer->setFillGradient(i, sfp.fillGradient); + const int count = sp.count(); + renderer->beginSync(count); + + for (int i = 0; i < count; ++i) { + QQuickShapePath *p = sp[i]; + int &dirty(QQuickShapePathPrivate::get(p)->dirty); + + if (dirty & QQuickShapePathPrivate::DirtyPath) + renderer->setPath(i, p); + if (dirty & QQuickShapePathPrivate::DirtyStrokeColor) + renderer->setStrokeColor(i, p->strokeColor()); + if (dirty & QQuickShapePathPrivate::DirtyStrokeWidth) + renderer->setStrokeWidth(i, p->strokeWidth()); + if (dirty & QQuickShapePathPrivate::DirtyFillColor) + renderer->setFillColor(i, p->fillColor()); + if (dirty & QQuickShapePathPrivate::DirtyFillRule) + renderer->setFillRule(i, p->fillRule()); + if (dirty & QQuickShapePathPrivate::DirtyStyle) { + renderer->setJoinStyle(i, p->joinStyle(), p->miterLimit()); + renderer->setCapStyle(i, p->capStyle()); } + if (dirty & QQuickShapePathPrivate::DirtyDash) + renderer->setStrokeStyle(i, p->strokeStyle(), p->dashOffset(), p->dashPattern()); + if (dirty & QQuickShapePathPrivate::DirtyFillGradient) + renderer->setFillGradient(i, p->fillGradient()); - renderer->endSync(useAsync); + dirty = 0; } + renderer->endSync(useAsync); + if (!useAsync) setStatus(QQuickShape::Ready); } diff --git a/src/imports/shapes/qquickshape_p_p.h b/src/imports/shapes/qquickshape_p_p.h index dc62994af2..6ca752de56 100644 --- a/src/imports/shapes/qquickshape_p_p.h +++ b/src/imports/shapes/qquickshape_p_p.h @@ -62,39 +62,6 @@ QT_BEGIN_NAMESPACE class QSGPlainTexture; -struct QQuickShapePathCommands -{ - enum Command { - MoveTo, - LineTo, - QuadTo, - CubicTo, - ArcTo - }; - - QVector cmd; - QVector coords; - - QPainterPath toPainterPath() const; -}; - -struct QQuickShapeStrokeFillParams -{ - QQuickShapeStrokeFillParams(); - - QColor strokeColor; - qreal strokeWidth; - QColor fillColor; - QQuickShapePath::FillRule fillRule; - QQuickShapePath::JoinStyle joinStyle; - int miterLimit; - QQuickShapePath::CapStyle capStyle; - QQuickShapePath::StrokeStyle strokeStyle; - qreal dashOffset; - QVector dashPattern; - QQuickShapeGradient *fillGradient; -}; - class QQuickAbstractPathRenderer { public: @@ -110,11 +77,7 @@ public: virtual void endSync(bool async) = 0; virtual void setAsyncCallback(void (*)(void *), void *) { } virtual Flags flags() const { return 0; } - // - QML API virtual void setPath(int index, const QQuickPath *path) = 0; - // - JS API - virtual void setJSPath(int index, const QQuickShapePathCommands &path) = 0; - // - stroke/fill parameters virtual void setStrokeColor(int index, const QColor &color) = 0; virtual void setStrokeWidth(int index, qreal w) = 0; virtual void setFillColor(int index, const QColor &color) = 0; @@ -131,6 +94,23 @@ public: Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickAbstractPathRenderer::Flags) +struct QQuickShapeStrokeFillParams +{ + QQuickShapeStrokeFillParams(); + + QColor strokeColor; + qreal strokeWidth; + QColor fillColor; + QQuickShapePath::FillRule fillRule; + QQuickShapePath::JoinStyle joinStyle; + int miterLimit; + QQuickShapePath::CapStyle capStyle; + QQuickShapePath::StrokeStyle strokeStyle; + qreal dashOffset; + QVector dashPattern; + QQuickShapeGradient *fillGradient; +}; + class QQuickShapePathPrivate : public QQuickPathPrivate { Q_DECLARE_PUBLIC(QQuickShapePath) @@ -182,57 +162,10 @@ public: bool async; QQuickShape::Status status; QQuickAbstractPathRenderer *renderer; - - struct { - QVector sp; - } qmlData; - - struct { - bool isValid() const { Q_ASSERT(paths.count() == sfp.count()); return !paths.isEmpty(); } - QVector paths; - QVector sfp; - } jsData; - + QVector sp; bool enableVendorExts; }; -class QQuickShapePathObject : public QObject -{ - Q_OBJECT - -public: - QQuickShapePathObject(QObject *parent = nullptr) : QObject(parent) { } - - void setV4Engine(QV4::ExecutionEngine *engine); - QV4::ReturnedValue v4value() const { return m_v4value.value(); } - - QQuickShapePath path; - - void clear(); - -private: - QV4::PersistentValue m_v4value; -}; - -class QQuickShapeStrokeFillParamsObject : public QObject -{ - Q_OBJECT - -public: - QQuickShapeStrokeFillParamsObject(QObject *parent = nullptr) : QObject(parent) { } - - void setV4Engine(QV4::ExecutionEngine *engine); - QV4::ReturnedValue v4value() const { return m_v4value.value(); } - - QQuickShapeStrokeFillParams sfp; - QV4::PersistentValue v4fillGradient; - - void clear(); - -private: - QV4::PersistentValue m_v4value; -}; - #if QT_CONFIG(opengl) class QQuickShapeGradientCache : public QOpenGLSharedResource diff --git a/src/imports/shapes/qquickshapegenericrenderer.cpp b/src/imports/shapes/qquickshapegenericrenderer.cpp index 41bab83582..398106af3d 100644 --- a/src/imports/shapes/qquickshapegenericrenderer.cpp +++ b/src/imports/shapes/qquickshapegenericrenderer.cpp @@ -178,13 +178,6 @@ void QQuickShapeGenericRenderer::setPath(int index, const QQuickPath *path) d.syncDirty |= DirtyFillGeom | DirtyStrokeGeom; } -void QQuickShapeGenericRenderer::setJSPath(int index, const QQuickShapePathCommands &path) -{ - ShapePathData &d(m_sp[index]); - d.path = path.toPainterPath(); - d.syncDirty |= DirtyFillGeom | DirtyStrokeGeom; -} - void QQuickShapeGenericRenderer::setStrokeColor(int index, const QColor &color) { ShapePathData &d(m_sp[index]); diff --git a/src/imports/shapes/qquickshapegenericrenderer_p.h b/src/imports/shapes/qquickshapegenericrenderer_p.h index 1f36e3decf..dadeba3467 100644 --- a/src/imports/shapes/qquickshapegenericrenderer_p.h +++ b/src/imports/shapes/qquickshapegenericrenderer_p.h @@ -88,7 +88,6 @@ public: void beginSync(int totalCount) override; void setPath(int index, const QQuickPath *path) override; - void setJSPath(int index, const QQuickShapePathCommands &path) override; void setStrokeColor(int index, const QColor &color) override; void setStrokeWidth(int index, qreal w) override; void setFillColor(int index, const QColor &color) override; diff --git a/src/imports/shapes/qquickshapenvprrenderer.cpp b/src/imports/shapes/qquickshapenvprrenderer.cpp index 57306a4d53..4f49bb5256 100644 --- a/src/imports/shapes/qquickshapenvprrenderer.cpp +++ b/src/imports/shapes/qquickshapenvprrenderer.cpp @@ -62,14 +62,6 @@ void QQuickShapeNvprRenderer::setPath(int index, const QQuickPath *path) m_accDirty |= DirtyPath; } -void QQuickShapeNvprRenderer::setJSPath(int index, const QQuickShapePathCommands &path) -{ - ShapePathGuiData &d(m_sp[index]); - convertJSPath(path, &d); - d.dirty |= DirtyPath; - m_accDirty |= DirtyPath; -} - void QQuickShapeNvprRenderer::setStrokeColor(int index, const QColor &color) { ShapePathGuiData &d(m_sp[index]); @@ -296,82 +288,6 @@ void QQuickShapeNvprRenderer::convertPath(const QQuickPath *path, ShapePathGuiDa d->path.cmd.append(GL_CLOSE_PATH_NV); } -void QQuickShapeNvprRenderer::convertJSPath(const QQuickShapePathCommands &path, ShapePathGuiData *d) -{ - d->path = NvprPath(); - if (path.cmd.isEmpty()) - return; - - QPointF startPos(0, 0); - QPointF pos(startPos); - int coordIdx = 0; - - for (QQuickShapePathCommands::Command cmd : path.cmd) { - switch (cmd) { - case QQuickShapePathCommands::MoveTo: - d->path.cmd.append(GL_MOVE_TO_NV); - pos = QPointF(path.coords[coordIdx], path.coords[coordIdx + 1]); - startPos = pos; - d->path.coord.append(pos.x()); - d->path.coord.append(pos.y()); - coordIdx += 2; - break; - case QQuickShapePathCommands::LineTo: - d->path.cmd.append(GL_LINE_TO_NV); - pos = QPointF(path.coords[coordIdx], path.coords[coordIdx + 1]); - d->path.coord.append(pos.x()); - d->path.coord.append(pos.y()); - coordIdx += 2; - break; - case QQuickShapePathCommands::QuadTo: - d->path.cmd.append(GL_QUADRATIC_CURVE_TO_NV); - d->path.coord.append(path.coords[coordIdx]); - d->path.coord.append(path.coords[coordIdx + 1]); - pos = QPointF(path.coords[coordIdx + 2], path.coords[coordIdx + 3]); - d->path.coord.append(pos.x()); - d->path.coord.append(pos.y()); - coordIdx += 4; - break; - case QQuickShapePathCommands::CubicTo: - d->path.cmd.append(GL_CUBIC_CURVE_TO_NV); - d->path.coord.append(path.coords[coordIdx]); - d->path.coord.append(path.coords[coordIdx + 1]); - d->path.coord.append(path.coords[coordIdx + 2]); - d->path.coord.append(path.coords[coordIdx + 3]); - pos = QPointF(path.coords[coordIdx + 4], path.coords[coordIdx + 5]); - d->path.coord.append(pos.x()); - d->path.coord.append(pos.y()); - coordIdx += 6; - break; - case QQuickShapePathCommands::ArcTo: - { - const bool sweepFlag = !qFuzzyIsNull(path.coords[coordIdx + 5]); - const bool useLargeArc = !qFuzzyIsNull(path.coords[coordIdx + 6]); - GLenum cmd; - if (useLargeArc) - cmd = sweepFlag ? GL_LARGE_CCW_ARC_TO_NV : GL_LARGE_CW_ARC_TO_NV; - else - cmd = sweepFlag ? GL_SMALL_CCW_ARC_TO_NV : GL_SMALL_CW_ARC_TO_NV; - d->path.cmd.append(cmd); - d->path.coord.append(path.coords[coordIdx]); // rx - d->path.coord.append(path.coords[coordIdx + 1]); // ry - d->path.coord.append(path.coords[coordIdx + 2]); // xrot - pos = QPointF(path.coords[coordIdx + 3], path.coords[coordIdx + 4]); - d->path.coord.append(pos.x()); - d->path.coord.append(pos.y()); - coordIdx += 7; - } - break; - default: - qWarning("Unknown JS path command: %d", cmd); - break; - } - } - - if (pos == startPos) - d->path.cmd.append(GL_CLOSE_PATH_NV); -} - static inline QVector4D qsg_premultiply(const QColor &c, float globalOpacity) { const float o = c.alphaF() * globalOpacity; diff --git a/src/imports/shapes/qquickshapenvprrenderer_p.h b/src/imports/shapes/qquickshapenvprrenderer_p.h index ec7ba498f9..7eb2924ab7 100644 --- a/src/imports/shapes/qquickshapenvprrenderer_p.h +++ b/src/imports/shapes/qquickshapenvprrenderer_p.h @@ -81,7 +81,6 @@ public: void beginSync(int totalCount) override; void setPath(int index, const QQuickPath *path) override; - void setJSPath(int index, const QQuickShapePathCommands &path) override; void setStrokeColor(int index, const QColor &color) override; void setStrokeWidth(int index, qreal w) override; void setFillColor(int index, const QColor &color) override; @@ -122,7 +121,6 @@ private: }; void convertPath(const QQuickPath *path, ShapePathGuiData *d); - void convertJSPath(const QQuickShapePathCommands &path, ShapePathGuiData *d); QQuickShapeNvprRenderNode *m_node = nullptr; int m_accDirty = 0; diff --git a/src/imports/shapes/qquickshapesoftwarerenderer.cpp b/src/imports/shapes/qquickshapesoftwarerenderer.cpp index b3373106af..4e6e758697 100644 --- a/src/imports/shapes/qquickshapesoftwarerenderer.cpp +++ b/src/imports/shapes/qquickshapesoftwarerenderer.cpp @@ -58,14 +58,6 @@ void QQuickShapeSoftwareRenderer::setPath(int index, const QQuickPath *path) m_accDirty |= DirtyPath; } -void QQuickShapeSoftwareRenderer::setJSPath(int index, const QQuickShapePathCommands &path) -{ - ShapePathGuiData &d(m_sp[index]); - d.path = path.toPainterPath(); - d.dirty |= DirtyPath; - m_accDirty |= DirtyPath; -} - void QQuickShapeSoftwareRenderer::setStrokeColor(int index, const QColor &color) { ShapePathGuiData &d(m_sp[index]); diff --git a/src/imports/shapes/qquickshapesoftwarerenderer_p.h b/src/imports/shapes/qquickshapesoftwarerenderer_p.h index 53982ce347..0abc2e37b0 100644 --- a/src/imports/shapes/qquickshapesoftwarerenderer_p.h +++ b/src/imports/shapes/qquickshapesoftwarerenderer_p.h @@ -73,7 +73,6 @@ public: void beginSync(int totalCount) override; void setPath(int index, const QQuickPath *path) override; - void setJSPath(int index, const QQuickShapePathCommands &path) override; void setStrokeColor(int index, const QColor &color) override; void setStrokeWidth(int index, qreal w) override; void setFillColor(int index, const QColor &color) override; -- cgit v1.2.3 From 6f3108b7b14a7a2844539b61ab357f8ee6d3c5d4 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Thu, 8 Jun 2017 11:26:10 +0200 Subject: Add tabStopDistance property to QQuickTextEdit This change adds a new property to QQuickTextEdit, tabStopDistance, to control the distance between tab stops in the underlying QTextDocument. [ChangeLog][QtQuick][QQuickTextEdit] Added tabStopDistance property Change-Id: Ib75838e9765e44c74e5055a738d2a0464a341509 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/items/qquicktextedit.cpp | 26 ++++++++++++++++++++++++++ src/quick/items/qquicktextedit_p.h | 5 +++++ 2 files changed, 31 insertions(+) (limited to 'src') diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index aec8666dc4..f22c5f00be 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -3050,6 +3050,32 @@ void QQuickTextEdit::resetBottomPadding() d->setBottomPadding(0, true); } +/*! + \qmlproperty real QtQuick::TextEdit::tabStopDistance + \since 5.10 + + The default distance, in device units, between tab stops. + + \sa QTextOption::setTabStop() +*/ +int QQuickTextEdit::tabStopDistance() const +{ + Q_D(const QQuickTextEdit); + return d->document->defaultTextOption().tabStop(); +} + +void QQuickTextEdit::setTabStopDistance(qreal distance) +{ + Q_D(QQuickTextEdit); + QTextOption textOptions = d->document->defaultTextOption(); + if (textOptions.tabStop() == distance) + return; + + textOptions.setTabStop(distance); + d->document->setDefaultTextOption(textOptions); + emit tabStopDistanceChanged(distance); +} + /*! \qmlmethod QtQuick::TextEdit::clear() \since 5.7 diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h index c8d3515be1..23033edb88 100644 --- a/src/quick/items/qquicktextedit_p.h +++ b/src/quick/items/qquicktextedit_p.h @@ -111,6 +111,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickTextEdit : public QQuickImplicitSizeItem Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding RESET resetRightPadding NOTIFY rightPaddingChanged REVISION 6) Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding RESET resetBottomPadding NOTIFY bottomPaddingChanged REVISION 6) Q_PROPERTY(QString preeditText READ preeditText NOTIFY preeditTextChanged REVISION 7) + Q_PROPERTY(qreal tabStopDistance READ tabStopDistance WRITE setTabStopDistance NOTIFY tabStopDistanceChanged REVISION 10) public: QQuickTextEdit(QQuickItem *parent=0); @@ -296,6 +297,9 @@ public: void setBottomPadding(qreal padding); void resetBottomPadding(); + int tabStopDistance() const; + void setTabStopDistance(qreal distance); + Q_SIGNALS: void textChanged(); Q_REVISION(7) void preeditTextChanged(); @@ -340,6 +344,7 @@ Q_SIGNALS: Q_REVISION(6) void leftPaddingChanged(); Q_REVISION(6) void rightPaddingChanged(); Q_REVISION(6) void bottomPaddingChanged(); + Q_REVISION(10) void tabStopDistanceChanged(qreal distance); public Q_SLOTS: void selectAll(); -- cgit v1.2.3 From 5a6887ae8536c0b751e7b870ab629ecbf8784d22 Mon Sep 17 00:00:00 2001 From: Berthold Krevert Date: Thu, 3 Aug 2017 22:51:30 +0200 Subject: Normalize dashOffset behavior between renderer backends Software and tessellation backends assume that dashOffset is defined in units of strokeWidth. That means the nvpr backend has to scale the dashOffset by the strokeWidth to keep behavior in sync. Change-Id: Ie1735f8dcdc6ac89fc4425b29166f88ad2638a92 Reviewed-by: Laszlo Agocs --- src/imports/shapes/qquickshapenvprrenderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/qquickshapenvprrenderer.cpp b/src/imports/shapes/qquickshapenvprrenderer.cpp index 4f49bb5256..a859ca45b6 100644 --- a/src/imports/shapes/qquickshapenvprrenderer.cpp +++ b/src/imports/shapes/qquickshapenvprrenderer.cpp @@ -370,11 +370,11 @@ void QQuickShapeNvprRenderer::updateNode() } if (dirty & DirtyDash) { - dst.dashOffset = src.dashOffset; + // Multiply by strokeWidth because the Shape API follows QPen + // meaning the input dash pattern and dash offset here are in width units. + dst.dashOffset = src.dashOffset * src.strokeWidth; if (src.dashActive) { dst.dashPattern.resize(src.dashPattern.count()); - // Multiply by strokeWidth because the Shape API follows QPen - // meaning the input dash pattern here is in width units. for (int i = 0; i < src.dashPattern.count(); ++i) dst.dashPattern[i] = GLfloat(src.dashPattern[i]) * src.strokeWidth; } else { -- cgit v1.2.3 From 432e27ae092397cb2154f48103e729852c38cf2d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 18 Apr 2017 09:07:07 -0500 Subject: Add very basic compressed texture support Allow direct loading of pkm texture files into Image. This can be extended to additional texture types, and then eventually turned into a full plugin architexture. [ChangeLog][Qt Quick] Allow direct loading of pkm texture files into Image. For example: Image { source: "myImage.pkm" } Change-Id: I1baed6c3e85a15752da8adc675482d874c9355ab Task-number: QTBUG-59872 Task-number: QTBUG-29451 Reviewed-by: Laszlo Agocs --- .../scenegraph/compressedtexture/qsgpkmhandler.cpp | 209 +++++++++++++++++++++ .../scenegraph/compressedtexture/qsgpkmhandler_p.h | 94 +++++++++ src/quick/scenegraph/scenegraph.pri | 15 ++ src/quick/scenegraph/util/qsgtexturereader.cpp | 82 ++++++++ src/quick/scenegraph/util/qsgtexturereader_p.h | 72 +++++++ src/quick/util/qquickpixmapcache.cpp | 45 ++++- 6 files changed, 510 insertions(+), 7 deletions(-) create mode 100644 src/quick/scenegraph/compressedtexture/qsgpkmhandler.cpp create mode 100644 src/quick/scenegraph/compressedtexture/qsgpkmhandler_p.h create mode 100644 src/quick/scenegraph/util/qsgtexturereader.cpp create mode 100644 src/quick/scenegraph/util/qsgtexturereader_p.h (limited to 'src') diff --git a/src/quick/scenegraph/compressedtexture/qsgpkmhandler.cpp b/src/quick/scenegraph/compressedtexture/qsgpkmhandler.cpp new file mode 100644 index 0000000000..1b8882e9a5 --- /dev/null +++ b/src/quick/scenegraph/compressedtexture/qsgpkmhandler.cpp @@ -0,0 +1,209 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQuick module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qsgpkmhandler_p.h" + +#include +#include +#include +#include +#include + +//#define ETC_DEBUG + +#ifndef GL_ETC1_RGB8_OES + #define GL_ETC1_RGB8_OES 0x8d64 +#endif + +#ifndef GL_COMPRESSED_RGB8_ETC2 + #define GL_COMPRESSED_RGB8_ETC2 0x9274 +#endif + +#ifndef GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 + #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#endif + +#ifndef GL_COMPRESSED_RGBA8_ETC2_EAC + #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#endif + +QT_BEGIN_NAMESPACE + +static const int headerSize = 16; + +static unsigned int typeMap[5] = { + GL_ETC1_RGB8_OES, + GL_COMPRESSED_RGB8_ETC2, + 0, // unused + GL_COMPRESSED_RGBA8_ETC2_EAC, + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 +}; + +EtcTexture::EtcTexture() + : m_texture_id(0), m_uploaded(false) +{ + initializeOpenGLFunctions(); +} + +EtcTexture::~EtcTexture() +{ + if (m_texture_id) + glDeleteTextures(1, &m_texture_id); +} + +int EtcTexture::textureId() const +{ + if (m_texture_id == 0) { + EtcTexture *texture = const_cast(this); + texture->glGenTextures(1, &texture->m_texture_id); + } + return m_texture_id; +} + +bool EtcTexture::hasAlphaChannel() const +{ + return m_type == GL_COMPRESSED_RGBA8_ETC2_EAC || + m_type == GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; +} + + +void EtcTexture::bind() +{ + if (m_uploaded && m_texture_id) { + glBindTexture(GL_TEXTURE_2D, m_texture_id); + return; + } + + if (m_texture_id == 0) + glGenTextures(1, &m_texture_id); + glBindTexture(GL_TEXTURE_2D, m_texture_id); + +#ifdef ETC_DEBUG + qDebug() << "glCompressedTexImage2D, width: " << m_size.width() << "height" << m_size.height() << + "paddedWidth: " << m_paddedSize.width() << "paddedHeight: " << m_paddedSize.height(); +#endif + +#ifndef QT_NO_DEBUG + while (glGetError() != GL_NO_ERROR) { } +#endif + + QOpenGLContext *ctx = QOpenGLContext::currentContext(); + Q_ASSERT(ctx != 0); + ctx->functions()->glCompressedTexImage2D(GL_TEXTURE_2D, 0, m_type, + m_size.width(), m_size.height(), 0, + (m_paddedSize.width() * m_paddedSize.height()) / 2, + m_data.data() + headerSize); + +#ifndef QT_NO_DEBUG + // Gracefully fail in case of an error... + GLuint error = glGetError(); + if (error != GL_NO_ERROR) { + qDebug () << "glCompressedTexImage2D for compressed texture failed, error: " << error; + glBindTexture(GL_TEXTURE_2D, 0); + glDeleteTextures(1, &m_texture_id); + m_texture_id = 0; + return; + } +#endif + + m_uploaded = true; + updateBindOptions(true); +} + +class QEtcTextureFactory : public QQuickTextureFactory +{ +public: + QByteArray m_data; + QSize m_size; + QSize m_paddedSize; + unsigned int m_type; + + QSize textureSize() const { return m_size; } + int textureByteCount() const { return m_data.size(); } + + QSGTexture *createTexture(QQuickWindow *) const { + EtcTexture *texture = new EtcTexture; + texture->m_data = m_data; + texture->m_size = m_size; + texture->m_paddedSize = m_paddedSize; + texture->m_type = m_type; + return texture; + } +}; + +QQuickTextureFactory *QSGPkmHandler::read(QIODevice *device) +{ + QScopedPointer ret(new QEtcTextureFactory); + ret->m_data = device->readAll(); + if (ret->m_data.isEmpty() || ret->m_data.size() < headerSize) + return nullptr; + + const char *rawData = ret->m_data.constData(); + + // magic number + if (qstrncmp(rawData, "PKM ", 4) != 0) + return nullptr; + + // currently ignore version (rawData + 4) + + // texture type + quint16 type = qFromBigEndian(rawData + 6); + static int typeCount = sizeof(typeMap)/sizeof(typeMap[0]); + if (type >= typeCount) + return nullptr; + ret->m_type = typeMap[type]; + + // texture size + ret->m_paddedSize.setWidth(qFromBigEndian(rawData + 8)); + ret->m_paddedSize.setHeight(qFromBigEndian(rawData + 10)); + if ((ret->m_paddedSize.width() * ret->m_paddedSize.height()) / 2 > ret->m_data.size() - headerSize) + return nullptr; + ret->m_size.setWidth(qFromBigEndian(rawData + 12)); + ret->m_size.setHeight(qFromBigEndian(rawData + 14)); + if (ret->m_size.isEmpty()) + return nullptr; + +#ifdef ETC_DEBUG + qDebug() << "requestTexture returning: " << ret->m_data.length() << "bytes; width: " << ret->m_size.width() << ", height: " << ret->m_size.height(); +#endif + + return ret.take(); +} + +QT_END_NAMESPACE diff --git a/src/quick/scenegraph/compressedtexture/qsgpkmhandler_p.h b/src/quick/scenegraph/compressedtexture/qsgpkmhandler_p.h new file mode 100644 index 0000000000..77097cb80a --- /dev/null +++ b/src/quick/scenegraph/compressedtexture/qsgpkmhandler_p.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQuick module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSGPKMHANDLER_H +#define QSGPKMHANDLER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QSGPkmHandler +{ +public: + QSGPkmHandler() {} + + QQuickTextureFactory *read(QIODevice *device); +}; + +class EtcTexture : public QSGTexture, protected QOpenGLFunctions +{ + Q_OBJECT +public: + EtcTexture(); + ~EtcTexture(); + + void bind(); + + QSize textureSize() const { return m_size; } + int textureId() const; + + bool hasAlphaChannel() const; + bool hasMipmaps() const { return false; } + + QByteArray m_data; + QSize m_size; + QSize m_paddedSize; + GLuint m_texture_id; + GLenum m_type; + bool m_uploaded; +}; + +QT_END_NAMESPACE + +#endif // QSGPKMHANDLER_H diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri index c6db3df158..b5c72f521c 100644 --- a/src/quick/scenegraph/scenegraph.pri +++ b/src/quick/scenegraph/scenegraph.pri @@ -220,3 +220,18 @@ qtConfig(opengl(es1|es2)?) { $$PWD/shaders/visualization.frag \ $$PWD/shaders/visualization.vert } + +# Compressed Texture API +HEADERS += \ + $$PWD/util/qsgtexturereader_p.h + +SOURCES += \ + $$PWD/util/qsgtexturereader.cpp + +qtConfig(opengl(es1|es2)?) { + HEADERS += \ + $$PWD/compressedtexture/qsgpkmhandler_p.h + + SOURCES += \ + $$PWD/compressedtexture/qsgpkmhandler.cpp +} diff --git a/src/quick/scenegraph/util/qsgtexturereader.cpp b/src/quick/scenegraph/util/qsgtexturereader.cpp new file mode 100644 index 0000000000..61729ada18 --- /dev/null +++ b/src/quick/scenegraph/util/qsgtexturereader.cpp @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQuick module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qsgtexturereader_p.h" + +#include + +#if QT_CONFIG(opengl) +#include +#endif + +QT_BEGIN_NAMESPACE + +QSGTextureReader::QSGTextureReader() +{ + +} + +QQuickTextureFactory *QSGTextureReader::read(QIODevice *device, const QByteArray &format) +{ +#if QT_CONFIG(opengl) + if (format == QByteArrayLiteral("pkm")) { + QSGPkmHandler handler; + return handler.read(device); + } +#else + Q_UNUSED(device) + Q_UNUSED(format) +#endif + return nullptr; +} + +bool QSGTextureReader::isTexture(QIODevice *device, const QByteArray &format) +{ +#if QT_CONFIG(opengl) + if (format == QByteArrayLiteral("pkm")) { + return device->peek(4) == QByteArrayLiteral("PKM "); + } +#else + Q_UNUSED(device) + Q_UNUSED(format) +#endif + return false; +} + +QT_END_NAMESPACE diff --git a/src/quick/scenegraph/util/qsgtexturereader_p.h b/src/quick/scenegraph/util/qsgtexturereader_p.h new file mode 100644 index 0000000000..7d2fc314a6 --- /dev/null +++ b/src/quick/scenegraph/util/qsgtexturereader_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQuick module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSGTEXTUREREADER_H +#define QSGTEXTUREREADER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QIODevice; +class QQuickTextureFactory; + +class QSGTextureReader +{ +public: + QSGTextureReader(); + + static QQuickTextureFactory *read(QIODevice *device, const QByteArray &format); + static bool isTexture(QIODevice *device, const QByteArray &format); +}; + +QT_END_NAMESPACE + +#endif // QSGTEXTUREREADER_H diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index e026608150..e218b84fff 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -49,6 +49,7 @@ #include #include +#include #include #include @@ -771,8 +772,26 @@ void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &u QFile f(localFile); QSize readSize; if (f.open(QIODevice::ReadOnly)) { - if (!readImage(url, &f, &image, &errorStr, &readSize, runningJob->requestSize, runningJob->providerOptions)) - errorCode = QQuickPixmapReply::Loading; + + // for now, purely use suffix information to determine whether we are working with a compressed texture + QByteArray suffix = QFileInfo(f).suffix().toLower().toLatin1(); + if (QSGTextureReader::isTexture(&f, suffix)) { + QQuickTextureFactory *factory = QSGTextureReader::read(&f, suffix); + if (factory) { + readSize = factory->textureSize(); + } else { + errorStr = QQuickPixmap::tr("Error decoding: %1").arg(url.toString()); + errorCode = QQuickPixmapReply::Decoding; + } + mutex.lock(); + if (!cancelled.contains(runningJob)) + runningJob->postReply(errorCode, errorStr, readSize, factory); + mutex.unlock(); + return; + } else { + if (!readImage(url, &f, &image, &errorStr, &readSize, runningJob->requestSize, runningJob->providerOptions)) + errorCode = QQuickPixmapReply::Loading; + } } else { errorStr = QQuickPixmap::tr("Cannot open: %1").arg(url.toString()); errorCode = QQuickPixmapReply::Loading; @@ -1233,11 +1252,23 @@ static QQuickPixmapData* createPixmapDataSync(QQuickPixmap *declarativePixmap, Q QString errorString; if (f.open(QIODevice::ReadOnly)) { - QImage image; - QQuickImageProviderOptions::AutoTransform appliedTransform = providerOptions.autoTransform(); - if (readImage(url, &f, &image, &errorString, &readSize, requestSize, providerOptions, &appliedTransform)) { - *ok = true; - return new QQuickPixmapData(declarativePixmap, url, QQuickTextureFactory::textureFactoryForImage(image), readSize, requestSize, providerOptions, appliedTransform); + // for now, purely use suffix information to determine whether we are working with a compressed texture + QByteArray suffix = QFileInfo(f).suffix().toLower().toLatin1(); + if (QSGTextureReader::isTexture(&f, suffix)) { + QQuickTextureFactory *factory = QSGTextureReader::read(&f, suffix); + if (factory) { + *ok = true; + return new QQuickPixmapData(declarativePixmap, factory); + } else { + errorString = QQuickPixmap::tr("Error decoding: %1").arg(url.toString()); + } + } else { + QImage image; + QQuickImageProviderOptions::AutoTransform appliedTransform = providerOptions.autoTransform(); + if (readImage(url, &f, &image, &errorString, &readSize, requestSize, providerOptions, &appliedTransform)) { + *ok = true; + return new QQuickPixmapData(declarativePixmap, url, QQuickTextureFactory::textureFactoryForImage(image), readSize, requestSize, providerOptions, appliedTransform); + } } } else { errorString = QQuickPixmap::tr("Cannot open: %1").arg(url.toString()); -- cgit v1.2.3