Merge "Merge remote-tracking branch 'origin/wip/qt6' into dev"

This commit is contained in:
Simon Hausmann 2019-09-19 08:52:38 +02:00
commit c65c87cf96
58 changed files with 123 additions and 224 deletions

View File

@ -4,4 +4,4 @@ CONFIG += warning_clean
DEFINES += QT_NO_LINKED_LIST DEFINES += QT_NO_LINKED_LIST
DEFINES += QT_NO_JAVA_STYLE_ITERATORS DEFINES += QT_NO_JAVA_STYLE_ITERATORS
MODULE_VERSION = 5.15.0 MODULE_VERSION = 6.0.0

View File

@ -60,8 +60,7 @@ public:
qmlRegisterType<QQuickFolderListModel,1>(uri,2,1,"FolderListModel"); qmlRegisterType<QQuickFolderListModel,1>(uri,2,1,"FolderListModel");
qmlRegisterType<QQuickFolderListModel,2>(uri,2,2,"FolderListModel"); qmlRegisterType<QQuickFolderListModel,2>(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, 15);
qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
// revision in Qt 5.11: added status property // revision in Qt 5.11: added status property
qmlRegisterType<QQuickFolderListModel,11>(uri, 2, 11, "FolderListModel"); qmlRegisterType<QQuickFolderListModel,11>(uri, 2, 11, "FolderListModel");

View File

@ -67,8 +67,7 @@ public:
QStringLiteral("Do not create objects of type Layout")); QStringLiteral("Do not create objects of type Layout"));
qmlRegisterRevision<QQuickGridLayoutBase, 1>(uri, 1, 1); qmlRegisterRevision<QQuickGridLayoutBase, 1>(uri, 1, 1);
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward qmlRegisterModule(uri, 1, 15);
qmlRegisterModule(uri, 1, QT_VERSION_MINOR);
} }
}; };
//![class decl] //![class decl]

View File

@ -825,8 +825,7 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.LocalStorage")); Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.LocalStorage"));
qmlRegisterSingletonType<QQuickLocalStorage>(uri, 2, 0, "LocalStorage", module_api_factory); qmlRegisterSingletonType<QQuickLocalStorage>(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, 15);
qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
} }
}; };

View File

@ -77,8 +77,7 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.Models")); Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.Models"));
QQmlModelsModule::defineModule(); QQmlModelsModule::defineModule();
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward qmlRegisterModule(uri, 2, 15);
qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
} }
}; };
//![class decl] //![class decl]

View File

@ -56,8 +56,7 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Particles")); Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Particles"));
QQuickParticlesModule::defineModule(); QQuickParticlesModule::defineModule();
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward qmlRegisterModule(uri, 2, 15);
qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
} }
}; };
//![class decl] //![class decl]

View File

@ -42,10 +42,6 @@
#include <QtQml/private/qqmlcomponentattached_p.h> #include <QtQml/private/qqmlcomponentattached_p.h>
#include <QtQml/private/qqmlbind_p.h> #include <QtQml/private/qqmlbind_p.h>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtQmlModels/private/qqmlmodelsmodule_p.h>
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
/*! /*!
@ -76,12 +72,7 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml")); Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml"));
QQmlEnginePrivate::defineModule(); QQmlEnginePrivate::defineModule();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) qmlRegisterModule(uri, 2, 15);
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);
} }
}; };
//![class decl] //![class decl]

View File

@ -2,3 +2,6 @@ module QtQml
plugin qmlplugin plugin qmlplugin
classname QtQmlPlugin classname QtQmlPlugin
typeinfo plugins.qmltypes typeinfo plugins.qmltypes
import QtQml.Models
import QtQml.WorkerScript
designersupported

View File

@ -38,14 +38,7 @@
****************************************************************************/ ****************************************************************************/
#include <QtQml/qqmlextensionplugin.h> #include <QtQml/qqmlextensionplugin.h>
#include <QtQml/QQmlEngine>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtQml/private/qqmlengine_p.h>
#include <QtQmlModels/private/qqmlmodelsmodule_p.h>
#if QT_CONFIG(qml_worker_script)
#include <QtQmlWorkerScript/private/qqmlworkerscriptmodule_p.h>
#endif
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <private/qtquick2_p.h> #include <private/qtquick2_p.h>
@ -63,17 +56,9 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick")); Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick"));
Q_UNUSED(uri); Q_UNUSED(uri);
moduleDefined = true; 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(); QQmlQtQuick2Module::defineModule();
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward qmlRegisterModule("QtQuick", 2, 15);
qmlRegisterModule("QtQuick", 2, QT_VERSION_MINOR);
} }
~QtQuick2Plugin() override ~QtQuick2Plugin() override

View File

@ -3,3 +3,4 @@ plugin qtquick2plugin
classname QtQuick2Plugin classname QtQuick2Plugin
typeinfo plugins.qmltypes typeinfo plugins.qmltypes
designersupported designersupported
import QtQml

View File

@ -64,8 +64,7 @@ public:
qmlRegisterType<QQuickShapeRadialGradient>(uri, 1, 0, "RadialGradient"); qmlRegisterType<QQuickShapeRadialGradient>(uri, 1, 0, "RadialGradient");
qmlRegisterType<QQuickShapeConicalGradient>(uri, 1, 0, "ConicalGradient"); qmlRegisterType<QQuickShapeConicalGradient>(uri, 1, 0, "ConicalGradient");
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions qmlRegisterModule(uri, 1, 15);
qmlRegisterModule(uri, 1, QT_VERSION_MINOR);
// revision in Qt 5.11: added containsMode property // revision in Qt 5.11: added containsMode property
qmlRegisterType<QQuickShape, 11>(uri, 1, 11, "Shape"); qmlRegisterType<QQuickShape, 11>(uri, 1, 11, "Shape");

View File

