From 1c5c5f7aadc2dcc73a21eeb818e95c4e1b7de70f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 26 Jun 2019 16:46:23 +0200 Subject: [PATCH 01/18] Fix Qt6 build in preparation of qt5 submodule update Fixes the QTextStream usages. Change-Id: I0c009a82fb644a9f3c3d42ec410d18b680977f23 Reviewed-by: Qt CI Bot Reviewed-by: Simon Hausmann --- src/qml/animations/qabstractanimationjob.cpp | 2 +- .../qcontinuinganimationgroupjob.cpp | 2 +- .../animations/qparallelanimationgroupjob.cpp | 2 +- src/qml/animations/qpauseanimationjob.cpp | 2 +- .../qsequentialanimationgroupjob.cpp | 2 +- .../jsruntime/qv4executablecompilationunit.cpp | 2 +- src/qml/memory/qv4mm.cpp | 5 +++-- src/quick/handlers/qquickpinchhandler.cpp | 2 +- src/quick/handlers/qquickpointerhandler.cpp | 4 ++-- .../handlers/qquicksinglepointhandler.cpp | 2 +- src/quick/items/qquickevents.cpp | 12 ++++++------ src/quick/items/qquickview.cpp | 14 +++++++------- src/quick/items/qquickwindow.cpp | 12 ++++++------ .../scenegraph/coreapi/qsgbatchrenderer.cpp | 12 ++++++------ src/quick/scenegraph/coreapi/qsgnode.cpp | 18 +++++++++--------- .../scenegraph/qsgdefaultrendercontext.cpp | 2 +- src/quick/util/qquickanimation.cpp | 4 ++-- src/quick/util/qquickanimatorjob.cpp | 4 ++-- src/quick/util/qquicksmoothedanimation.cpp | 2 +- src/quick/util/qquickspringanimation.cpp | 2 +- src/quick/util/qquicktimeline.cpp | 2 +- src/quickwidgets/qquickwidget.cpp | 14 +++++++------- tools/qmlcachegen/qmlcachegen.cpp | 2 +- tools/qmlpreview/qmlpreviewapplication.cpp | 4 ++-- 24 files changed, 65 insertions(+), 64 deletions(-) diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp index 7a784a2b35..c6ace05b8f 100644 --- a/src/qml/animations/qabstractanimationjob.cpp +++ b/src/qml/animations/qabstractanimationjob.cpp @@ -641,7 +641,7 @@ void QAbstractAnimationJob::removeAnimationChangeListener(QAnimationJobChangeLis void QAbstractAnimationJob::debugAnimation(QDebug d) const { - d << "AbstractAnimationJob(" << hex << (const void *) this << dec << ") state:" + d << "AbstractAnimationJob(" << Qt::hex << (const void *) this << Qt::dec << ") state:" << m_state << "duration:" << duration(); } diff --git a/src/qml/animations/qcontinuinganimationgroupjob.cpp b/src/qml/animations/qcontinuinganimationgroupjob.cpp index 10096bf19c..88c0e9e60e 100644 --- a/src/qml/animations/qcontinuinganimationgroupjob.cpp +++ b/src/qml/animations/qcontinuinganimationgroupjob.cpp @@ -120,7 +120,7 @@ void QContinuingAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimat void QContinuingAnimationGroupJob::debugAnimation(QDebug d) const { - d << "ContinuingAnimationGroupJob(" << hex << (const void *) this << dec << ")"; + d << "ContinuingAnimationGroupJob(" << Qt::hex << (const void *) this << Qt::dec << ")"; debugChildren(d); } diff --git a/src/qml/animations/qparallelanimationgroupjob.cpp b/src/qml/animations/qparallelanimationgroupjob.cpp index 700fdf9fd9..420a934ba2 100644 --- a/src/qml/animations/qparallelanimationgroupjob.cpp +++ b/src/qml/animations/qparallelanimationgroupjob.cpp @@ -239,7 +239,7 @@ void QParallelAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimatio void QParallelAnimationGroupJob::debugAnimation(QDebug d) const { - d << "ParallelAnimationGroupJob(" << hex << (const void *) this << dec << ")"; + d << "ParallelAnimationGroupJob(" << Qt::hex << (const void *) this << Qt::dec << ")"; debugChildren(d); } diff --git a/src/qml/animations/qpauseanimationjob.cpp b/src/qml/animations/qpauseanimationjob.cpp index 0652ed578b..aac04d2f8d 100644 --- a/src/qml/animations/qpauseanimationjob.cpp +++ b/src/qml/animations/qpauseanimationjob.cpp @@ -67,7 +67,7 @@ void QPauseAnimationJob::updateCurrentTime(int) void QPauseAnimationJob::debugAnimation(QDebug d) const { - d << "PauseAnimationJob(" << hex << (const void *) this << dec << ")" << "duration:" << m_duration; + d << "PauseAnimationJob(" << Qt::hex << (const void *) this << Qt::dec << ")" << "duration:" << m_duration; } QT_END_NAMESPACE diff --git a/src/qml/animations/qsequentialanimationgroupjob.cpp b/src/qml/animations/qsequentialanimationgroupjob.cpp index d98546122f..dc57444b32 100644 --- a/src/qml/animations/qsequentialanimationgroupjob.cpp +++ b/src/qml/animations/qsequentialanimationgroupjob.cpp @@ -426,7 +426,7 @@ void QSequentialAnimationGroupJob::animationRemoved(QAbstractAnimationJob *anim, void QSequentialAnimationGroupJob::debugAnimation(QDebug d) const { - d << "SequentialAnimationGroupJob(" << hex << (const void *) this << dec << ")" << "currentAnimation:" << (void *)m_currentAnimation; + d << "SequentialAnimationGroupJob(" << Qt::hex << (const void *) this << Qt::dec << ")" << "currentAnimation:" << (void *)m_currentAnimation; debugChildren(d); } diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index 39f4a0a129..492d1f4d03 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -120,7 +120,7 @@ static QString toString(QV4::ReturnedValue v) static void dumpConstantTable(const StaticValue *constants, uint count) { QDebug d = qDebug(); - d.nospace() << right; + d.nospace() << Qt::right; for (uint i = 0; i < count; ++i) { d << qSetFieldWidth(8) << i << qSetFieldWidth(0) << ": " << toString(constants[i].asReturnedValue()).toUtf8().constData() << "\n"; diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp index 86202a6729..6ee36cbfcf 100644 --- a/src/qml/memory/qv4mm.cpp +++ b/src/qml/memory/qv4mm.cpp @@ -223,7 +223,8 @@ Chunk *MemorySegment::allocate(size_t size) pageReservation.commit(candidate, size); for (uint i = 0; i < requiredChunks; ++i) setBit(candidate - base + i); - DEBUG << "allocated chunk " << candidate << hex << size; + DEBUG << "allocated chunk " << candidate << Qt::hex << size; + return candidate; } } @@ -1024,7 +1025,7 @@ static size_t dumpBins(BlockAllocator *b, const char *title) SDUMP() << " large slot map"; HeapItem *h = b->freeBins[BlockAllocator::NumBins - 1]; while (h) { - SDUMP() << " " << hex << (quintptr(h)/32) << h->freeData.availableSlots; + SDUMP() << " " << Qt::hex << (quintptr(h)/32) << h->freeData.availableSlots; h = h->freeData.next; } diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp index a5a867015c..9ef0f895ac 100644 --- a/src/quick/handlers/qquickpinchhandler.cpp +++ b/src/quick/handlers/qquickpinchhandler.cpp @@ -289,7 +289,7 @@ void QQuickPinchHandler::handlePointerEventImpl(QQuickPointerEvent *event) { if (Q_UNLIKELY(lcPinchHandler().isDebugEnabled())) { for (const QQuickHandlerPoint &p : currentPoints()) - qCDebug(lcPinchHandler) << hex << p.id() << p.sceneGrabPosition() << "->" << p.scenePosition(); + qCDebug(lcPinchHandler) << Qt::hex << p.id() << p.sceneGrabPosition() << "->" << p.scenePosition(); } QQuickMultiPointHandler::handlePointerEventImpl(event); diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp index 12c06aa179..ee0a8e7837 100644 --- a/src/quick/handlers/qquickpointerhandler.cpp +++ b/src/quick/handlers/qquickpointerhandler.cpp @@ -249,7 +249,7 @@ bool QQuickPointerHandler::approveGrabTransition(QQuickEventPoint *point, QObjec allowed = true; } } - qCDebug(lcPointerHandlerGrab) << "point" << hex << point->pointId() << "permission" << + qCDebug(lcPointerHandlerGrab) << "point" << Qt::hex << point->pointId() << "permission" << QMetaEnum::fromType().valueToKeys(grabPermissions()) << ':' << this << (allowed ? "approved to" : "denied to") << proposedGrabber; return allowed; @@ -473,7 +473,7 @@ bool QQuickPointerHandler::wantsPointerEvent(QQuickPointerEvent *event) bool QQuickPointerHandler::wantsEventPoint(QQuickEventPoint *point) { bool ret = point->exclusiveGrabber() == this || point->passiveGrabbers().contains(this) || parentContains(point); - qCDebug(lcPointerHandlerDispatch) << hex << point->pointId() << "@" << point->scenePosition() + qCDebug(lcPointerHandlerDispatch) << Qt::hex << point->pointId() << "@" << point->scenePosition() << metaObject()->className() << objectName() << ret; return ret; } diff --git a/src/quick/handlers/qquicksinglepointhandler.cpp b/src/quick/handlers/qquicksinglepointhandler.cpp index c0fa39fad3..234bc3c75a 100644 --- a/src/quick/handlers/qquicksinglepointhandler.cpp +++ b/src/quick/handlers/qquicksinglepointhandler.cpp @@ -98,7 +98,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event) } } if (missing) - qCWarning(DBG_TOUCH_TARGET) << this << "pointId" << hex << d->pointInfo.id() + qCWarning(DBG_TOUCH_TARGET) << this << "pointId" << Qt::hex << d->pointInfo.id() << "is missing from current event, but was neither canceled nor released"; if (point) { if (candidatePointCount == 1 || (candidatePointCount > 1 && d->ignoreAdditionalPoints)) { diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 28b217b7b3..51c662cb3a 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -851,7 +851,7 @@ void QQuickEventPoint::setGrabberItem(QQuickItem *grabber) if (oldGrabberHandler && !oldGrabberHandler->approveGrabTransition(this, grabber)) return; if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { - qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << hex << m_pointId << pointStateString(this) << "@" << m_scenePos + qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << Qt::hex << m_pointId << pointStateString(this) << "@" << m_scenePos << ": grab" << m_exclusiveGrabber << "->" << grabber; } QQuickItem *oldGrabberItem = grabberItem(); @@ -892,10 +892,10 @@ void QQuickEventPoint::setGrabberPointerHandler(QQuickPointerHandler *grabber, b if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { if (exclusive) { if (m_exclusiveGrabber != grabber) - qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << hex << m_pointId << pointStateString(this) + qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << Qt::hex << m_pointId << pointStateString(this) << ": grab (exclusive)" << m_exclusiveGrabber << "->" << grabber; } else { - qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << hex << m_pointId << pointStateString(this) + qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << Qt::hex << m_pointId << pointStateString(this) << ": grab (passive)" << grabber; } } @@ -954,7 +954,7 @@ void QQuickEventPoint::cancelExclusiveGrabImpl(QTouchEvent *cancelEvent) if (m_exclusiveGrabber.isNull()) return; if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { - qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << hex << m_pointId << pointStateString(this) + qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << Qt::hex << m_pointId << pointStateString(this) << ": grab (exclusive)" << m_exclusiveGrabber << "-> nullptr"; } if (auto handler = grabberPointerHandler()) { @@ -977,7 +977,7 @@ void QQuickEventPoint::cancelPassiveGrab(QQuickPointerHandler *handler) { if (removePassiveGrabber(handler)) { if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { - qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << hex << m_pointId << pointStateString(this) + qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << Qt::hex << m_pointId << pointStateString(this) << ": grab (passive)" << handler << "removed"; } handler->onGrabChanged(handler, CancelGrabPassive, this); @@ -1956,7 +1956,7 @@ Q_QUICK_PRIVATE_EXPORT QDebug operator<<(QDebug dbg, const QQuickEventPoint *eve dbg << "QQuickEventPoint(accepted:" << event->isAccepted() << " state:"; QtDebugUtils::formatQEnum(dbg, event->state()); - dbg << " scenePos:" << event->scenePosition() << " id:" << hex << event->pointId() << dec + dbg << " scenePos:" << event->scenePosition() << " id:" << Qt::hex << event->pointId() << Qt::dec << " timeHeld:" << event->timeHeld() << ')'; return dbg; } diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp index 61477360bf..fa9b44aa22 100644 --- a/src/quick/items/qquickview.cpp +++ b/src/quick/items/qquickview.cpp @@ -501,14 +501,14 @@ void QQuickViewPrivate::setRootObject(QObject *obj) sgItem->setParentItem(q->QQuickWindow::contentItem()); QQml_setParent_noEvent(sgItem, q->QQuickWindow::contentItem()); } else if (qobject_cast(obj)) { - qWarning() << "QQuickView does not support using windows as a root item." << endl - << endl - << "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << endl; + qWarning() << "QQuickView does not support using windows as a root item." << Qt::endl + << Qt::endl + << "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << Qt::endl; } else { - qWarning() << "QQuickView only supports loading of root objects that derive from QQuickItem." << endl - << endl - << "Ensure your QML code is written for QtQuick 2, and uses a root that is or" << endl - << "inherits from QtQuick's Item (not a Timer, QtObject, etc)." << endl; + qWarning() << "QQuickView only supports loading of root objects that derive from QQuickItem." << Qt::endl + << Qt::endl + << "Ensure your QML code is written for QtQuick 2, and uses a root that is or" << Qt::endl + << "inherits from QtQuick's Item (not a Timer, QtObject, etc)." << Qt::endl; delete obj; root = nullptr; } diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 7d1fa9c30d..2543e867df 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -696,7 +696,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve if (!item->contains(pos)) break; - qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << hex << p.id() << "->" << item; + qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << Qt::hex << p.id() << "->" << item; QScopedPointer mousePress(touchToMouseEvent(QEvent::MouseButtonPress, p, event.data(), item, false)); // Send a single press and see if that's accepted @@ -738,7 +738,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve QCoreApplication::sendEvent(item, me.data()); event->setAccepted(me->isAccepted()); if (me->isAccepted()) { - qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << hex << p.id() << "->" << mouseGrabberItem; + qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << Qt::hex << p.id() << "->" << mouseGrabberItem; } return event->isAccepted(); } else { @@ -2465,7 +2465,7 @@ void QQuickWindowPrivate::deliverTouchEvent(QQuickPointerTouchEvent *event) QQuickEventPoint *point = event->point(i); if (point->state() == QQuickEventPoint::Released) { int id = point->pointId(); - qCDebug(DBG_TOUCH_TARGET) << "TP" << hex << id << "released"; + qCDebug(DBG_TOUCH_TARGET) << "TP" << Qt::hex << id << "released"; point->setGrabberItem(nullptr); if (id == touchMouseId) cancelTouchMouseSynthesis(); @@ -2562,7 +2562,7 @@ bool QQuickWindowPrivate::deliverPressOrReleaseEvent(QQuickPointerEvent *event, if (point->grabberPointerHandler()) cancelTouchMouseSynthesis(); } else { - qCWarning(DBG_TOUCH_TARGET) << "during delivery of touch press, synth-mouse ID" << hex << touchMouseId << "is missing from" << event; + qCWarning(DBG_TOUCH_TARGET) << "during delivery of touch press, synth-mouse ID" << Qt::hex << touchMouseId << "is missing from" << event; } } for (int i = 0; i < pointCount; ++i) { @@ -2704,7 +2704,7 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo if (point.state() == Qt::TouchPointPressed) { if (auto *tp = ptEvent->pointById(point.id())) { if (tp->exclusiveGrabber() == item) { - qCDebug(DBG_TOUCH_TARGET) << "TP" << hex << point.id() << "disassociated"; + qCDebug(DBG_TOUCH_TARGET) << "TP" << Qt::hex << point.id() << "disassociated"; tp->setGrabberItem(nullptr); } } @@ -2983,7 +2983,7 @@ bool QQuickWindowPrivate::sendFilteredPointerEventImpl(QQuickPointerEvent *event qCDebug(DBG_TOUCH) << "touch event intercepted as synth mouse event by childMouseEventFilter of " << filteringParent; skipDelivery.append(filteringParent); if (t != QEvent::MouseButtonRelease) { - qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << hex << tp.id() << "->" << filteringParent; + qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << Qt::hex << tp.id() << "->" << filteringParent; pointerEventInstance(dev)->pointById(tp.id())->setGrabberItem(filteringParent); touchMouseUnset = false; // We want to leave touchMouseId and touchMouseDevice set if (mouseEvent->isAccepted()) diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index afe3380494..f99d2ed862 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -248,13 +248,13 @@ void qsg_dumpShadowRoots(Node *n) QByteArray ind(indent, ' '); if (n->type() == QSGNode::ClipNodeType || n->isBatchRoot) { - qDebug() << ind.constData() << "[X]" << n->sgNode << hex << uint(n->sgNode->flags()); + qDebug() << ind.constData() << "[X]" << n->sgNode << Qt::hex << uint(n->sgNode->flags()); qsg_dumpShadowRoots(n->rootInfo(), indent); } else { QDebug d = qDebug(); - d << ind.constData() << "[ ]" << n->sgNode << hex << uint(n->sgNode->flags()); + d << ind.constData() << "[ ]" << n->sgNode << Qt::hex << uint(n->sgNode->flags()); if (n->type() == QSGNode::GeometryNodeType) - d << "order" << dec << n->element()->order; + d << "order" << Qt::dec << n->element()->order; } SHADOWNODE_TRAVERSE(n) @@ -1971,7 +1971,7 @@ void Renderer::uploadBatch(Batch *b) iDump << " -- Index Data, count:" << b->indexCount; for (int i=0; iindexCount; ++i) { if ((i % 24) == 0) - iDump << endl << " --- "; + iDump << Qt::endl << " --- "; iDump << id[i]; } } @@ -2490,8 +2490,8 @@ void Renderer::updateLineWidth(QSGGeometry *g) void Renderer::renderBatches() { if (Q_UNLIKELY(debug_render())) { - qDebug().nospace() << "Rendering:" << endl - << " -> Opaque: " << qsg_countNodesInBatches(m_opaqueBatches) << " nodes in " << m_opaqueBatches.size() << " batches..." << endl + qDebug().nospace() << "Rendering:" << Qt::endl + << " -> Opaque: " << qsg_countNodesInBatches(m_opaqueBatches) << " nodes in " << m_opaqueBatches.size() << " batches..." << Qt::endl << " -> Alpha: " << qsg_countNodesInBatches(m_alphaBatches) << " nodes in " << m_alphaBatches.size() << " batches..."; } diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp index 1976538aec..7d9b74bc2b 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.cpp +++ b/src/quick/scenegraph/coreapi/qsgnode.cpp @@ -1466,7 +1466,7 @@ QDebug operator<<(QDebug d, const QSGGeometryNode *n) d << "Geometry(null)"; return d; } - d << "GeometryNode(" << hex << (const void *) n << dec; + d << "GeometryNode(" << Qt::hex << (const void *) n << Qt::dec; const QSGGeometry *g = n->geometry(); @@ -1517,7 +1517,7 @@ QDebug operator<<(QDebug d, const QSGClipNode *n) d << "ClipNode(null)"; return d; } - d << "ClipNode(" << hex << (const void *) n << dec; + d << "ClipNode(" << Qt::hex << (const void *) n << Qt::dec; if (n->childCount()) d << "children=" << n->childCount(); @@ -1540,7 +1540,7 @@ QDebug operator<<(QDebug d, const QSGTransformNode *n) } const QMatrix4x4 m = n->matrix(); d << "TransformNode("; - d << hex << (const void *) n << dec; + d << Qt::hex << (const void *) n << Qt::dec; if (m.isIdentity()) d << "identity"; else if (m.determinant() == 1 && m(0, 0) == 1 && m(1, 1) == 1 && m(2, 2) == 1) @@ -1562,7 +1562,7 @@ QDebug operator<<(QDebug d, const QSGOpacityNode *n) return d; } d << "OpacityNode("; - d << hex << (const void *) n << dec; + d << Qt::hex << (const void *) n << Qt::dec; d << "opacity=" << n->opacity() << "combined=" << n->combinedOpacity() << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); @@ -1581,7 +1581,7 @@ QDebug operator<<(QDebug d, const QSGRootNode *n) return d; } QDebugStateSaver saver(d); - d << "RootNode" << hex << (const void *) n << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); + d << "RootNode" << Qt::hex << (const void *) n << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); #ifdef QSG_RUNTIME_DESCRIPTION d << QSGNodePrivate::description(n); #endif @@ -1614,8 +1614,8 @@ QDebug operator<<(QDebug d, const QSGNode *n) d << static_cast(n); break; case QSGNode::RenderNodeType: - d << "RenderNode(" << hex << (const void *) n << dec - << "flags=" << (int) n->flags() << dec + d << "RenderNode(" << Qt::hex << (const void *) n << Qt::dec + << "flags=" << (int) n->flags() << Qt::dec << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); #ifdef QSG_RUNTIME_DESCRIPTION d << QSGNodePrivate::description(n); @@ -1623,8 +1623,8 @@ QDebug operator<<(QDebug d, const QSGNode *n) d << ')'; break; default: - d << "Node(" << hex << (const void *) n << dec - << "flags=" << (int) n->flags() << dec + d << "Node(" << Qt::hex << (const void *) n << Qt::dec + << "flags=" << (int) n->flags() << Qt::dec << (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); #ifdef QSG_RUNTIME_DESCRIPTION d << QSGNodePrivate::description(n); diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp index 73b79c6300..b512e3c8d2 100644 --- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp +++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp @@ -275,7 +275,7 @@ void QSGDefaultRenderContext::compileShader(QSGMaterialShader *shader, QSGMateri p->addCacheableShaderFromSourceCode(QOpenGLShader::Fragment, fragmentCode ? fragmentCode : shader->fragmentShader()); p->link(); if (!p->isLinked()) - qWarning() << "shader compilation failed:" << endl << p->log(); + qWarning() << "shader compilation failed:" << Qt::endl << p->log(); } else { shader->compile(); } diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp index 2043b50545..588088b03a 100644 --- a/src/quick/util/qquickanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -903,7 +903,7 @@ void QActionAnimation::updateState(State newState, State oldState) void QActionAnimation::debugAnimation(QDebug d) const { - d << "ActionAnimation(" << hex << (const void *) this << dec << ")"; + d << "ActionAnimation(" << Qt::hex << (const void *) this << Qt::dec << ")"; if (animAction) { int indentLevel = 1; @@ -1996,7 +1996,7 @@ void QQuickBulkValueAnimator::topLevelAnimationLoopChanged() void QQuickBulkValueAnimator::debugAnimation(QDebug d) const { - d << "BulkValueAnimation(" << hex << (const void *) this << dec << ")" << "duration:" << duration(); + d << "BulkValueAnimation(" << Qt::hex << (const void *) this << Qt::dec << ")" << "duration:" << duration(); if (animValue) { int indentLevel = 1; diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp index 03be78ab15..92d62c8d24 100644 --- a/src/quick/util/qquickanimatorjob.cpp +++ b/src/quick/util/qquickanimatorjob.cpp @@ -184,7 +184,7 @@ void QQuickAnimatorProxyJob::updateState(QAbstractAnimationJob::State newState, void QQuickAnimatorProxyJob::debugAnimation(QDebug d) const { - d << "QuickAnimatorProxyJob("<< hex << (const void *) this << dec + d << "QuickAnimatorProxyJob("<< Qt::hex << (const void *) this << Qt::dec << "state:" << state() << "duration:" << duration() << "proxying: (" << job() << ')'; } @@ -266,7 +266,7 @@ QQuickAnimatorJob::QQuickAnimatorJob() void QQuickAnimatorJob::debugAnimation(QDebug d) const { - d << "QuickAnimatorJob(" << hex << (const void *) this << dec + d << "QuickAnimatorJob(" << Qt::hex << (const void *) this << Qt::dec << ") state:" << state() << "duration:" << duration() << "target:" << m_target << "value:" << m_value; } diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index bae57172d1..254b1af0a2 100644 --- a/src/quick/util/qquicksmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -313,7 +313,7 @@ void QSmoothedAnimation::init() void QSmoothedAnimation::debugAnimation(QDebug d) const { - d << "SmoothedAnimationJob(" << hex << (const void *) this << dec << ")" << "duration:" << userDuration + d << "SmoothedAnimationJob(" << Qt::hex << (const void *) this << Qt::dec << ")" << "duration:" << userDuration << "velocity:" << velocity << "target:" << target.object() << "property:" << target.name() << "to:" << to << "current velocity:" << trackVelocity; } diff --git a/src/quick/util/qquickspringanimation.cpp b/src/quick/util/qquickspringanimation.cpp index 9012d20f9a..6f03d24750 100644 --- a/src/quick/util/qquickspringanimation.cpp +++ b/src/quick/util/qquickspringanimation.cpp @@ -319,7 +319,7 @@ void QSpringAnimation::updateState(QAbstractAnimationJob::State newState, QAbstr void QSpringAnimation::debugAnimation(QDebug d) const { - d << "SpringAnimationJob(" << hex << (const void *) this << dec << ")" << "velocity:" << maxVelocity + d << "SpringAnimationJob(" << Qt::hex << (const void *) this << Qt::dec << ")" << "velocity:" << maxVelocity << "spring:" << spring << "damping:" << damping << "epsilon:" << epsilon << "modulus:" << modulus << "mass:" << mass << "target:" << target.object() << "property:" << target.name() << "to:" << to << "current velocity:" << velocity; diff --git a/src/quick/util/qquicktimeline.cpp b/src/quick/util/qquicktimeline.cpp index ac9f75979e..7ec7c827eb 100644 --- a/src/quick/util/qquicktimeline.cpp +++ b/src/quick/util/qquicktimeline.cpp @@ -723,7 +723,7 @@ void QQuickTimeLine::updateCurrentTime(int v) void QQuickTimeLine::debugAnimation(QDebug d) const { - d << "QuickTimeLine(" << hex << (const void *) this << dec << ")"; + d << "QuickTimeLine(" << Qt::hex << (const void *) this << Qt::dec << ")"; } bool operator<(const QPair &lhs, diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index db76f3e62a..b16bfee6a6 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -1085,14 +1085,14 @@ void QQuickWidgetPrivate::setRootObject(QObject *obj) root = sgItem; sgItem->setParentItem(offscreenWindow->contentItem()); } else if (qobject_cast(obj)) { - qWarning() << "QQuickWidget does not support using windows as a root item." << endl - << endl - << "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << endl; + qWarning() << "QQuickWidget does not support using windows as a root item." << Qt::endl + << Qt::endl + << "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << Qt::endl; } else { - qWarning() << "QQuickWidget only supports loading of root objects that derive from QQuickItem." << endl - << endl - << "Ensure your QML code is written for QtQuick 2, and uses a root that is or" << endl - << "inherits from QtQuick's Item (not a Timer, QtObject, etc)." << endl; + qWarning() << "QQuickWidget only supports loading of root objects that derive from QQuickItem." << Qt::endl + << Qt::endl + << "Ensure your QML code is written for QtQuick 2, and uses a root that is or" << Qt::endl + << "inherits from QtQuick's Item (not a Timer, QtObject, etc)." << Qt::endl; delete obj; root = nullptr; } diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index a91c181233..b5abe568aa 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -371,7 +371,7 @@ static bool saveUnitAsCpp(const QString &inputFileName, const QString &outputFil { QTextStream stream(&hexifiedData); const uchar *end = begin + size; - stream << hex; + stream << Qt::hex; int col = 0; for (const uchar *data = begin; data < end; ++data, ++col) { if (data > begin) diff --git a/tools/qmlpreview/qmlpreviewapplication.cpp b/tools/qmlpreview/qmlpreviewapplication.cpp index 17017dae77..2568425573 100644 --- a/tools/qmlpreview/qmlpreviewapplication.cpp +++ b/tools/qmlpreview/qmlpreviewapplication.cpp @@ -195,7 +195,7 @@ void QmlPreviewApplication::processFinished() void QmlPreviewApplication::logError(const QString &error) { QTextStream err(stderr); - err << "Error: " << error << endl; + err << "Error: " << error << Qt::endl; } void QmlPreviewApplication::logStatus(const QString &status) @@ -203,7 +203,7 @@ void QmlPreviewApplication::logStatus(const QString &status) if (!m_verbose) return; QTextStream err(stderr); - err << status << endl; + err << status << Qt::endl; } void QmlPreviewApplication::serveRequest(const QString &path) From 19138e6d99be019913153985b8041b7ca53342b5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Jul 2019 14:39:06 +0200 Subject: [PATCH 02/18] Fix QStaticPlugin Qt6 usage in test Also added QtQml import for Component.onCompleted. Change-Id: Ic54a7827c82b8dfd7a1b2f36af4d944bae54bdec Reviewed-by: Alexandru Croitor --- .../data/importsMixedQmlCppPlugin.2.qml | 1 + .../data/importsMixedQmlCppPlugin.qml | 1 + .../qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp | 23 +++++++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml index b13b2004c2..ba6bb3d7ac 100644 --- a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml +++ b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml @@ -1,5 +1,6 @@ import org.qtproject.AutoTestQmlMixedPluginType 1.5 import QtQuick 2.0 +import QtQml 2.0 Item { property bool test: false diff --git a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml index 563c0b28e3..f1268075c1 100644 --- a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml +++ b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml @@ -1,5 +1,6 @@ import org.qtproject.AutoTestQmlMixedPluginType 1.0 import QtQuick 2.0 +import QtQml 2.0 Item { property bool test: false diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp index 97ca3fa1de..3148ffb5a5 100644 --- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp @@ -34,6 +34,10 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include +#include +#endif #if defined(Q_OS_MAC) // For _PC_CASE_SENSITIVE @@ -130,8 +134,7 @@ QByteArray SecondStaticPlugin::metaData; template void registerStaticPlugin(const char *uri) { - QStaticPlugin plugin; - plugin.instance = []() { + auto instanceFunctor = []() { static PluginType plugin; return static_cast(&plugin); }; @@ -142,12 +145,28 @@ void registerStaticPlugin(const char *uri) uris.append(uri); md.insert(QStringLiteral("uri"), uris); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + PluginType::metaData.append(QLatin1String("QTMETADATA !")); + PluginType::metaData.append(char(0)); // current version + PluginType::metaData.append(char(QT_VERSION_MAJOR)); + PluginType::metaData.append(char(QT_VERSION_MINOR)); + PluginType::metaData.append(char(qPluginArchRequirements())); + PluginType::metaData.append(QCborValue(QCborMap::fromJsonObject(md)).toCbor()); + + auto rawMetaDataFunctor = []() -> QPluginMetaData { + return {reinterpret_cast(PluginType::metaData.constData()), size_t(PluginType::metaData.length())}; + }; + QStaticPlugin plugin(instanceFunctor, rawMetaDataFunctor); +#else PluginType::metaData.append(QLatin1String("QTMETADATA ")); PluginType::metaData.append(QJsonDocument(md).toBinaryData()); + QStaticPlugin plugin; + plugin.instance = instanceFunctor; plugin.rawMetaData = []() { return PluginType::metaData.constData(); }; +#endif qRegisterStaticPluginFunction(plugin); }; From c0987d3923820c3dcd3849980fbd8095a37fcda4 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Jul 2019 13:01:56 +0200 Subject: [PATCH 03/18] Fix Qt6 builds after dev -> wip/qt6 merge Change-Id: I56b9d3abdbc6663a2d514f12aa20f2f574042bc1 Reviewed-by: Simon Hausmann --- src/imports/qtquick2/plugin.cpp | 1 + src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 2 +- tests/auto/quick/rendernode/tst_rendernode.cpp | 2 +- tests/auto/quick/shared/visualtestutil.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp index efa05c349c..6b44f782bd 100644 --- a/src/imports/qtquick2/plugin.cpp +++ b/src/imports/qtquick2/plugin.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include +#include #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 93981b9d6e..b5437ffb7e 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -2329,7 +2329,7 @@ void Renderer::uploadBatch(Batch *b) iDump << " -- Index Data, count:" << b->indexCount; for (int i=0; iindexCount; ++i) { if ((i % 24) == 0) - iDump << endl << " --- "; + iDump << Qt::endl << " --- "; iDump << id[i]; } } diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp index d862e51dfa..b6028079f3 100644 --- a/tests/auto/quick/rendernode/tst_rendernode.cpp +++ b/tests/auto/quick/rendernode/tst_rendernode.cpp @@ -195,7 +195,7 @@ static bool fuzzyCompareColor(QRgb x, QRgb y, QByteArray *errorMessage) enum { fuzz = 4 }; if (qAbs(qRed(x) - qRed(y)) >= fuzz || qAbs(qGreen(x) - qGreen(y)) >= fuzz || qAbs(qBlue(x) - qBlue(y)) >= fuzz) { QString s; - QDebug(&s).nospace() << hex << "Color mismatch 0x" << x << " 0x" << y << dec << " (fuzz=" << fuzz << ")."; + QDebug(&s).nospace() << Qt::hex << "Color mismatch 0x" << x << " 0x" << y << Qt::dec << " (fuzz=" << fuzz << ")."; *errorMessage = s.toLocal8Bit(); return false; } diff --git a/tests/auto/quick/shared/visualtestutil.cpp b/tests/auto/quick/shared/visualtestutil.cpp index de2cf2bd5b..06f7386902 100644 --- a/tests/auto/quick/shared/visualtestutil.cpp +++ b/tests/auto/quick/shared/visualtestutil.cpp @@ -95,7 +95,7 @@ bool QQuickVisualTestUtil::compareImages(const QImage &ia, const QImage &ib, QSt || qAbs(qRed(a) - qRed(b)) > tolerance || qAbs(qRed(a) - qRed(b)) > tolerance) { QDebug(errorMessage) << "Mismatch at:" << x << y << ':' - << hex << showbase << a << b; + << Qt::hex << Qt::showbase << a << b; return false; } } From 38bbe49815df7b4ef8a035a76db582c7b7948839 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Jul 2019 09:06:32 +0200 Subject: [PATCH 04/18] Bump qtdeclarative version to 6.0.0 Change-Id: I6bf9b4d99eae600d05ff8c80f71d4bd02b27d54f Reviewed-by: Simon Hausmann Reviewed-by: Qt CI Bot --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 076c5b7874..2f6f96de99 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,4 +4,4 @@ CONFIG += warning_clean DEFINES += QT_NO_LINKED_LIST DEFINES += QT_NO_JAVA_STYLE_ITERATORS -MODULE_VERSION = 5.14.0 +MODULE_VERSION = 6.0.0 From b5d18be5a03406d0aac83856dd41e1525fd14a28 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 5 Jul 2019 16:45:34 +0200 Subject: [PATCH 05/18] Do minimal fixup of QQuickImageProvider This change removes ifdefs around the methods in QQuickImageProvider, to allow building qtdeclarative both in Qt5 and Qt6. QQuickImageProvideWithOptions still needs to be fixed properly. Amends 9c50216c7bbbdb2bb51d4485286bf09e12fb5b62. Change-Id: Id1c64f05139f872c704d732d8fe081a70de6b201 Reviewed-by: Alexandru Croitor Reviewed-by: Simon Hausmann --- src/quick/util/qquickimageprovider.h | 14 +++----------- src/quick/util/qquickpixmapcache_p.h | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/quick/util/qquickimageprovider.h b/src/quick/util/qquickimageprovider.h index 82d0501697..f3dba81446 100644 --- a/src/quick/util/qquickimageprovider.h +++ b/src/quick/util/qquickimageprovider.h @@ -92,9 +92,11 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_finished()) }; +class QQuickImageProviderOptions; + class Q_QUICK_EXPORT QQuickImageProvider : public QQmlImageProviderBase { - friend class QQuickImageProviderWithOptions; // ### Qt 6 Remove + friend class QQuickImageProviderWithOptions; public: QQuickImageProvider(ImageType type, Flags flags = Flags()); ~QQuickImageProvider() override; @@ -102,15 +104,9 @@ public: ImageType imageType() const override; Flags flags() const override; -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) - virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options); - virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options); - virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize, const QQuickImageProviderOptions &options); -#else virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize); virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize); virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize); -#endif private: QQuickImageProviderPrivate *d; @@ -122,11 +118,7 @@ public: QQuickAsyncImageProvider(); ~QQuickAsyncImageProvider() override; -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) - virtual QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize, const QQuickImageProviderOptions &options) = 0; -#else virtual QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) = 0; -#endif private: QQuickAsyncImageProviderPrivate *d; diff --git a/src/quick/util/qquickpixmapcache_p.h b/src/quick/util/qquickpixmapcache_p.h index 91fb1ed3bb..f51b65dd76 100644 --- a/src/quick/util/qquickpixmapcache_p.h +++ b/src/quick/util/qquickpixmapcache_p.h @@ -188,8 +188,8 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPixmap::Options) -// This class will disappear with Qt6 and will just be the regular QQuickImageProvider -// ### Qt 6: Remove this class and fold it with QQuickImageProvider +// ### Qt 6: This should be made public in Qt 6. It's functionality can't be merged into +// QQuickImageProvider without breaking source compatibility. class Q_QUICK_PRIVATE_EXPORT QQuickImageProviderWithOptions : public QQuickAsyncImageProvider { public: From c433b78660923b6268653b437a2a04078de0f058 Mon Sep 17 00:00:00 2001 From: Aapo Keskimolo Date: Wed, 3 Jul 2019 10:52:41 +0300 Subject: [PATCH 06/18] Add initial dependencies.yaml Change-Id: I5921311b64cf4c7d11fe1743f446f0ad3874359f Reviewed-by: Simon Hausmann --- dependencies.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 dependencies.yaml diff --git a/dependencies.yaml b/dependencies.yaml new file mode 100644 index 0000000000..ac5797762b --- /dev/null +++ b/dependencies.yaml @@ -0,0 +1,7 @@ +dependencies: +- ../qtbase.git: + ref: f955bd8ced8b93d142b7f755665946424c6d3644 + required: true +- ../qtsvg.git: + ref: 4b186657ef09634c082b03570624288cf7c1baba + required: false From c147b20a2c1299b2d659fe7c9472ae3866b6a425 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 12 Jul 2019 22:04:01 +0200 Subject: [PATCH 07/18] Fix module imports when building with Qt Version 6.0.0 For modules such as QtQuick we register 2.$QT_VERSION_MINOR to allow our users to simply use the latest "Qt version" with their imports. When switching to version 6.0.0, code that used import QtQuick 5.13 would stop working because we had some types registered to say minor version 10 but nothing after that, and the qmlRegisterModule() call would use QT_VERSION_MINOR, which is now zero. Therefore in this Qt 6 branch, let's stick to the latest Qt 5 release planned, to maintain compatibility. Change-Id: I174be32cef8de152cd32010156ae716bd474397c Reviewed-by: Ulf Hermann Reviewed-by: Fabian Kosmale --- src/imports/folderlistmodel/plugin.cpp | 3 +-- src/imports/layouts/plugin.cpp | 3 +-- src/imports/localstorage/plugin.cpp | 3 +-- src/imports/models/plugin.cpp | 3 +-- src/imports/particles/plugin.cpp | 3 +-- src/imports/qtqml/plugin.cpp | 3 +-- src/imports/qtquick2/plugin.cpp | 3 +-- src/imports/shapes/plugin.cpp | 3 +-- src/imports/statemachine/plugin.cpp | 3 +-- src/imports/testlib/main.cpp | 3 +-- src/imports/wavefrontmesh/plugin.cpp | 3 +-- src/imports/window/plugin.cpp | 3 +-- src/imports/workerscript/plugin.cpp | 3 +-- src/quick/items/qquickitemsmodule.cpp | 3 +-- 14 files changed, 14 insertions(+), 28 deletions(-) diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp index 31cd793737..40968d5e1d 100644 --- a/src/imports/folderlistmodel/plugin.cpp +++ b/src/imports/folderlistmodel/plugin.cpp @@ -60,8 +60,7 @@ public: qmlRegisterType(uri,2,1,"FolderListModel"); qmlRegisterType(uri,2,2,"FolderListModel"); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + qmlRegisterModule(uri, 2, 15); // revision in Qt 5.11: added status property qmlRegisterType(uri, 2, 11, "FolderListModel"); diff --git a/src/imports/layouts/plugin.cpp b/src/imports/layouts/plugin.cpp index d28109c3cf..03a2c8fd00 100644 --- a/src/imports/layouts/plugin.cpp +++ b/src/imports/layouts/plugin.cpp @@ -67,8 +67,7 @@ public: QStringLiteral("Do not create objects of type Layout")); qmlRegisterRevision(uri, 1, 1); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 1, QT_VERSION_MINOR); + qmlRegisterModule(uri, 1, 15); } }; //![class decl] diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 9004d1ee6f..740a394fa0 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -825,8 +825,7 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.LocalStorage")); qmlRegisterSingletonType(uri, 2, 0, "LocalStorage", module_api_factory); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + qmlRegisterModule(uri, 2, 15); } }; diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp index 9fe63412f3..fd99f243b0 100644 --- a/src/imports/models/plugin.cpp +++ b/src/imports/models/plugin.cpp @@ -77,8 +77,7 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.Models")); QQmlModelsModule::defineModule(); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + qmlRegisterModule(uri, 2, 15); } }; //![class decl] diff --git a/src/imports/particles/plugin.cpp b/src/imports/particles/plugin.cpp index 26fd979133..704eb0ffbe 100644 --- a/src/imports/particles/plugin.cpp +++ b/src/imports/particles/plugin.cpp @@ -56,8 +56,7 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Particles")); QQuickParticlesModule::defineModule(); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + qmlRegisterModule(uri, 2, 15); } }; //![class decl] diff --git a/src/imports/qtqml/plugin.cpp b/src/imports/qtqml/plugin.cpp index 7595d6d65b..04cc2cc082 100644 --- a/src/imports/qtqml/plugin.cpp +++ b/src/imports/qtqml/plugin.cpp @@ -80,8 +80,7 @@ public: QQmlModelsModule::registerQmlTypes(); #endif - // Auto-increment the import to stay in sync with ALL future QtQml minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + qmlRegisterModule(uri, 2, 15); } }; //![class decl] diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp index 6b44f782bd..6c9d08e379 100644 --- a/src/imports/qtquick2/plugin.cpp +++ b/src/imports/qtquick2/plugin.cpp @@ -73,8 +73,7 @@ public: #endif QQmlQtQuick2Module::defineModule(); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule("QtQuick", 2, QT_VERSION_MINOR); + qmlRegisterModule("QtQuick", 2, 15); } ~QtQuick2Plugin() override diff --git a/src/imports/shapes/plugin.cpp b/src/imports/shapes/plugin.cpp index 0679a70630..6197b2fdf5 100644 --- a/src/imports/shapes/plugin.cpp +++ b/src/imports/shapes/plugin.cpp @@ -64,8 +64,7 @@ public: qmlRegisterType(uri, 1, 0, "RadialGradient"); qmlRegisterType(uri, 1, 0, "ConicalGradient"); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions - qmlRegisterModule(uri, 1, QT_VERSION_MINOR); + qmlRegisterModule(uri, 1, 15); // revision in Qt 5.11: added containsMode property qmlRegisterType(uri, 1, 11, "Shape"); diff --git a/src/imports/statemachine/plugin.cpp b/src/imports/statemachine/plugin.cpp index bf7499b31a..0ec2c353fc 100644 --- a/src/imports/statemachine/plugin.cpp +++ b/src/imports/statemachine/plugin.cpp @@ -69,8 +69,7 @@ public: qmlRegisterType(uri, 1, 0, "TimeoutTransition"); qmlProtectModule(uri, 1); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 1, QT_VERSION_MINOR); + qmlRegisterModule(uri, 1, 15); } }; diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index fbaf3bc4e2..c5873c1058 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -152,8 +152,7 @@ public: qmlRegisterType(uri,1,0,"TestUtil"); qmlRegisterType(); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 1, QT_VERSION_MINOR); + qmlRegisterModule(uri, 1, 15); } }; diff --git a/src/imports/wavefrontmesh/plugin.cpp b/src/imports/wavefrontmesh/plugin.cpp index 1a266b7e36..c695b5d19c 100644 --- a/src/imports/wavefrontmesh/plugin.cpp +++ b/src/imports/wavefrontmesh/plugin.cpp @@ -59,8 +59,7 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.wavefrontmesh")); qmlRegisterType(uri, 1, 0, "WavefrontMesh"); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.12 onward - qmlRegisterModule(uri, 1, QT_VERSION_MINOR); + qmlRegisterModule(uri, 1, 15); } }; diff --git a/src/imports/window/plugin.cpp b/src/imports/window/plugin.cpp index dfe1dcf62e..a331708e87 100644 --- a/src/imports/window/plugin.cpp +++ b/src/imports/window/plugin.cpp @@ -71,8 +71,7 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Window")); QQuickWindowModule::defineModule(); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + qmlRegisterModule(uri, 2, 15); } }; //![class decl] diff --git a/src/imports/workerscript/plugin.cpp b/src/imports/workerscript/plugin.cpp index 5b3bff7934..2d8797db7e 100644 --- a/src/imports/workerscript/plugin.cpp +++ b/src/imports/workerscript/plugin.cpp @@ -71,8 +71,7 @@ public: QQmlWorkerScriptModule::defineModule(); - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + qmlRegisterModule(uri, 2, 15); } }; diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 15a417a8b4..e6090e66ba 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -180,8 +180,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) QQmlPrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent }; QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent); - // Register the latest version, even if there are no new types or new revisions for existing types yet. - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + qmlRegisterModule(uri, 2, 15); #if !QT_CONFIG(quick_animatedimage) qmlRegisterTypeNotAvailable(uri,major,minor,"AnimatedImage", QCoreApplication::translate("QQuickAnimatedImage","Qt was built without support for QMovie")); From af1c5e013733b660bc5d813d92e55f2e6d009e4a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 12 Jul 2019 22:07:37 +0200 Subject: [PATCH 08/18] Fix import of ListModel/ListElement as part of QtQml ListElement and ListModel were available in Qt 5 since minor version 0 in QtQml and since minor version 1 in QtQml.Models. So one had to either write "import QtQml 2.0" or "import QtQml.Models 2.1". Since the explicit registration in QtQml is gone and to be replaced with an implicit dependency that loads QtQml.Models when loading QtQml, with the same minor version, we need to lower the minor version to 0 for both. This is unlikley to cause any harm as previously import QtQml.Models 2.0 would not produce any types. Change-Id: Iff7c4a1c1b35e4c9d930aa45dd678d8e2d5c823c Reviewed-by: Fabian Kosmale Reviewed-by: Ulf Hermann --- src/qmlmodels/qqmlmodelsmodule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qmlmodels/qqmlmodelsmodule.cpp b/src/qmlmodels/qqmlmodelsmodule.cpp index 2db5dd834f..364c2407ab 100644 --- a/src/qmlmodels/qqmlmodelsmodule.cpp +++ b/src/qmlmodels/qqmlmodelsmodule.cpp @@ -102,8 +102,8 @@ void QQmlModelsModule::defineModule() const char uri[] = "QtQml.Models"; #if QT_CONFIG(qml_list_model) - qmlRegisterType(uri, 2, 1, "ListElement"); - qmlRegisterCustomType(uri, 2, 1, "ListModel", new QQmlListModelParser); + qmlRegisterType(uri, 2, 0, "ListElement"); + qmlRegisterCustomType(uri, 2, 0, "ListModel", new QQmlListModelParser); #endif #if QT_CONFIG(qml_delegate_model) qmlRegisterType(uri, 2, 1, "DelegateModel"); From 8534634bd204ccdca3edcc244a35be6e81739fce Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 12 Jul 2019 22:10:24 +0200 Subject: [PATCH 09/18] Fix module compatibility with Qt 5 Importing QtQuick 2.x should make all QtQml types, including models and worker script available as well. The same goes for QtQml, which imports QtQml.Models and WorkerScript. Change-Id: I47acff2dd39495a42095270d1fd07e9c8921fb62 Reviewed-by: Fabian Kosmale Reviewed-by: Alexandru Croitor --- src/imports/qtqml/qmldir | 3 +++ src/imports/qtquick2/qmldir | 1 + src/imports/workerscript/qmldir | 1 + 3 files changed, 5 insertions(+) diff --git a/src/imports/qtqml/qmldir b/src/imports/qtqml/qmldir index f6b51c7970..a8adb2010d 100644 --- a/src/imports/qtqml/qmldir +++ b/src/imports/qtqml/qmldir @@ -2,3 +2,6 @@ module QtQml plugin qmlplugin classname QtQmlPlugin typeinfo plugins.qmltypes +import QtQml.Models +import QtQml.WorkerScript +designersupported diff --git a/src/imports/qtquick2/qmldir b/src/imports/qtquick2/qmldir index 8167e813df..d74aabd9e9 100644 --- a/src/imports/qtquick2/qmldir +++ b/src/imports/qtquick2/qmldir @@ -3,3 +3,4 @@ plugin qtquick2plugin classname QtQuick2Plugin typeinfo plugins.qmltypes designersupported +import QtQml diff --git a/src/imports/workerscript/qmldir b/src/imports/workerscript/qmldir index 1606400a23..02ff9ea188 100644 --- a/src/imports/workerscript/qmldir +++ b/src/imports/workerscript/qmldir @@ -1,3 +1,4 @@ module QtQml.WorkerScript plugin workerscriptplugin classname QtQmlWorkerScriptPlugin +designersupported From af3438cf29925bfcf4ff1a8fa04276580b66ce37 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 22 Jul 2019 14:04:07 +0200 Subject: [PATCH 10/18] Fix imports of Package and Instantiator with Qt 6 This change amends commit af1c5e013733b660bc5d813d92e55f2e6d009e4a and synchronizes the minor type version of Package and Instantiator to match Qt 5. Change-Id: I2e25a8b7c79edcf483f4f4e072293c0627f8ec94 Reviewed-by: Fabian Kosmale Reviewed-by: Alexandru Croitor --- src/qmlmodels/qqmlmodelsmodule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qmlmodels/qqmlmodelsmodule.cpp b/src/qmlmodels/qqmlmodelsmodule.cpp index 364c2407ab..27f5623b8c 100644 --- a/src/qmlmodels/qqmlmodelsmodule.cpp +++ b/src/qmlmodels/qqmlmodelsmodule.cpp @@ -108,12 +108,12 @@ void QQmlModelsModule::defineModule() #if QT_CONFIG(qml_delegate_model) qmlRegisterType(uri, 2, 1, "DelegateModel"); qmlRegisterType(uri, 2, 1, "DelegateModelGroup"); - qmlRegisterType(uri, 2, 14, "Package"); + qmlRegisterType(uri, 2, 0, "Package"); #endif #if QT_CONFIG(qml_object_model) qmlRegisterType(uri, 2, 1, "ObjectModel"); qmlRegisterType(uri, 2, 3, "ObjectModel"); - qmlRegisterType(uri, 2, 14, "Instantiator"); + qmlRegisterType(uri, 2, 1, "Instantiator"); qmlRegisterType(); #endif #if QT_CONFIG(itemmodel) From 487d22bcde7e9d06162d44e7c5dca31d3afac694 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 22 Jul 2019 09:56:51 +0200 Subject: [PATCH 11/18] Remove module registration related Qt version #ifdefs Ahead of compiling declarative with a newer qtbase that bumps the Qt version to 6, we can already now remove the Qt 5 code paths related to type registrations as commit 8534634bd204ccdca3edcc244a35be6e81739fce implements those dependencies differently. This also required lowering the minimum minor version for the Instantiator to 1, as it was in the Qt 5 branch. Change-Id: Idd38c967eeb8423509237116803d292bba422f8b Reviewed-by: Qt CI Bot Reviewed-by: Fabian Kosmale Reviewed-by: Alexandru Croitor --- src/imports/qtqml/plugin.cpp | 8 ----- src/imports/qtquick2/plugin.cpp | 15 -------- src/qml/qml/qqmlengine.cpp | 24 ------------- src/qml/qml/qqmlengine_p.h | 3 -- src/qmlmodels/qqmlmodelsmodule.cpp | 35 ------------------- src/qmlmodels/qqmlmodelsmodule_p.h | 5 --- .../qqmlworkerscriptmodule.cpp | 11 ------ .../qqmlworkerscriptmodule_p.h | 3 -- 8 files changed, 104 deletions(-) diff --git a/src/imports/qtqml/plugin.cpp b/src/imports/qtqml/plugin.cpp index 04cc2cc082..f63e04c3b9 100644 --- a/src/imports/qtqml/plugin.cpp +++ b/src/imports/qtqml/plugin.cpp @@ -42,10 +42,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#endif - QT_BEGIN_NAMESPACE /*! @@ -76,10 +72,6 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml")); QQmlEnginePrivate::defineModule(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QQmlModelsModule::registerQmlTypes(); -#endif - qmlRegisterModule(uri, 2, 15); } }; diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp index 6c9d08e379..1b14e9f0e5 100644 --- a/src/imports/qtquick2/plugin.cpp +++ b/src/imports/qtquick2/plugin.cpp @@ -40,14 +40,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#include -#if QT_CONFIG(qml_worker_script) -#include -#endif -#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - #include QT_BEGIN_NAMESPACE @@ -64,13 +56,6 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick")); Q_UNUSED(uri); moduleDefined = true; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QQmlEnginePrivate::registerQuickTypes(); - QQmlModelsModule::registerQuickTypes(); -#if QT_CONFIG(qml_worker_script) - QQmlWorkerScriptModule::registerQuickTypes(); -#endif -#endif QQmlQtQuick2Module::defineModule(); qmlRegisterModule("QtQuick", 2, 15); diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 00d2a6b502..43c312812c 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -220,30 +220,6 @@ void QQmlEnginePrivate::defineModule() #endif } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -void QQmlEnginePrivate::registerQuickTypes() -{ - // Don't add anything here. These are only for backwards compatibility. - - const char uri[] = "QtQuick"; - - qmlRegisterType(uri, 2, 0, "Component"); - qmlRegisterType(uri, 2, 0, "QtObject"); - qmlRegisterType(uri, 2, 0, "Binding"); - qmlRegisterType(uri, 2, 8, "Binding"); - qmlRegisterCustomType(uri, 2, 0, "Connections", new QQmlConnectionsParser); - qmlRegisterCustomType(uri, 2, 7, "Connections", new QQmlConnectionsParser); -#if QT_CONFIG(qml_animation) - qmlRegisterType(uri, 2, 0,"Timer"); -#endif - qmlRegisterType(uri, 2, 8, "LoggingCategory"); - qmlRegisterType(uri, 2, 12, "LoggingCategory"); -#if QT_CONFIG(qml_locale) - qmlRegisterUncreatableType(uri, 2, 0, "Locale", QQmlEngine::tr("Locale cannot be instantiated. Use Qt.locale()")); -#endif -} -#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - bool QQmlEnginePrivate::designerMode() { return s_designerMode; diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h index 385ae02ce5..2c4bb36c8f 100644 --- a/src/qml/qml/qqmlengine_p.h +++ b/src/qml/qml/qqmlengine_p.h @@ -252,9 +252,6 @@ public: static QList qmlErrorFromDiagnostics(const QString &fileName, const QList &diagnosticMessages); static void defineModule(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - static void registerQuickTypes(); -#endif static bool designerMode(); static void activateDesignerMode(); diff --git a/src/qmlmodels/qqmlmodelsmodule.cpp b/src/qmlmodels/qqmlmodelsmodule.cpp index 27f5623b8c..5195f9baad 100644 --- a/src/qmlmodels/qqmlmodelsmodule.cpp +++ b/src/qmlmodels/qqmlmodelsmodule.cpp @@ -62,41 +62,6 @@ QT_BEGIN_NAMESPACE -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - -void QQmlModelsModule::registerQmlTypes() -{ - // Don't add anything here. These are only for backwards compatibility. -#if QT_CONFIG(qml_object_model) - qmlRegisterType("QtQml", 2, 1, "Instantiator"); // Only available in >= 2.1 - qmlRegisterType(); -#endif -} - -void QQmlModelsModule::registerQuickTypes() -{ - // Don't add anything here. These are only for backwards compatibility. - - const char uri[] = "QtQuick"; - -#if QT_CONFIG(qml_object_model) - qmlRegisterType(uri, 2, 1, "Instantiator"); - qmlRegisterType(); - qmlRegisterType(uri, 2, 0, "VisualItemModel"); -#endif -#if QT_CONFIG(qml_list_model) - qmlRegisterType(uri, 2, 0, "ListElement"); - qmlRegisterCustomType(uri, 2, 0, "ListModel", new QQmlListModelParser); -#endif -#if QT_CONFIG(qml_delegate_model) - qmlRegisterType(uri, 2, 0, "VisualDataModel"); - qmlRegisterType(uri, 2, 0, "VisualDataGroup"); - qmlRegisterType(uri, 2, 0, "Package"); -#endif -} - -#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void QQmlModelsModule::defineModule() { const char uri[] = "QtQml.Models"; diff --git a/src/qmlmodels/qqmlmodelsmodule_p.h b/src/qmlmodels/qqmlmodelsmodule_p.h index 7e02578db9..f63052b682 100644 --- a/src/qmlmodels/qqmlmodelsmodule_p.h +++ b/src/qmlmodels/qqmlmodelsmodule_p.h @@ -58,11 +58,6 @@ QT_BEGIN_NAMESPACE class Q_QMLMODELS_PRIVATE_EXPORT QQmlModelsModule { public: -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - static void registerQmlTypes(); - static void registerQuickTypes(); -#endif - static void defineModule(); static void defineLabsModule(); }; diff --git a/src/qmlworkerscript/qqmlworkerscriptmodule.cpp b/src/qmlworkerscript/qqmlworkerscriptmodule.cpp index 98e82dbeba..5eb7d306bc 100644 --- a/src/qmlworkerscript/qqmlworkerscriptmodule.cpp +++ b/src/qmlworkerscript/qqmlworkerscriptmodule.cpp @@ -42,17 +42,6 @@ QT_BEGIN_NAMESPACE -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - -void QQmlWorkerScriptModule::registerQuickTypes() -{ - // Don't add anything here. These are only for backwards compatibility. - const char uri[] = "QtQuick"; - qmlRegisterType(uri, 2, 0, "WorkerScript"); -} - -#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void QQmlWorkerScriptModule::defineModule() { const char uri[] = "QtQml.WorkerScript"; diff --git a/src/qmlworkerscript/qqmlworkerscriptmodule_p.h b/src/qmlworkerscript/qqmlworkerscriptmodule_p.h index a2efb304c1..ae52d10c16 100644 --- a/src/qmlworkerscript/qqmlworkerscriptmodule_p.h +++ b/src/qmlworkerscript/qqmlworkerscriptmodule_p.h @@ -58,9 +58,6 @@ QT_BEGIN_NAMESPACE class Q_QMLWORKERSCRIPT_PRIVATE_EXPORT QQmlWorkerScriptModule { public: -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - static void registerQuickTypes(); -#endif static void defineModule(); }; From ad4960b40461c8b83599fe71540086182adecb10 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 26 Jul 2019 10:40:22 +0200 Subject: [PATCH 12/18] Restore compatibility with Qt 5 for VisualDataModel/DataModelGroup This change amends commit af3438cf29925bfcf4ff1a8fa04276580b66ce37 by fixing the visibility of not only Package but also VisualDataModel and VisualDataModelGroup. This is a prospective fix for various failures in qtlocation. Change-Id: I831422fa5d87c4cbaf45a5d766a77ba150d932da Reviewed-by: Alexandru Croitor --- src/qmlmodels/qqmlmodelsmodule.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qmlmodels/qqmlmodelsmodule.cpp b/src/qmlmodels/qqmlmodelsmodule.cpp index 5195f9baad..884b7f78b2 100644 --- a/src/qmlmodels/qqmlmodelsmodule.cpp +++ b/src/qmlmodels/qqmlmodelsmodule.cpp @@ -71,6 +71,8 @@ void QQmlModelsModule::defineModule() qmlRegisterCustomType(uri, 2, 0, "ListModel", new QQmlListModelParser); #endif #if QT_CONFIG(qml_delegate_model) + qmlRegisterType(uri, 2, 0, "VisualDataModel"); + qmlRegisterType(uri, 2, 0, "VisualDataGroup"); qmlRegisterType(uri, 2, 1, "DelegateModel"); qmlRegisterType(uri, 2, 1, "DelegateModelGroup"); qmlRegisterType(uri, 2, 0, "Package"); From 013a1ae4e7e5df36e03ccf71f02ad6644473a3e8 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 31 Jul 2019 13:20:29 +0200 Subject: [PATCH 13/18] Fix build with Qt 6 The #warning directive is non-standard and doesn't compile with non-GCC. Meanwhile, a setter was added for this property and it appears to be used from public QQuickPaintedItem API. Change-Id: Id4150f6a8045d1e9e9245ebc3213f5e9b9f4bb59 Reviewed-by: Alexandru Croitor --- src/quick/scenegraph/util/qsgdefaultpainternode_p.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h index a86f7397be..dc103648ff 100644 --- a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h +++ b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h @@ -159,9 +159,6 @@ private: QSize m_textureSize; QRect m_dirtyRect; QColor m_fillColor; -#if QT_VERSION >= 0x060000 -#warning "Remove m_contentsScale and assume 1 everywhere" -#endif qreal m_contentsScale; bool m_dirtyContents : 1; From ebd287fd035dda9d4fea9b73d0ae5af2b2e16e06 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 31 Jul 2019 18:33:20 +0200 Subject: [PATCH 14/18] Fix Qt6 build Amends 013a1ae4e7e5df36e03ccf71f02ad6644473a3e8 Change-Id: I4b8ed9cf80f8715424346fd4b81fb4bc5e54bfbc Reviewed-by: Simon Hausmann --- src/quick/items/qquickpainteditem.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp index 57848919f3..cee73ac2e8 100644 --- a/src/quick/items/qquickpainteditem.cpp +++ b/src/quick/items/qquickpainteditem.cpp @@ -369,10 +369,6 @@ void QQuickPaintedItem::setTextureSize(const QSize &size) emit textureSizeChanged(); } -#if QT_VERSION >= 0x060000 -#warning "Remove: QQuickPaintedItem::contentsBoundingRect, contentsScale, contentsSize. Also remove them from qsgadaptationlayer_p.h and qsgdefaultpainternode.h/cpp." -#endif - /*! \obsolete From b00b6a2a868f4ecffe538f6bd1d3ef399f0f5918 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 6 Aug 2019 15:00:45 +0200 Subject: [PATCH 15/18] Fix tests in qtquickcontrols 1 and 2 This patch partially reverts the 5.15 related #ifdefs from commit f38e071f5b353cbf9ce6c6c104bd82099ae0aa14. Those were introduced without any test coverage and our own modules (qtquickcontrols 1 and 2) were not tested with it or adapted. The change of behavior breaks our own existing code. Task-number: QTBUG-33444 Change-Id: Ie9823638c1a02281798b725f745b15e622f837c5 Reviewed-by: Alexandru Croitor Reviewed-by: Fabian Kosmale (cherry picked from commit c273175ffec925a4164de41a79c21d785a1761a7) Reviewed-by: Simon Hausmann --- src/qml/types/qqmlbind.cpp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp index 5067b6a02e..4b60108597 100644 --- a/src/qml/types/qqmlbind.cpp +++ b/src/qml/types/qqmlbind.cpp @@ -70,12 +70,8 @@ public: , delayed(false) , pendingEval(false) , restoreBinding(true) -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) , restoreValue(false) , restoreModeExplicit(false) -#else - , restoreValue(true) -#endif {} ~QQmlBindPrivate() { } @@ -93,9 +89,7 @@ public: bool pendingEval:1; bool restoreBinding:1; bool restoreValue:1; -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) bool restoreModeExplicit:1; -#endif void validate(QObject *binding) const; void clearPrev(); @@ -365,8 +359,7 @@ void QQmlBind::setDelayed(bool delayed) \li Binding.RestoreBindingOrValue The original value is always restored. \list - \warning The default value is Binding.RestoreBinding. This will change in - Qt 5.15 to Binding.RestoreBindingOrValue. + The default value is Binding.RestoreBinding. If you rely on any specific behavior regarding the restoration of plain values when bindings get disabled you should migrate to explicitly set the @@ -392,9 +385,7 @@ void QQmlBind::setRestoreMode(RestorationMode newMode) if (newMode != restoreMode()) { d->restoreValue = (newMode & RestoreValue); d->restoreBinding = (newMode & RestoreBinding); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) d->restoreModeExplicit = true; -#endif emit restoreModeChanged(); } } @@ -465,27 +456,11 @@ void QQmlBind::eval() Q_ASSERT(vmemo); vmemo->setVMEProperty(propPriv->core.coreIndex(), *d->v4Value.valueRef()); d->clearPrev(); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - } else if (!d->restoreModeExplicit) { - qmlWarning(this) - << "Not restoring previous value because restoreMode has not been set." - << "This behavior is deprecated." - << "In Qt < 5.15 the default is Binding.RestoreBinding." - << "In Qt >= 5.15 the default is Binding.RestoreBindingOrValue."; -#endif } } else if (d->prevIsVariant) { if (d->restoreValue) { d->prop.write(d->prevValue); d->clearPrev(); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - } else if (!d->restoreModeExplicit) { - qmlWarning(this) - << "Not restoring previous value because restoreMode has not been set." - << "This behavior is deprecated." - << "In Qt < 5.15 the default is Binding.RestoreBinding." - << "In Qt >= 5.15 the default is Binding.RestoreBindingOrValue."; -#endif } } return; From 00bdbd1ed3d8565a09a32a2b80eb31abef661370 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 7 Aug 2019 14:25:17 +0200 Subject: [PATCH 16/18] Temporarily remove dependencies.yaml We'll re-add it after we get a working qt5.git wip/qt6 build. Change-Id: I13dcd5d427003ad3ea9547f2dfbded0c8c2f99cc Reviewed-by: Aapo Keskimolo Reviewed-by: Simon Hausmann --- dependencies.yaml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 dependencies.yaml diff --git a/dependencies.yaml b/dependencies.yaml deleted file mode 100644 index ac5797762b..0000000000 --- a/dependencies.yaml +++ /dev/null @@ -1,7 +0,0 @@ -dependencies: -- ../qtbase.git: - ref: f955bd8ced8b93d142b7f755665946424c6d3644 - required: true -- ../qtsvg.git: - ref: 4b186657ef09634c082b03570624288cf7c1baba - required: false From db8fc6e8541f132ad84f7d91a0c25ed3073d7afc Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 8 Aug 2019 15:34:46 +0200 Subject: [PATCH 17/18] Blacklist a failing test on MinGW 7.3 configuration and Qt 6.0 It's something to do with calling QQuickText::setElideMode(QQuickText::ElideRight) not causing a width change which the spy object expects to happen. I don't know why it happens, but it's the last thing preventing me from getting a working wip/qt6 branch, so I'm gonna blacklist the test on MinGW. Task-number: QTBUG-77394 Change-Id: Ia01e24f4e133c84ff44ce365595ad10292e845f9 Reviewed-by: Simon Hausmann --- tests/auto/quick/qquicktext/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/quick/qquicktext/BLACKLIST b/tests/auto/quick/qquicktext/BLACKLIST index 6c3c3af154..5909e988c0 100644 --- a/tests/auto/quick/qquicktext/BLACKLIST +++ b/tests/auto/quick/qquicktext/BLACKLIST @@ -4,3 +4,5 @@ qemu osx-10.12 [fontSizeMode] opensuse-42.1 +[contentSize] +win32 gcc From cb37a1d0c3fce7951f5d7f1fb4a04f90e038f01b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 9 Aug 2019 11:00:21 +0200 Subject: [PATCH 18/18] Fix the blacklisting of tst_qquicktext::contentSize The correct keyword set for blacklisting a test on mingw is "windows gcc" not "win32 gcc". Amends db8fc6e8541f132ad84f7d91a0c25ed3073d7afc Change-Id: Idad4c9370b7d4c09acde160e6053191df7ee1aad Reviewed-by: Simon Hausmann --- tests/auto/quick/qquicktext/BLACKLIST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/quick/qquicktext/BLACKLIST b/tests/auto/quick/qquicktext/BLACKLIST index 5909e988c0..594f9af3b3 100644 --- a/tests/auto/quick/qquicktext/BLACKLIST +++ b/tests/auto/quick/qquicktext/BLACKLIST @@ -5,4 +5,4 @@ osx-10.12 [fontSizeMode] opensuse-42.1 [contentSize] -win32 gcc +windows gcc