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 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