@ -69,8 +69,7 @@ public:
qmlRegisterType<TimeoutTransition>(uri, 1, 0, "TimeoutTransition"); qmlRegisterType<TimeoutTransition>(uri, 1, 0, "TimeoutTransition");
qmlProtectModule(uri, 1); qmlProtectModule(uri, 1);
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward qmlRegisterModule(uri, 1, 15);
qmlRegisterModule(uri, 1, QT_VERSION_MINOR);
} }
}; };

View File

@ -152,8 +152,7 @@ public:
qmlRegisterType<QuickTestUtil>(uri,1,0,"TestUtil"); qmlRegisterType<QuickTestUtil>(uri,1,0,"TestUtil");
qmlRegisterAnonymousType<QQuickTouchEventSequence>(uri, 1); qmlRegisterAnonymousType<QQuickTouchEventSequence>(uri, 1);
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward qmlRegisterModule(uri, 1, 15);
qmlRegisterModule(uri, 1, QT_VERSION_MINOR);
} }
}; };

View File

@ -59,8 +59,7 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.wavefrontmesh")); Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.wavefrontmesh"));
qmlRegisterType<QWavefrontMesh>(uri, 1, 0, "WavefrontMesh"); qmlRegisterType<QWavefrontMesh>(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, 15);
qmlRegisterModule(uri, 1, QT_VERSION_MINOR);
} }
}; };

View File

@ -71,8 +71,7 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Window")); Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Window"));
QQuickWindowModule::defineModule(); QQuickWindowModule::defineModule();
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward qmlRegisterModule(uri, 2, 15);
qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
} }
}; };
//![class decl] //![class decl]

View File

@ -71,8 +71,7 @@ public:
QQmlWorkerScriptModule::defineModule(); QQmlWorkerScriptModule::defineModule();
// Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward qmlRegisterModule(uri, 2, 15);
qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
} }
}; };

View File

@ -1,3 +1,4 @@
module QtQml.WorkerScript module QtQml.WorkerScript
plugin workerscriptplugin plugin workerscriptplugin
classname QtQmlWorkerScriptPlugin classname QtQmlWorkerScriptPlugin
designersupported

View File

@ -641,7 +641,7 @@ void QAbstractAnimationJob::removeAnimationChangeListener(QAnimationJobChangeLis
void QAbstractAnimationJob::debugAnimation(QDebug d) const 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(); << m_state << "duration:" << duration();
} }

View File

@ -120,7 +120,7 @@ void QContinuingAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimat
void QContinuingAnimationGroupJob::debugAnimation(QDebug d) const void QContinuingAnimationGroupJob::debugAnimation(QDebug d) const
{ {
d << "ContinuingAnimationGroupJob(" << hex << (const void *) this << dec << ")"; d << "ContinuingAnimationGroupJob(" << Qt::hex << (const void *) this << Qt::dec << ")";
debugChildren(d); debugChildren(d);
} }

View File

@ -239,7 +239,7 @@ void QParallelAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimatio
void QParallelAnimationGroupJob::debugAnimation(QDebug d) const void QParallelAnimationGroupJob::debugAnimation(QDebug d) const
{ {
d << "ParallelAnimationGroupJob(" << hex << (const void *) this << dec << ")"; d << "ParallelAnimationGroupJob(" << Qt::hex << (const void *) this << Qt::dec << ")";
debugChildren(d); debugChildren(d);
} }

View File

@ -67,7 +67,7 @@ void QPauseAnimationJob::updateCurrentTime(int)
void QPauseAnimationJob::debugAnimation(QDebug d) const 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 QT_END_NAMESPACE

View File

@ -426,7 +426,7 @@ void QSequentialAnimationGroupJob::animationRemoved(QAbstractAnimationJob *anim,
void QSequentialAnimationGroupJob::debugAnimation(QDebug d) const 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); debugChildren(d);
} }

View File

@ -120,7 +120,7 @@ static QString toString(QV4::ReturnedValue v)
static void dumpConstantTable(const StaticValue *constants, uint count) static void dumpConstantTable(const StaticValue *constants, uint count)
{ {
QDebug d = qDebug(); QDebug d = qDebug();
d.nospace() << right; d.nospace() << Qt::right;
for (uint i = 0; i < count; ++i) { for (uint i = 0; i < count; ++i) {
d << qSetFieldWidth(8) << i << qSetFieldWidth(0) << ": " d << qSetFieldWidth(8) << i << qSetFieldWidth(0) << ": "
<< toString(constants[i].asReturnedValue()).toUtf8().constData() << "\n"; << toString(constants[i].asReturnedValue()).toUtf8().constData() << "\n";

View File

@ -223,7 +223,8 @@ Chunk *MemorySegment::allocate(size_t size)
pageReservation.commit(candidate, size); pageReservation.commit(candidate, size);
for (uint i = 0; i < requiredChunks; ++i) for (uint i = 0; i < requiredChunks; ++i)
setBit(candidate - base + i); setBit(candidate - base + i);
DEBUG << "allocated chunk " << candidate << hex << size; DEBUG << "allocated chunk " << candidate << Qt::hex << size;
return candidate; return candidate;
} }
} }
@ -1024,7 +1025,7 @@ static size_t dumpBins(BlockAllocator *b, const char *title)
SDUMP() << " large slot map"; SDUMP() << " large slot map";
HeapItem *h = b->freeBins[BlockAllocator::NumBins - 1]; HeapItem *h = b->freeBins[BlockAllocator::NumBins - 1];
while (h) { while (h) {
SDUMP() << " " << hex << (quintptr(h)/32) << h->freeData.availableSlots; SDUMP() << " " << Qt::hex << (quintptr(h)/32) << h->freeData.availableSlots;
h = h->freeData.next; h = h->freeData.next;
} }

View File

@ -224,30 +224,6 @@ void QQmlEnginePrivate::defineModule()
#endif #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<QQmlComponent>(uri, 2, 0, "Component");
qmlRegisterType<QObject>(uri, 2, 0, "QtObject");
qmlRegisterType<QQmlBind>(uri, 2, 0, "Binding");
qmlRegisterType<QQmlBind, 8>(uri, 2, 8, "Binding");
qmlRegisterCustomType<QQmlConnections>(uri, 2, 0, "Connections", new QQmlConnectionsParser);
qmlRegisterCustomType<QQmlConnections, 3>(uri, 2, 7, "Connections", new QQmlConnectionsParser);
#if QT_CONFIG(qml_animation)
qmlRegisterType<QQmlTimer>(uri, 2, 0,"Timer");
#endif
qmlRegisterType<QQmlLoggingCategory>(uri, 2, 8, "LoggingCategory");
qmlRegisterType<QQmlLoggingCategory, 12>(uri, 2, 12, "LoggingCategory");
#if QT_CONFIG(qml_locale)
qmlRegisterUncreatableType<QQmlLocale>(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() bool QQmlEnginePrivate::designerMode()
{ {
return s_designerMode; return s_designerMode;

View File

@ -252,9 +252,6 @@ public:
static QList<QQmlError> qmlErrorFromDiagnostics(const QString &fileName, const QList<QQmlJS::DiagnosticMessage> &diagnosticMessages); static QList<QQmlError> qmlErrorFromDiagnostics(const QString &fileName, const QList<QQmlJS::DiagnosticMessage> &diagnosticMessages);
static void defineModule(); static void defineModule();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
static void registerQuickTypes();
#endif
static bool designerMode(); static bool designerMode();
static void activateDesignerMode(); static void activateDesignerMode();

View File

@ -62,28 +62,10 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void QQmlModelsModule::defineModule()
void QQmlModelsModule::registerQmlTypes()
{ {
// Don't add anything here. These are only for backwards compatibility. const char uri[] = "QtQml.Models";
#if QT_CONFIG(qml_object_model)
qmlRegisterType<QQmlInstantiator>("QtQml", 2, 1, "Instantiator"); // Only available in >= 2.1
qmlRegisterAnonymousType<QQmlInstanceModel>("QtQml", 2);
#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<QQmlInstantiator>(uri, 2, 1, "Instantiator");
qmlRegisterAnonymousType<QQmlInstanceModel>(uri, 2);
qmlRegisterType<QQmlObjectModel>(uri, 2, 0, "VisualItemModel");
#endif
#if QT_CONFIG(qml_list_model) #if QT_CONFIG(qml_list_model)
qmlRegisterType<QQmlListElement>(uri, 2, 0, "ListElement"); qmlRegisterType<QQmlListElement>(uri, 2, 0, "ListElement");
qmlRegisterCustomType<QQmlListModel>(uri, 2, 0, "ListModel", new QQmlListModelParser); qmlRegisterCustomType<QQmlListModel>(uri, 2, 0, "ListModel", new QQmlListModelParser);
@ -91,29 +73,14 @@ void QQmlModelsModule::registerQuickTypes()
#if QT_CONFIG(qml_delegate_model) #if QT_CONFIG(qml_delegate_model)
qmlRegisterType<QQmlDelegateModel>(uri, 2, 0, "VisualDataModel"); qmlRegisterType<QQmlDelegateModel>(uri, 2, 0, "VisualDataModel");
qmlRegisterType<QQmlDelegateModelGroup>(uri, 2, 0, "VisualDataGroup"); qmlRegisterType<QQmlDelegateModelGroup>(uri, 2, 0, "VisualDataGroup");
qmlRegisterType<QQuickPackage>(uri, 2, 0, "Package");
#endif
}
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void QQmlModelsModule::defineModule()
{
const char uri[] = "QtQml.Models";
#if QT_CONFIG(qml_list_model)
qmlRegisterType<QQmlListElement>(uri, 2, 1, "ListElement");
qmlRegisterCustomType<QQmlListModel>(uri, 2, 1, "ListModel", new QQmlListModelParser);
#endif
#if QT_CONFIG(qml_delegate_model)
qmlRegisterType<QQmlDelegateModel>(uri, 2, 1, "DelegateModel"); qmlRegisterType<QQmlDelegateModel>(uri, 2, 1, "DelegateModel");
qmlRegisterType<QQmlDelegateModelGroup>(uri, 2, 1, "DelegateModelGroup"); qmlRegisterType<QQmlDelegateModelGroup>(uri, 2, 1, "DelegateModelGroup");
qmlRegisterType<QQuickPackage>(uri, 2, 14, "Package"); qmlRegisterType<QQuickPackage>(uri, 2, 0, "Package");
#endif #endif
#if QT_CONFIG(qml_object_model) #if QT_CONFIG(qml_object_model)
qmlRegisterType<QQmlObjectModel>(uri, 2, 1, "ObjectModel"); qmlRegisterType<QQmlObjectModel>(uri, 2, 1, "ObjectModel");
qmlRegisterType<QQmlObjectModel,3>(uri, 2, 3, "ObjectModel"); qmlRegisterType<QQmlObjectModel,3>(uri, 2, 3, "ObjectModel");
qmlRegisterType<QQmlInstantiator>(uri, 2, 14, "Instantiator"); qmlRegisterType<QQmlInstantiator>(uri, 2, 1, "Instantiator");
qmlRegisterAnonymousType<QQmlInstanceModel>(uri, 2); qmlRegisterAnonymousType<QQmlInstanceModel>(uri, 2);
#endif #endif
#if QT_CONFIG(itemmodel) #if QT_CONFIG(itemmodel)

View File

@ -58,11 +58,6 @@ QT_BEGIN_NAMESPACE
class Q_QMLMODELS_PRIVATE_EXPORT QQmlModelsModule class Q_QMLMODELS_PRIVATE_EXPORT QQmlModelsModule
{ {
public: public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
static void registerQmlTypes();
static void registerQuickTypes();
#endif
static void defineModule(); static void defineModule();
static void defineLabsModule(); static void defineLabsModule();
}; };

View File

@ -42,17 +42,6 @@
QT_BEGIN_NAMESPACE 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<QQuickWorkerScript>(uri, 2, 0, "WorkerScript");
}
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void QQmlWorkerScriptModule::defineModule() void QQmlWorkerScriptModule::defineModule()
{ {
const char uri[] = "QtQml.WorkerScript"; const char uri[] = "QtQml.WorkerScript";

View File

@ -58,9 +58,6 @@ QT_BEGIN_NAMESPACE
class Q_QMLWORKERSCRIPT_PRIVATE_EXPORT QQmlWorkerScriptModule class Q_QMLWORKERSCRIPT_PRIVATE_EXPORT QQmlWorkerScriptModule
{ {
public: public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
static void registerQuickTypes();
#endif
static void defineModule(); static void defineModule();
}; };

View File

@ -289,7 +289,7 @@ void QQuickPinchHandler::handlePointerEventImpl(QQuickPointerEvent *event)
{ {
if (Q_UNLIKELY(lcPinchHandler().isDebugEnabled())) { if (Q_UNLIKELY(lcPinchHandler().isDebugEnabled())) {
for (const QQuickHandlerPoint &p : currentPoints()) 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); QQuickMultiPointHandler::handlePointerEventImpl(event);

View File

@ -249,7 +249,7 @@ bool QQuickPointerHandler::approveGrabTransition(QQuickEventPoint *point, QObjec
allowed = true; allowed = true;
} }
} }
qCDebug(lcPointerHandlerGrab) << "point" << hex << point->pointId() << "permission" << qCDebug(lcPointerHandlerGrab) << "point" << Qt::hex << point->pointId() << "permission" <<
QMetaEnum::fromType<GrabPermissions>().valueToKeys(grabPermissions()) << QMetaEnum::fromType<GrabPermissions>().valueToKeys(grabPermissions()) <<
':' << this << (allowed ? "approved to" : "denied to") << proposedGrabber; ':' << this << (allowed ? "approved to" : "denied to") << proposedGrabber;
return allowed; return allowed;
@ -473,7 +473,7 @@ bool QQuickPointerHandler::wantsPointerEvent(QQuickPointerEvent *event)
bool QQuickPointerHandler::wantsEventPoint(QQuickEventPoint *point) bool QQuickPointerHandler::wantsEventPoint(QQuickEventPoint *point)
{ {
bool ret = point->exclusiveGrabber() == this || point->passiveGrabbers().contains(this) || parentContains(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; << metaObject()->className() << objectName() << ret;
return ret; return ret;
} }

View File

@ -95,7 +95,7 @@ bool QQuickSinglePointHandler::wantsPointerEvent(QQuickPointerEvent *event)
} }
} }
if (missing) 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"; << "is missing from current event, but was neither canceled nor released";
if (point) { if (point) {
if (candidatePointCount == 1 || (candidatePointCount > 1 && d->ignoreAdditionalPoints)) { if (candidatePointCount == 1 || (candidatePointCount > 1 && d->ignoreAdditionalPoints)) {

View File

@ -851,7 +851,7 @@ void QQuickEventPoint::setGrabberItem(QQuickItem *grabber)
if (oldGrabberHandler && !oldGrabberHandler->approveGrabTransition(this, grabber)) if (oldGrabberHandler && !oldGrabberHandler->approveGrabTransition(this, grabber))
return; return;
if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { 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; << ": grab" << m_exclusiveGrabber << "->" << grabber;
} }
QQuickItem *oldGrabberItem = grabberItem(); QQuickItem *oldGrabberItem = grabberItem();
@ -892,10 +892,10 @@ void QQuickEventPoint::setGrabberPointerHandler(QQuickPointerHandler *grabber, b
if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) {
if (exclusive) { if (exclusive) {
if (m_exclusiveGrabber != grabber) 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; << ": grab (exclusive)" << m_exclusiveGrabber << "->" << grabber;
} else { } 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; << ": grab (passive)" << grabber;
} }
} }
@ -958,7 +958,7 @@ void QQuickEventPoint::cancelExclusiveGrabImpl(QTouchEvent *cancelEvent)
if (m_exclusiveGrabber.isNull()) if (m_exclusiveGrabber.isNull())
return; return;
if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { 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"; << ": grab (exclusive)" << m_exclusiveGrabber << "-> nullptr";
} }
if (auto handler = grabberPointerHandler()) { if (auto handler = grabberPointerHandler()) {
@ -981,7 +981,7 @@ void QQuickEventPoint::cancelPassiveGrab(QQuickPointerHandler *handler)
{ {
if (removePassiveGrabber(handler)) { if (removePassiveGrabber(handler)) {
if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) { 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"; << ": grab (passive)" << handler << "removed";
} }
handler->onGrabChanged(handler, CancelGrabPassive, this); handler->onGrabChanged(handler, CancelGrabPassive, this);
@ -1960,7 +1960,7 @@ Q_QUICK_PRIVATE_EXPORT QDebug operator<<(QDebug dbg, const QQuickEventPoint *eve
dbg << "QQuickEventPoint(accepted:" << event->isAccepted() dbg << "QQuickEventPoint(accepted:" << event->isAccepted()
<< " state:"; << " state:";
QtDebugUtils::formatQEnum(dbg, event->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() << ')'; << " timeHeld:" << event->timeHeld() << ')';
return dbg; return dbg;
} }

View File

@ -180,8 +180,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
QQmlPrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent }; QQmlPrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent };
QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &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, 15);
qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
#if !QT_CONFIG(quick_animatedimage) #if !QT_CONFIG(quick_animatedimage)
qmlRegisterTypeNotAvailable(uri,major,minor,"AnimatedImage", QCoreApplication::translate("QQuickAnimatedImage","Qt was built without support for QMovie")); qmlRegisterTypeNotAvailable(uri,major,minor,"AnimatedImage", QCoreApplication::translate("QQuickAnimatedImage","Qt was built without support for QMovie"));

View File

@ -369,10 +369,6 @@ void QQuickPaintedItem::setTextureSize(const QSize &size)
emit textureSizeChanged(); 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 \obsolete

View File

@ -517,14 +517,14 @@ void QQuickViewPrivate::setRootObject(QObject *obj)
sgItem->setParentItem(q->QQuickWindow::contentItem()); sgItem->setParentItem(q->QQuickWindow::contentItem());
QQml_setParent_noEvent(sgItem, q->QQuickWindow::contentItem()); QQml_setParent_noEvent(sgItem, q->QQuickWindow::contentItem());
} else if (qobject_cast<QWindow *>(obj)) { } else if (qobject_cast<QWindow *>(obj)) {
qWarning() << "QQuickView does not support using windows as a root item." << endl qWarning() << "QQuickView does not support using windows as a root item." << Qt::endl
<< endl << Qt::endl
<< "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << endl; << "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << Qt::endl;
} else { } else {
qWarning() << "QQuickView only supports loading of root objects that derive from QQuickItem." << endl qWarning() << "QQuickView only supports loading of root objects that derive from QQuickItem." << Qt::endl
<< endl << Qt::endl
<< "Ensure your QML code is written for QtQuick 2, and uses a root that is or" << 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)." << endl; << "inherits from QtQuick's Item (not a Timer, QtObject, etc)." << Qt::endl;
delete obj; delete obj;
root = nullptr; root = nullptr;
} }

View File

@ -760,7 +760,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
if (!item->contains(pos)) if (!item->contains(pos))
break; break;
qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << hex << p.id() << "->" << item; qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << Qt::hex << p.id() << "->" << item;
QScopedPointer<QMouseEvent> mousePress(touchToMouseEvent(QEvent::MouseButtonPress, p, event.data(), item, false)); QScopedPointer<QMouseEvent> mousePress(touchToMouseEvent(QEvent::MouseButtonPress, p, event.data(), item, false));
// Send a single press and see if that's accepted // Send a single press and see if that's accepted
@ -802,7 +802,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
QCoreApplication::sendEvent(item, me.data()); QCoreApplication::sendEvent(item, me.data());
event->setAccepted(me->isAccepted()); event->setAccepted(me->isAccepted());
if (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(); return event->isAccepted();
} else { } else {
@ -2533,7 +2533,7 @@ void QQuickWindowPrivate::deliverTouchEvent(QQuickPointerTouchEvent *event)
QQuickEventPoint *point = event->point(i); QQuickEventPoint *point = event->point(i);
if (point->state() == QQuickEventPoint::Released) { if (point->state() == QQuickEventPoint::Released) {
int id = point->pointId(); int id = point->pointId();
qCDebug(DBG_TOUCH_TARGET) << "TP" << hex << id << "released"; qCDebug(DBG_TOUCH_TARGET) << "TP" << Qt::hex << id << "released";
point->setGrabberItem(nullptr); point->setGrabberItem(nullptr);
if (id == touchMouseId) if (id == touchMouseId)
cancelTouchMouseSynthesis(); cancelTouchMouseSynthesis();
@ -2630,7 +2630,7 @@ bool QQuickWindowPrivate::deliverPressOrReleaseEvent(QQuickPointerEvent *event,
if (point->grabberPointerHandler()) if (point->grabberPointerHandler())
cancelTouchMouseSynthesis(); cancelTouchMouseSynthesis();
} else { } 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) { for (int i = 0; i < pointCount; ++i) {
@ -2772,7 +2772,7 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
if (point.state() == Qt::TouchPointPressed) { if (point.state() == Qt::TouchPointPressed) {
if (auto *tp = ptEvent->pointById(point.id())) { if (auto *tp = ptEvent->pointById(point.id())) {
if (tp->exclusiveGrabber() == item) { 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); tp->setGrabberItem(nullptr);
} }
} }
@ -3051,7 +3051,7 @@ bool QQuickWindowPrivate::sendFilteredPointerEventImpl(QQuickPointerEvent *event
qCDebug(DBG_TOUCH) << "touch event intercepted as synth mouse event by childMouseEventFilter of " << filteringParent; qCDebug(DBG_TOUCH) << "touch event intercepted as synth mouse event by childMouseEventFilter of " << filteringParent;
skipDelivery.append(filteringParent); skipDelivery.append(filteringParent);
if (t != QEvent::MouseButtonRelease) { 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); pointerEventInstance(dev)->pointById(tp.id())->setGrabberItem(filteringParent);
touchMouseUnset = false; // We want to leave touchMouseId and touchMouseDevice set touchMouseUnset = false; // We want to leave touchMouseId and touchMouseDevice set
if (mouseEvent->isAccepted()) if (mouseEvent->isAccepted())

View File

@ -448,13 +448,13 @@ void qsg_dumpShadowRoots(Node *n)
QByteArray ind(indent, ' '); QByteArray ind(indent, ' ');
if (n->type() == QSGNode::ClipNodeType || n->isBatchRoot) { 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); qsg_dumpShadowRoots(n->rootInfo(), indent);
} else { } else {
QDebug d = qDebug(); 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) if (n->type() == QSGNode::GeometryNodeType)
d << "order" << dec << n->element()->order; d << "order" << Qt::dec << n->element()->order;
} }
SHADOWNODE_TRAVERSE(n) SHADOWNODE_TRAVERSE(n)
@ -2337,7 +2337,7 @@ void Renderer::uploadBatch(Batch *b)
iDump << " -- Index Data, count:" << b->indexCount; iDump << " -- Index Data, count:" << b->indexCount;
for (int i=0; i<b->indexCount; ++i) { for (int i=0; i<b->indexCount; ++i) {
if ((i % 24) == 0) if ((i % 24) == 0)
iDump << endl << " --- "; iDump << Qt::endl << " --- ";
iDump << id[i]; iDump << id[i];
} }
} }
@ -2350,7 +2350,7 @@ void Renderer::uploadBatch(Batch *b)
iDump << " -- Index Data, count:" << b->indexCount; iDump << " -- Index Data, count:" << b->indexCount;
for (int i=0; i<b->indexCount; ++i) { for (int i=0; i<b->indexCount; ++i) {
if ((i % 24) == 0) if ((i % 24) == 0)
iDump << endl << " --- "; iDump << Qt::endl << " --- ";
iDump << id[i]; iDump << id[i];
} }
} }
@ -3952,8 +3952,8 @@ void Renderer::setGraphicsPipeline(QRhiCommandBuffer *cb, const Batch *batch, El
void Renderer::renderBatches() void Renderer::renderBatches()
{ {
if (Q_UNLIKELY(debug_render())) { if (Q_UNLIKELY(debug_render())) {
qDebug().nospace() << "Rendering:" << endl qDebug().nospace() << "Rendering:" << Qt::endl
<< " -> Opaque: " << qsg_countNodesInBatches(m_opaqueBatches) << " nodes in " << m_opaqueBatches.size() << " batches..." << 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..."; << " -> Alpha: " << qsg_countNodesInBatches(m_alphaBatches) << " nodes in " << m_alphaBatches.size() << " batches...";
} }

View File

@ -1466,7 +1466,7 @@ QDebug operator<<(QDebug d, const QSGGeometryNode *n)
d << "Geometry(null)"; d << "Geometry(null)";
return d; return d;
} }
d << "GeometryNode(" << hex << (const void *) n << dec; d << "GeometryNode(" << Qt::hex << (const void *) n << Qt::dec;
const QSGGeometry *g = n->geometry(); const QSGGeometry *g = n->geometry();
@ -1517,7 +1517,7 @@ QDebug operator<<(QDebug d, const QSGClipNode *n)
d << "ClipNode(null)"; d << "ClipNode(null)";
return d; return d;
} }
d << "ClipNode(" << hex << (const void *) n << dec; d << "ClipNode(" << Qt::hex << (const void *) n << Qt::dec;
if (n->childCount()) if (n->childCount())
d << "children=" << n->childCount(); d << "children=" << n->childCount();
@ -1540,7 +1540,7 @@ QDebug operator<<(QDebug d, const QSGTransformNode *n)
} }
const QMatrix4x4 m = n->matrix(); const QMatrix4x4 m = n->matrix();
d << "TransformNode("; d << "TransformNode(";
d << hex << (const void *) n << dec; d << Qt::hex << (const void *) n << Qt::dec;
if (m.isIdentity()) if (m.isIdentity())
d << "identity"; d << "identity";
else if (m.determinant() == 1 && m(0, 0) == 1 && m(1, 1) == 1 && m(2, 2) == 1) 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; return d;
} }
d << "OpacityNode("; d << "OpacityNode(";
d << hex << (const void *) n << dec; d << Qt::hex << (const void *) n << Qt::dec;
d << "opacity=" << n->opacity() d << "opacity=" << n->opacity()
<< "combined=" << n->combinedOpacity() << "combined=" << n->combinedOpacity()
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); << (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
@ -1581,7 +1581,7 @@ QDebug operator<<(QDebug d, const QSGRootNode *n)
return d; return d;
} }
QDebugStateSaver saver(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 #ifdef QSG_RUNTIME_DESCRIPTION
d << QSGNodePrivate::description(n); d << QSGNodePrivate::description(n);
#endif #endif
@ -1614,8 +1614,8 @@ QDebug operator<<(QDebug d, const QSGNode *n)
d << static_cast<const QSGOpacityNode *>(n); d << static_cast<const QSGOpacityNode *>(n);
break; break;
case QSGNode::RenderNodeType: case QSGNode::RenderNodeType:
d << "RenderNode(" << hex << (const void *) n << dec d << "RenderNode(" << Qt::hex << (const void *) n << Qt::dec
<< "flags=" << (int) n->flags() << dec << "flags=" << (int) n->flags() << Qt::dec
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); << (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
#ifdef QSG_RUNTIME_DESCRIPTION #ifdef QSG_RUNTIME_DESCRIPTION
d << QSGNodePrivate::description(n); d << QSGNodePrivate::description(n);
@ -1623,8 +1623,8 @@ QDebug operator<<(QDebug d, const QSGNode *n)
d << ')'; d << ')';
break; break;
default: default:
d << "Node(" << hex << (const void *) n << dec d << "Node(" << Qt::hex << (const void *) n << Qt::dec
<< "flags=" << (int) n->flags() << dec << "flags=" << (int) n->flags() << Qt::dec
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : ""); << (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
#ifdef QSG_RUNTIME_DESCRIPTION #ifdef QSG_RUNTIME_DESCRIPTION
d << QSGNodePrivate::description(n); d << QSGNodePrivate::description(n);

View File

@ -359,7 +359,7 @@ void QSGDefaultRenderContext::compileShader(QSGMaterialShader *shader, QSGMateri
p->addCacheableShaderFromSourceCode(QOpenGLShader::Fragment, fragmentCode ? fragmentCode : shader->fragmentShader()); p->addCacheableShaderFromSourceCode(QOpenGLShader::Fragment, fragmentCode ? fragmentCode : shader->fragmentShader());
p->link(); p->link();
if (!p->isLinked()) if (!p->isLinked())
qWarning() << "shader compilation failed:" << endl << p->log(); qWarning() << "shader compilation failed:" << Qt::endl << p->log();
} else { } else {
shader->compile(); shader->compile();
} }

View File

@ -159,9 +159,6 @@ private:
QSize m_textureSize; QSize m_textureSize;
QRect m_dirtyRect; QRect m_dirtyRect;
QColor m_fillColor; QColor m_fillColor;
#if QT_VERSION >= 0x060000
#warning "Remove m_contentsScale and assume 1 everywhere"
#endif
qreal m_contentsScale; qreal m_contentsScale;
bool m_dirtyContents : 1; bool m_dirtyContents : 1;

View File

@ -903,7 +903,7 @@ void QActionAnimation::updateState(State newState, State oldState)
void QActionAnimation::debugAnimation(QDebug d) const void QActionAnimation::debugAnimation(QDebug d) const
{ {
d << "ActionAnimation(" << hex << (const void *) this << dec << ")"; d << "ActionAnimation(" << Qt::hex << (const void *) this << Qt::dec << ")";
if (animAction) { if (animAction) {
int indentLevel = 1; int indentLevel = 1;
@ -1996,7 +1996,7 @@ void QQuickBulkValueAnimator::topLevelAnimationLoopChanged()
void QQuickBulkValueAnimator::debugAnimation(QDebug d) const 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) { if (animValue) {
int indentLevel = 1; int indentLevel = 1;

View File

@ -184,7 +184,7 @@ void QQuickAnimatorProxyJob::updateState(QAbstractAnimationJob::State newState,
void QQuickAnimatorProxyJob::debugAnimation(QDebug d) const 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() << "state:" << state() << "duration:" << duration()
<< "proxying: (" << job() << ')'; << "proxying: (" << job() << ')';
} }
@ -266,7 +266,7 @@ QQuickAnimatorJob::QQuickAnimatorJob()
void QQuickAnimatorJob::debugAnimation(QDebug d) const 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() << ") state:" << state() << "duration:" << duration()
<< "target:" << m_target << "value:" << m_value; << "target:" << m_target << "value:" << m_value;
} }

View File

@ -92,9 +92,11 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_finished()) Q_PRIVATE_SLOT(d_func(), void _q_finished())
}; };
class QQuickImageProviderOptions;
class Q_QUICK_EXPORT QQuickImageProvider : public QQmlImageProviderBase class Q_QUICK_EXPORT QQuickImageProvider : public QQmlImageProviderBase
{ {
friend class QQuickImageProviderWithOptions; // ### Qt 6 Remove friend class QQuickImageProviderWithOptions;
public: public:
QQuickImageProvider(ImageType type, Flags flags = Flags()); QQuickImageProvider(ImageType type, Flags flags = Flags());
~QQuickImageProvider() override; ~QQuickImageProvider() override;
@ -102,15 +104,9 @@ public:
ImageType imageType() const override; ImageType imageType() const override;
Flags flags() 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 QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize);
virtual QPixmap requestPixmap(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); virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize);
#endif
private: private:
QQuickImageProviderPrivate *d; QQuickImageProviderPrivate *d;
@ -122,11 +118,7 @@ public:
QQuickAsyncImageProvider(); QQuickAsyncImageProvider();
~QQuickAsyncImageProvider() override; ~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; virtual QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) = 0;
#endif
private: private:
QQuickAsyncImageProviderPrivate *d; QQuickAsyncImageProviderPrivate *d;

View File

@ -189,8 +189,8 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPixmap::Options) Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickPixmap::Options)
// This class will disappear with Qt6 and will just be the regular QQuickImageProvider // ### Qt 6: This should be made public in Qt 6. It's functionality can't be merged into
// ### Qt 6: Remove this class and fold it with QQuickImageProvider // QQuickImageProvider without breaking source compatibility.
class Q_QUICK_PRIVATE_EXPORT QQuickImageProviderWithOptions : public QQuickAsyncImageProvider class Q_QUICK_PRIVATE_EXPORT QQuickImageProviderWithOptions : public QQuickAsyncImageProvider
{ {
public: public:

View File

@ -313,7 +313,7 @@ void QSmoothedAnimation::init()
void QSmoothedAnimation::debugAnimation(QDebug d) const 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() << "velocity:" << velocity << "target:" << target.object() << "property:" << target.name()
<< "to:" << to << "current velocity:" << trackVelocity; << "to:" << to << "current velocity:" << trackVelocity;
} }

View File

@ -319,7 +319,7 @@ void QSpringAnimation::updateState(QAbstractAnimationJob::State newState, QAbstr
void QSpringAnimation::debugAnimation(QDebug d) const 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 << "spring:" << spring << "damping:" << damping << "epsilon:" << epsilon << "modulus:" << modulus
<< "mass:" << mass << "target:" << target.object() << "property:" << target.name() << "mass:" << mass << "target:" << target.object() << "property:" << target.name()
<< "to:" << to << "current velocity:" << velocity; << "to:" << to << "current velocity:" << velocity;

View File

@ -723,7 +723,7 @@ void QQuickTimeLine::updateCurrentTime(int v)
void QQuickTimeLine::debugAnimation(QDebug d) const 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<int, Update> &lhs, bool operator<(const QPair<int, Update> &lhs,

View File

@ -1085,14 +1085,14 @@ void QQuickWidgetPrivate::setRootObject(QObject *obj)
root = sgItem; root = sgItem;
sgItem->setParentItem(offscreenWindow->contentItem()); sgItem->setParentItem(offscreenWindow->contentItem());
} else if (qobject_cast<QWindow *>(obj)) { } else if (qobject_cast<QWindow *>(obj)) {
qWarning() << "QQuickWidget does not support using windows as a root item." << endl qWarning() << "QQuickWidget does not support using windows as a root item." << Qt::endl
<< endl << Qt::endl
<< "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << endl; << "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << Qt::endl;
} else { } else {
qWarning() << "QQuickWidget only supports loading of root objects that derive from QQuickItem." << endl qWarning() << "QQuickWidget only supports loading of root objects that derive from QQuickItem." << Qt::endl
<< endl << Qt::endl
<< "Ensure your QML code is written for QtQuick 2, and uses a root that is or" << 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)." << endl; << "inherits from QtQuick's Item (not a Timer, QtObject, etc)." << Qt::endl;
delete obj; delete obj;
root = nullptr; root = nullptr;
} }

View File

@ -1,5 +1,6 @@
import org.qtproject.AutoTestQmlMixedPluginType 1.5 import org.qtproject.AutoTestQmlMixedPluginType 1.5
import QtQuick 2.0 import QtQuick 2.0
import QtQml 2.0
Item { Item {
property bool test: false property bool test: false

View File

@ -1,5 +1,6 @@
import org.qtproject.AutoTestQmlMixedPluginType 1.0 import org.qtproject.AutoTestQmlMixedPluginType 1.0
import QtQuick 2.0 import QtQuick 2.0
import QtQml 2.0
Item { Item {
property bool test: false property bool test: false

View File

@ -34,6 +34,10 @@
#include <QtCore/qjsondocument.h> #include <QtCore/qjsondocument.h>
#include <QtCore/qjsonarray.h> #include <QtCore/qjsonarray.h>
#include <QDebug> #include <QDebug>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QCborMap>
#include <QCborValue>
#endif
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
// For _PC_CASE_SENSITIVE // For _PC_CASE_SENSITIVE
@ -131,8 +135,7 @@ QByteArray SecondStaticPlugin::metaData;
template <typename PluginType> template <typename PluginType>
void registerStaticPlugin(const char *uri) void registerStaticPlugin(const char *uri)
{ {
QStaticPlugin plugin; auto instanceFunctor = []() {
plugin.instance = []() {
static PluginType plugin; static PluginType plugin;
return static_cast<QObject*>(&plugin); return static_cast<QObject*>(&plugin);
}; };
@ -143,12 +146,28 @@ void registerStaticPlugin(const char *uri)
uris.append(uri); uris.append(uri);
md.insert(QStringLiteral("uri"), uris); 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<const uchar *>(PluginType::metaData.constData()), size_t(PluginType::metaData.length())};
};
QStaticPlugin plugin(instanceFunctor, rawMetaDataFunctor);
#else
PluginType::metaData.append(QLatin1String("QTMETADATA ")); PluginType::metaData.append(QLatin1String("QTMETADATA "));
PluginType::metaData.append(QJsonDocument(md).toBinaryData()); PluginType::metaData.append(QJsonDocument(md).toBinaryData());
QStaticPlugin plugin;
plugin.instance = instanceFunctor;
plugin.rawMetaData = []() { plugin.rawMetaData = []() {
return PluginType::metaData.constData(); return PluginType::metaData.constData();
}; };
#endif
qRegisterStaticPluginFunction(plugin); qRegisterStaticPluginFunction(plugin);
}; };

View File

@ -4,3 +4,5 @@ qemu
osx-10.12 osx-10.12
[fontSizeMode] [fontSizeMode]
opensuse-42.1 opensuse-42.1
[contentSize]
windows gcc

View File

@ -194,7 +194,7 @@ static bool fuzzyCompareColor(QRgb x, QRgb y, QByteArray *errorMessage)
enum { fuzz = 4 }; enum { fuzz = 4 };
if (qAbs(qRed(x) - qRed(y)) >= fuzz || qAbs(qGreen(x) - qGreen(y)) >= fuzz || qAbs(qBlue(x) - qBlue(y)) >= fuzz) { if (qAbs(qRed(x) - qRed(y)) >= fuzz || qAbs(qGreen(x) - qGreen(y)) >= fuzz || qAbs(qBlue(x) - qBlue(y)) >= fuzz) {
QString s; 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(); *errorMessage = s.toLocal8Bit();
return false; return false;
} }

View File

@ -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
|| qAbs(qRed(a) - qRed(b)) > tolerance) { || qAbs(qRed(a) - qRed(b)) > tolerance) {
QDebug(errorMessage) << "Mismatch at:" << x << y << ':' QDebug(errorMessage) << "Mismatch at:" << x << y << ':'
<< hex << showbase << a << b; << Qt::hex << Qt::showbase << a << b;
return false; return false;
} }
} }

View File

@ -373,7 +373,7 @@ static bool saveUnitAsCpp(const QString &inputFileName, const QString &outputFil
{ {
QTextStream stream(&hexifiedData); QTextStream stream(&hexifiedData);
const uchar *end = begin + size; const uchar *end = begin + size;
stream << hex; stream << Qt::hex;
int col = 0; int col = 0;
for (const uchar *data = begin; data < end; ++data, ++col) { for (const uchar *data = begin; data < end; ++data, ++col) {
if (data > begin) if (data > begin)

View File

@ -195,7 +195,7 @@ void QmlPreviewApplication::processFinished()
void QmlPreviewApplication::logError(const QString &error) void QmlPreviewApplication::logError(const QString &error)
{ {
QTextStream err(stderr); QTextStream err(stderr);
err << "Error: " << error << endl; err << "Error: " << error << Qt::endl;
} }
void QmlPreviewApplication::logStatus(const QString &status) void QmlPreviewApplication::logStatus(const QString &status)
@ -203,7 +203,7 @@ void QmlPreviewApplication::logStatus(const QString &status)
if (!m_verbose) if (!m_verbose)
return; return;
QTextStream err(stderr); QTextStream err(stderr);
err << status << endl; err << status << Qt::endl;
} }
void QmlPreviewApplication::serveRequest(const QString &path) void QmlPreviewApplication::serveRequest(const QString &path)