diff options
Diffstat (limited to 'src')
186 files changed, 889 insertions, 796 deletions
diff --git a/src/3rdparty/masm/masm-defs.pri b/src/3rdparty/masm/masm-defs.pri index c0c5f3d114..34d6a67451 100644 --- a/src/3rdparty/masm/masm-defs.pri +++ b/src/3rdparty/masm/masm-defs.pri @@ -3,6 +3,7 @@ DEFINES += ENABLE_ASSEMBLER_WX_EXCLUSIVE=1 # Avoid symbol clashes with QtScript during static linking DEFINES += WTFReportAssertionFailure=qmlWTFReportAssertionFailure +DEFINES += WTFReportAssertionFailureWithMessage=qmlWTFReportAssertionFailureWithMessage DEFINES += WTFReportBacktrace=qmlWTFReportBacktrace DEFINES += WTFInvokeCrashHook=qmlWTFInvokeCrashHook diff --git a/src/3rdparty/masm/stubs/WTFStubs.cpp b/src/3rdparty/masm/stubs/WTFStubs.cpp index 610b632baf..ea7e2d78e0 100644 --- a/src/3rdparty/masm/stubs/WTFStubs.cpp +++ b/src/3rdparty/masm/stubs/WTFStubs.cpp @@ -112,6 +112,11 @@ void dataLogFString(const char* str) } extern "C" { +// When adding a new stub here do not forget to add +// DEFINES += StubFunctionName=qmlStubFunctionName +// for example: +// DEFINES += WTFReportAssertionFailureWithMessage=qmlWTFReportAssertionFailureWithMessage +// to prevent "duplicate symbol" error during static library linking. See bugs QTBUG-35041 and QTBUG-63050 void WTFReportAssertionFailure(const char* file, int line, const char* function, const char*assertion) { diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp index ef719109bd..2b58a5677a 100644 --- a/src/imports/folderlistmodel/plugin.cpp +++ b/src/imports/folderlistmodel/plugin.cpp @@ -59,7 +59,7 @@ class QmlFolderListModelPlugin : public QQmlExtensionPlugin public: QmlFolderListModelPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel")); qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel"); diff --git a/src/imports/handlers/plugin.cpp b/src/imports/handlers/plugin.cpp index bc1ae244d3..d26ef2b2d4 100644 --- a/src/imports/handlers/plugin.cpp +++ b/src/imports/handlers/plugin.cpp @@ -74,7 +74,7 @@ class QtQuickHandlersPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuickHandlersPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.handlers")); Q_UNUSED(uri); diff --git a/src/imports/layouts/plugin.cpp b/src/imports/layouts/plugin.cpp index da5f264ab5..fc3938c5d8 100644 --- a/src/imports/layouts/plugin.cpp +++ b/src/imports/layouts/plugin.cpp @@ -61,7 +61,7 @@ public: { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Layouts")); Q_UNUSED(uri); diff --git a/src/imports/layouts/qquicklayout_p.h b/src/imports/layouts/qquicklayout_p.h index 113498eb2b..7984e1bd4d 100644 --- a/src/imports/layouts/qquicklayout_p.h +++ b/src/imports/layouts/qquicklayout_p.h @@ -75,7 +75,7 @@ public: static QQuickLayoutAttached *qmlAttachedProperties(QObject *object); - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; virtual QSizeF sizeHint(Qt::SizeHint whichSizeHint) const = 0; virtual void setAlignment(QQuickItem *item, Qt::Alignment align) = 0; virtual void invalidate(QQuickItem * childItem = 0); @@ -92,21 +92,21 @@ public: static QLayoutPolicy::Policy effectiveSizePolicy_helper(QQuickItem *item, Qt::Orientation orientation, QQuickLayoutAttached *info); bool shouldIgnoreItem(QQuickItem *child, QQuickLayoutAttached *&info, QSizeF *sizeHints) const; - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; + void itemChange(ItemChange change, const ItemChangeData &value) override; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; bool isReady() const; void deactivateRecur(); /* QQuickItemChangeListener */ - void itemSiblingOrderChanged(QQuickItem *item) Q_DECL_OVERRIDE; - void itemImplicitWidthChanged(QQuickItem *item) Q_DECL_OVERRIDE; - void itemImplicitHeightChanged(QQuickItem *item) Q_DECL_OVERRIDE; - void itemDestroyed(QQuickItem *item) Q_DECL_OVERRIDE; - void itemVisibilityChanged(QQuickItem *item) Q_DECL_OVERRIDE; + void itemSiblingOrderChanged(QQuickItem *item) override; + void itemImplicitWidthChanged(QQuickItem *item) override; + void itemImplicitHeightChanged(QQuickItem *item) override; + void itemDestroyed(QQuickItem *item) override; + void itemVisibilityChanged(QQuickItem *item) override; protected: - void updatePolish() Q_DECL_OVERRIDE; + void updatePolish() override; enum Orientation { Vertical = 0, diff --git a/src/imports/layouts/qquicklayoutstyleinfo_p.h b/src/imports/layouts/qquicklayoutstyleinfo_p.h index ce86c2a37d..79f4ce2962 100644 --- a/src/imports/layouts/qquicklayoutstyleinfo_p.h +++ b/src/imports/layouts/qquicklayoutstyleinfo_p.h @@ -49,9 +49,9 @@ class QQuickLayoutStyleInfo : public QAbstractLayoutStyleInfo public: QQuickLayoutStyleInfo(); - qreal spacing(Qt::Orientation orientation) const Q_DECL_OVERRIDE; - qreal windowMargin(Qt::Orientation orientation) const Q_DECL_OVERRIDE; - bool hasChangedCore() const Q_DECL_OVERRIDE; + qreal spacing(Qt::Orientation orientation) const override; + qreal windowMargin(Qt::Orientation orientation) const override; + bool hasChangedCore() const override; }; diff --git a/src/imports/layouts/qquicklinearlayout_p.h b/src/imports/layouts/qquicklinearlayout_p.h index f796c8a855..6706ebf9fa 100644 --- a/src/imports/layouts/qquicklinearlayout_p.h +++ b/src/imports/layouts/qquicklinearlayout_p.h @@ -67,26 +67,26 @@ public: QQuickItem *parent = 0); ~QQuickGridLayoutBase(); - void componentComplete() Q_DECL_OVERRIDE; - void invalidate(QQuickItem *childItem = 0) Q_DECL_OVERRIDE; + void componentComplete() override; + void invalidate(QQuickItem *childItem = 0) override; Qt::Orientation orientation() const; void setOrientation(Qt::Orientation orientation); - QSizeF sizeHint(Qt::SizeHint whichSizeHint) const Q_DECL_OVERRIDE; + QSizeF sizeHint(Qt::SizeHint whichSizeHint) const override; Qt::LayoutDirection layoutDirection() const; void setLayoutDirection(Qt::LayoutDirection dir); Qt::LayoutDirection effectiveLayoutDirection() const; - void setAlignment(QQuickItem *item, Qt::Alignment align) Q_DECL_OVERRIDE; + void setAlignment(QQuickItem *item, Qt::Alignment align) override; /* QQuickItemChangeListener */ - void itemDestroyed(QQuickItem *item) Q_DECL_OVERRIDE; - void itemVisibilityChanged(QQuickItem *item) Q_DECL_OVERRIDE; + void itemDestroyed(QQuickItem *item) override; + void itemVisibilityChanged(QQuickItem *item) override; protected: - void updateLayoutItems() Q_DECL_OVERRIDE; - QQuickItem *itemAt(int index) const Q_DECL_OVERRIDE; - int itemCount() const Q_DECL_OVERRIDE; + void updateLayoutItems() override; + QQuickItem *itemAt(int index) const override; + int itemCount() const override; - void rearrange(const QSizeF &size) Q_DECL_OVERRIDE; + void rearrange(const QSizeF &size) override; virtual void insertLayoutItems() {} signals: @@ -109,7 +109,7 @@ public: , m_layoutDirection(Qt::LeftToRight) {} - void mirrorChange() Q_DECL_OVERRIDE + void mirrorChange() override { Q_Q(QQuickGridLayoutBase); q->invalidate(); diff --git a/src/imports/layouts/qquickstacklayout_p.h b/src/imports/layouts/qquickstacklayout_p.h index 7b6400c3a3..8ba41720aa 100644 --- a/src/imports/layouts/qquickstacklayout_p.h +++ b/src/imports/layouts/qquickstacklayout_p.h @@ -56,16 +56,16 @@ public: int currentIndex() const; void setCurrentIndex(int index); - void componentComplete() Q_DECL_OVERRIDE; - QSizeF sizeHint(Qt::SizeHint whichSizeHint) const Q_DECL_OVERRIDE; - void setAlignment(QQuickItem *item, Qt::Alignment align) Q_DECL_OVERRIDE; - void invalidate(QQuickItem *childItem = 0) Q_DECL_OVERRIDE; - void updateLayoutItems() Q_DECL_OVERRIDE; - void rearrange(const QSizeF &) Q_DECL_OVERRIDE; + void componentComplete() override; + QSizeF sizeHint(Qt::SizeHint whichSizeHint) const override; + void setAlignment(QQuickItem *item, Qt::Alignment align) override; + void invalidate(QQuickItem *childItem = 0) override; + void updateLayoutItems() override; + void rearrange(const QSizeF &) override; // iterator - Q_INVOKABLE QQuickItem *itemAt(int index) const Q_DECL_OVERRIDE; - int itemCount() const Q_DECL_OVERRIDE; + Q_INVOKABLE QQuickItem *itemAt(int index) const override; + int itemCount() const override; int indexOf(QQuickItem *item) const; diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 02cf125e48..7c9a77b11a 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -785,7 +785,7 @@ public: { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.LocalStorage")); qmlRegisterSingletonType<QQuickLocalStorage>(uri, 2, 0, "LocalStorage", module_api_factory); diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp index dbb62cd25d..5933128713 100644 --- a/src/imports/models/plugin.cpp +++ b/src/imports/models/plugin.cpp @@ -78,7 +78,7 @@ class QtQmlModelsPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQmlModelsPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.Models")); Q_UNUSED(uri); diff --git a/src/imports/particles/plugin.cpp b/src/imports/particles/plugin.cpp index 28ce0f7796..f7a3472403 100644 --- a/src/imports/particles/plugin.cpp +++ b/src/imports/particles/plugin.cpp @@ -57,7 +57,7 @@ class QtQuick2ParticlesPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuick2ParticlesPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Particles")); Q_UNUSED(uri); diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp index d16467a5bb..a5b2c8c67e 100644 --- a/src/imports/qtquick2/plugin.cpp +++ b/src/imports/qtquick2/plugin.cpp @@ -57,7 +57,7 @@ class QtQuick2Plugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuick2Plugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick")); Q_UNUSED(uri); diff --git a/src/imports/settings/plugin.cpp b/src/imports/settings/plugin.cpp index c422296446..70d24c12cd 100644 --- a/src/imports/settings/plugin.cpp +++ b/src/imports/settings/plugin.cpp @@ -58,7 +58,7 @@ class QmlSettingsPlugin : public QQmlExtensionPlugin public: QmlSettingsPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QByteArray(uri) == QByteArray("Qt.labs.settings")); qmlRegisterType<QQmlSettings>(uri, 1, 0, "Settings"); diff --git a/src/imports/shapes/plugin.cpp b/src/imports/shapes/plugin.cpp index 239ef78e55..c509d28e33 100644 --- a/src/imports/shapes/plugin.cpp +++ b/src/imports/shapes/plugin.cpp @@ -59,7 +59,7 @@ class QmlShapesPlugin : public QQmlExtensionPlugin public: QmlShapesPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QByteArray(uri) == QByteArray("QtQuick.Shapes")); qmlRegisterType<QQuickShape>(uri, 1, 0, "Shape"); diff --git a/src/imports/statemachine/plugin.cpp b/src/imports/statemachine/plugin.cpp index ae32f6446a..7308df8964 100644 --- a/src/imports/statemachine/plugin.cpp +++ b/src/imports/statemachine/plugin.cpp @@ -63,7 +63,7 @@ class QtQmlStateMachinePlugin : public QQmlExtensionPlugin public: QtQmlStateMachinePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { qmlRegisterType<State>(uri, 1, 0, "State"); qmlRegisterType<StateMachine>(uri, 1, 0, "StateMachine"); diff --git a/src/imports/statemachine/signaltransition.h b/src/imports/statemachine/signaltransition.h index c6512e2b19..3b3a7dae79 100644 --- a/src/imports/statemachine/signaltransition.h +++ b/src/imports/statemachine/signaltransition.h @@ -64,8 +64,8 @@ public: QQmlScriptString guard() const; void setGuard(const QQmlScriptString &guard); - bool eventTest(QEvent *event) Q_DECL_OVERRIDE; - void onTransition(QEvent *event) Q_DECL_OVERRIDE; + bool eventTest(QEvent *event) override; + void onTransition(QEvent *event) override; const QJSValue &signal(); void setSignal(const QJSValue &signal); @@ -81,8 +81,8 @@ Q_SIGNALS: void qmlSignalChanged(); private: - void classBegin() Q_DECL_OVERRIDE { m_complete = false; } - void componentComplete() Q_DECL_OVERRIDE { m_complete = true; connectTriggered(); } + void classBegin() override { m_complete = false; } + void componentComplete() override { m_complete = true; connectTriggered(); } void connectTriggered(); friend class SignalTransitionParser; @@ -97,8 +97,8 @@ private: class SignalTransitionParser : public QQmlCustomParser { public: - void verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &props) Q_DECL_OVERRIDE; - void applyBindings(QObject *object, QV4::CompiledData::CompilationUnit *compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) Q_DECL_OVERRIDE; + void verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &props) override; + void applyBindings(QObject *object, QV4::CompiledData::CompilationUnit *compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override; }; QT_END_NAMESPACE diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index fc013d5afc..2dbe8e08dc 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -151,7 +151,7 @@ class QTestQmlModule : public QQmlExtensionPlugin public: QTestQmlModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtTest")); qmlRegisterType<QuickTestResult, 0>(uri,1,0,"TestResult"); diff --git a/src/imports/window/plugin.cpp b/src/imports/window/plugin.cpp index 200f6f7b08..c4ea9a1d04 100644 --- a/src/imports/window/plugin.cpp +++ b/src/imports/window/plugin.cpp @@ -73,7 +73,7 @@ class QtQuick2WindowPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: QtQuick2WindowPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Window")); Q_UNUSED(uri); diff --git a/src/imports/xmllistmodel/plugin.cpp b/src/imports/xmllistmodel/plugin.cpp index af7625c96a..dc6a02918b 100644 --- a/src/imports/xmllistmodel/plugin.cpp +++ b/src/imports/xmllistmodel/plugin.cpp @@ -58,7 +58,7 @@ class QmlXmlListModelPlugin : public QQmlExtensionPlugin public: QmlXmlListModelPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) Q_DECL_OVERRIDE + void registerTypes(const char *uri) override { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.XmlListModel")); qmlRegisterType<QQuickXmlListModel>(uri,2,0,"XmlListModel"); diff --git a/src/plugins/qmltooling/packetprotocol/packetprotocol.pro b/src/plugins/qmltooling/packetprotocol/packetprotocol.pro index 383e32b54e..990d3169ad 100644 --- a/src/plugins/qmltooling/packetprotocol/packetprotocol.pro +++ b/src/plugins/qmltooling/packetprotocol/packetprotocol.pro @@ -4,7 +4,8 @@ CONFIG += static internal_module HEADERS = \ qpacketprotocol_p.h \ - qpacket_p.h + qpacket_p.h \ + qqmldebugpacket_p.h SOURCES = \ qpacketprotocol.cpp \ diff --git a/src/plugins/qmltooling/shared/qqmldebugpacket.h b/src/plugins/qmltooling/packetprotocol/qqmldebugpacket_p.h index f1c21e0a2b..9a0f8cd82d 100644 --- a/src/plugins/qmltooling/shared/qqmldebugpacket.h +++ b/src/plugins/qmltooling/packetprotocol/qqmldebugpacket_p.h @@ -40,9 +40,10 @@ #ifndef QQMLDEBUGPACKET_P_H #define QQMLDEBUGPACKET_P_H +#include "qpacket_p.h" + #include <QtCore/qbuffer.h> #include <QtQml/private/qqmldebugconnector_p.h> -#include <QtPacketProtocol/private/qpacket_p.h> // // W A R N I N G diff --git a/src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro b/src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro index f3f8a21ff8..2d8f0ceda2 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro +++ b/src/plugins/qmltooling/qmldbg_debugger/qmldbg_debugger.pro @@ -12,8 +12,6 @@ SOURCES += \ $$PWD/qv4debugjob.cpp HEADERS += \ - $$PWD/../shared/qqmlconfigurabledebugservice.h \ - $$PWD/../shared/qqmldebugpacket.h \ $$PWD/qqmldebuggerservicefactory.h \ $$PWD/qqmlenginedebugservice.h \ $$PWD/qqmlwatcher.h \ @@ -23,9 +21,6 @@ HEADERS += \ $$PWD/qv4datacollector.h \ $$PWD/qv4debugjob.h -INCLUDEPATH += $$PWD \ - $$PWD/../shared - OTHER_FILES += \ $$PWD/qqmldebuggerservice.json diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp index 3d08c4c809..182e4257f8 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp @@ -39,7 +39,6 @@ #include "qqmlenginedebugservice.h" #include "qqmlwatcher.h" -#include "qqmldebugpacket.h" #include <private/qqmldebugstatesdelegate_p.h> #include <private/qqmlboundsignal_p.h> @@ -57,6 +56,7 @@ #include <QtCore/qmetaobject.h> #include <QtCore/qfileinfo.h> #include <private/qmetaobject_p.h> +#include <private/qqmldebugpacket_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h index 2e40eb4de8..c0c24058eb 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h +++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h @@ -95,17 +95,17 @@ public: bool hasNotifySignal; }; - void engineAboutToBeAdded(QJSEngine *) Q_DECL_OVERRIDE; - void engineAboutToBeRemoved(QJSEngine *) Q_DECL_OVERRIDE; - void objectCreated(QJSEngine *, QObject *) Q_DECL_OVERRIDE; + void engineAboutToBeAdded(QJSEngine *) override; + void engineAboutToBeRemoved(QJSEngine *) override; + void objectCreated(QJSEngine *, QObject *) override; - void setStatesDelegate(QQmlDebugStatesDelegate *) Q_DECL_OVERRIDE; + void setStatesDelegate(QQmlDebugStatesDelegate *) override; signals: void scheduleMessage(const QByteArray &); protected: - virtual void messageReceived(const QByteArray &) Q_DECL_OVERRIDE; + void messageReceived(const QByteArray &) override; private: friend class QQmlDebuggerServiceFactory; diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp index 4573fb9d9a..8ff0a3ca64 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp @@ -432,7 +432,7 @@ QV4::ReturnedValue QV4DataCollector::getValue(Ref ref) QV4::Scope scope(engine()); QV4::ScopedObject array(scope, m_values.value()); Q_ASSERT(ref < array->getLength()); - return array->getIndexed(ref, Q_NULLPTR); + return array->getIndexed(ref, nullptr); } // TODO: Drop this method once we don't need to support namesAsObjects anymore diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.h b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.h index cd412e573d..06014302e6 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.h +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.h @@ -129,14 +129,14 @@ public: void runInEngine(QV4DebugJob *job); // compile-time interface - void maybeBreakAtInstruction() Q_DECL_OVERRIDE; + void maybeBreakAtInstruction() override; // execution hooks - void enteringFunction() Q_DECL_OVERRIDE; - void leavingFunction(const QV4::ReturnedValue &retVal) Q_DECL_OVERRIDE; - void aboutToThrow() Q_DECL_OVERRIDE; + void enteringFunction() override; + void leavingFunction(const QV4::ReturnedValue &retVal) override; + void aboutToThrow() override; - bool pauseAtNextOpportunity() const Q_DECL_OVERRIDE; + bool pauseAtNextOpportunity() const override; signals: void debuggerPaused(QV4Debugger *self, QV4Debugger::PauseReason reason); diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp index 168a08865c..fe00ed1e28 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.cpp @@ -40,13 +40,13 @@ #include "qv4debugservice.h" #include "qv4debugjob.h" #include "qqmlengine.h" -#include "qqmldebugpacket.h" #include <private/qv4engine_p.h> #include <private/qv4isel_moth_p.h> #include <private/qv4function_p.h> #include <private/qqmldebugconnector_p.h> #include <private/qv8engine_p.h> +#include <private/qqmldebugpacket_p.h> #include <QtCore/QJsonArray> #include <QtCore/QJsonDocument> diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h index bb13890ae4..5401956994 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugservice.h @@ -51,9 +51,9 @@ // We mean it. // -#include "qqmlconfigurabledebugservice.h" #include "qv4debuggeragent.h" #include "qv4datacollector.h" +#include <private/qqmlconfigurabledebugservice_p.h> #include <private/qqmldebugserviceinterfaces_p.h> #include <private/qv4debugging_p.h> @@ -73,14 +73,14 @@ class QV4DebugServiceImpl : public QQmlConfigurableDebugService<QV4DebugService> Q_OBJECT public: explicit QV4DebugServiceImpl(QObject *parent = 0); - ~QV4DebugServiceImpl() Q_DECL_OVERRIDE; + ~QV4DebugServiceImpl() override; - void engineAdded(QJSEngine *engine) Q_DECL_OVERRIDE; - void engineAboutToBeRemoved(QJSEngine *engine) Q_DECL_OVERRIDE; + void engineAdded(QJSEngine *engine) override; + void engineAboutToBeRemoved(QJSEngine *engine) override; - void stateAboutToBeChanged(State state) Q_DECL_OVERRIDE; + void stateAboutToBeChanged(State state) override; - void signalEmitted(const QString &signal) Q_DECL_OVERRIDE; + void signalEmitted(const QString &signal) override; void send(QJsonObject v8Payload); int selectedFrame() const; @@ -92,7 +92,7 @@ public: QV4DebuggerAgent debuggerAgent; protected: - void messageReceived(const QByteArray &) Q_DECL_OVERRIDE; + void messageReceived(const QByteArray &) override; void sendSomethingToSomebody(const char *type, int magicNumber = 1); private: diff --git a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp index 7145645609..7ce83daed6 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp @@ -40,11 +40,11 @@ #include "globalinspector.h" #include "highlight.h" #include "inspecttool.h" -#include "qqmldebugpacket.h" #include <private/qqmldebugserviceinterfaces_p.h> #include <private/qabstractanimation_p.h> #include <private/qqmlcomponent_p.h> +#include <private/qqmldebugpacket_p.h> #include <QtGui/qwindow.h> diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro index a8844944e0..18a61f15b7 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro +++ b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro @@ -1,8 +1,6 @@ TARGET = qmldbg_inspector QT += qml-private quick-private core-private gui-private packetprotocol-private -INCLUDEPATH *= $$PWD $$PWD/../shared - SOURCES += \ $$PWD/globalinspector.cpp \ $$PWD/highlight.cpp \ @@ -11,7 +9,6 @@ SOURCES += \ $$PWD/qquickwindowinspector.cpp HEADERS += \ - $$PWD/../shared/qqmldebugpacket.h \ $$PWD/globalinspector.h \ $$PWD/highlight.h \ $$PWD/inspecttool.h\ diff --git a/src/plugins/qmltooling/qmldbg_inspector/qqmlinspectorservice.cpp b/src/plugins/qmltooling/qmldbg_inspector/qqmlinspectorservice.cpp index ab1aeebf64..d0d8d62615 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/qqmlinspectorservice.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/qqmlinspectorservice.cpp @@ -51,15 +51,15 @@ class QQmlInspectorServiceImpl : public QQmlInspectorService public: QQmlInspectorServiceImpl(QObject *parent = 0); - void addWindow(QQuickWindow *window) Q_DECL_OVERRIDE; - void setParentWindow(QQuickWindow *window, QWindow *parent) Q_DECL_OVERRIDE; - void removeWindow(QQuickWindow *window) Q_DECL_OVERRIDE; + void addWindow(QQuickWindow *window) override; + void setParentWindow(QQuickWindow *window, QWindow *parent) override; + void removeWindow(QQuickWindow *window) override; signals: void scheduleMessage(const QByteArray &message); protected: - virtual void messageReceived(const QByteArray &) Q_DECL_OVERRIDE; + void messageReceived(const QByteArray &) override; private: friend class QQmlInspectorServiceFactory; diff --git a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp index 97e4b4e3e4..e60644518f 100644 --- a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp +++ b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnection.cpp @@ -38,10 +38,10 @@ ****************************************************************************/ #include "qlocalclientconnectionfactory.h" -#include "qqmldebugserver.h" #include <QtCore/qplugin.h> #include <QtNetwork/qlocalsocket.h> +#include <private/qqmldebugserver_p.h> Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError) diff --git a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnectionfactory.h b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnectionfactory.h index b64a1fff95..95bbd8956a 100644 --- a/src/plugins/qmltooling/qmldbg_local/qlocalclientconnectionfactory.h +++ b/src/plugins/qmltooling/qmldbg_local/qlocalclientconnectionfactory.h @@ -40,7 +40,7 @@ #ifndef QLOCALCLIENTCONNECTIONFACTORY_H #define QLOCALCLIENTCONNECTIONFACTORY_H -#include "qqmldebugserverconnection.h" +#include <private/qqmldebugserverconnection_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro index d731e47b7e..71dba262da 100644 --- a/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro +++ b/src/plugins/qmltooling/qmldbg_local/qmldbg_local.pro @@ -5,12 +5,7 @@ SOURCES += \ $$PWD/qlocalclientconnection.cpp HEADERS += \ - $$PWD/qlocalclientconnectionfactory.h \ - $$PWD/../shared/qqmldebugserver.h \ - $$PWD/../shared/qqmldebugserverconnection.h - -INCLUDEPATH += $$PWD \ - $$PWD/../shared + $$PWD/qlocalclientconnectionfactory.h OTHER_FILES += \ $$PWD/qlocalclientconnection.json diff --git a/src/plugins/qmltooling/qmldbg_messages/qdebugmessageservice.cpp b/src/plugins/qmltooling/qmldbg_messages/qdebugmessageservice.cpp index b0f59717ac..bdfed03a40 100644 --- a/src/plugins/qmltooling/qmldbg_messages/qdebugmessageservice.cpp +++ b/src/plugins/qmltooling/qmldbg_messages/qdebugmessageservice.cpp @@ -38,8 +38,9 @@ ****************************************************************************/ #include "qdebugmessageservice.h" -#include "qqmldebugpacket.h" + #include <private/qqmldebugconnector_p.h> +#include <private/qqmldebugpacket_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_messages/qmldbg_messages.pro b/src/plugins/qmltooling/qmldbg_messages/qmldbg_messages.pro index 5ddf7c615d..eda6df1a16 100644 --- a/src/plugins/qmltooling/qmldbg_messages/qmldbg_messages.pro +++ b/src/plugins/qmltooling/qmldbg_messages/qmldbg_messages.pro @@ -6,13 +6,9 @@ SOURCES += \ $$PWD/qdebugmessageservicefactory.cpp HEADERS += \ - $$PWD/../shared/qqmldebugpacket.h \ $$PWD/qdebugmessageservice.h \ $$PWD/qdebugmessageservicefactory.h -INCLUDEPATH += $$PWD \ - $$PWD/../shared - OTHER_FILES += \ $$PWD/qdebugmessageservice.json diff --git a/src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro b/src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro index e5489574be..6630a394a0 100644 --- a/src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro +++ b/src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro @@ -2,15 +2,11 @@ TARGET = qmldbg_native QT = qml-private core-private packetprotocol-private HEADERS += \ - $$PWD/../shared/qqmldebugpacket.h \ $$PWD/qqmlnativedebugconnector.h SOURCES += \ $$PWD/qqmlnativedebugconnector.cpp -INCLUDEPATH += $$PWD \ - $$PWD/../shared - OTHER_FILES += \ $$PWD/qqmlnativedebugconnector.json diff --git a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp index 388d2e3b22..a4b3455eff 100644 --- a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp +++ b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp @@ -38,9 +38,9 @@ ****************************************************************************/ #include "qqmlnativedebugconnector.h" -#include "qqmldebugpacket.h" #include <private/qhooks_p.h> +#include <private/qqmldebugpacket_p.h> #include <QtQml/qjsengine.h> #include <QtCore/qdebug.h> diff --git a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.h b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.h index f8b7e1d527..a7f37b0f1e 100644 --- a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.h +++ b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.h @@ -51,16 +51,16 @@ class QQmlNativeDebugConnector : public QQmlDebugConnector public: QQmlNativeDebugConnector(); - ~QQmlNativeDebugConnector() Q_DECL_OVERRIDE; + ~QQmlNativeDebugConnector() override; - bool blockingMode() const Q_DECL_OVERRIDE; - QQmlDebugService *service(const QString &name) const Q_DECL_OVERRIDE; - void addEngine(QJSEngine *engine) Q_DECL_OVERRIDE; - void removeEngine(QJSEngine *engine) Q_DECL_OVERRIDE; - bool hasEngine(QJSEngine *engine) const Q_DECL_OVERRIDE; - bool addService(const QString &name, QQmlDebugService *service) Q_DECL_OVERRIDE; - bool removeService(const QString &name) Q_DECL_OVERRIDE; - bool open(const QVariantHash &configuration) Q_DECL_OVERRIDE; + bool blockingMode() const override; + QQmlDebugService *service(const QString &name) const override; + void addEngine(QJSEngine *engine) override; + void removeEngine(QJSEngine *engine) override; + bool hasEngine(QJSEngine *engine) const override; + bool addService(const QString &name, QQmlDebugService *service) override; + bool removeService(const QString &name) override; + bool open(const QVariantHash &configuration) override; static void setDataStreamVersion(int version); private: diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qmldbg_nativedebugger.pro b/src/plugins/qmltooling/qmldbg_nativedebugger/qmldbg_nativedebugger.pro index 1873a6a77c..1cb5525622 100644 --- a/src/plugins/qmltooling/qmldbg_nativedebugger/qmldbg_nativedebugger.pro +++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qmldbg_nativedebugger.pro @@ -6,13 +6,9 @@ SOURCES += \ $$PWD/qqmlnativedebugservice.cpp HEADERS += \ - $$PWD/../shared/qqmldebugpacket.h \ $$PWD/qqmlnativedebugservicefactory.h \ $$PWD/qqmlnativedebugservice.h \ -INCLUDEPATH += $$PWD \ - $$PWD/../shared - OTHER_FILES += \ $$PWD/qqmlnativedebugservice.json diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp index d536fd51ed..cff1728f49 100644 --- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp @@ -38,7 +38,6 @@ ****************************************************************************/ #include "qqmlnativedebugservice.h" -#include "qqmldebugpacket.h" #include <private/qqmldebugconnector_p.h> #include <private/qv4debugging_p.h> @@ -51,6 +50,7 @@ #include <private/qv4identifier_p.h> #include <private/qv4runtime_p.h> #include <private/qv4isel_moth_p.h> +#include <private/qqmldebugpacket_p.h> #include <private/qqmldebugserviceinterfaces_p.h> #include <QtQml/qjsengine.h> @@ -188,16 +188,16 @@ public: QV4::ExecutionEngine *engine() const { return m_engine; } - bool pauseAtNextOpportunity() const Q_DECL_OVERRIDE { + bool pauseAtNextOpportunity() const override { return m_pauseRequested || m_service->m_breakHandler->m_haveBreakPoints || m_stepping >= StepOver; } - void maybeBreakAtInstruction() Q_DECL_OVERRIDE; - void enteringFunction() Q_DECL_OVERRIDE; - void leavingFunction(const QV4::ReturnedValue &retVal) Q_DECL_OVERRIDE; - void aboutToThrow() Q_DECL_OVERRIDE; + void maybeBreakAtInstruction() override; + void enteringFunction() override; + void leavingFunction(const QV4::ReturnedValue &retVal) override; + void aboutToThrow() override; void handleCommand(QJsonObject *response, const QString &cmd, const QJsonObject &arguments); diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.h b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.h index 58bf1bc94a..4b4661be2f 100644 --- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.h +++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.h @@ -73,14 +73,14 @@ class QQmlNativeDebugServiceImpl : public QQmlNativeDebugService public: QQmlNativeDebugServiceImpl(QObject *parent); - ~QQmlNativeDebugServiceImpl() Q_DECL_OVERRIDE; + ~QQmlNativeDebugServiceImpl() override; - void engineAboutToBeAdded(QJSEngine *engine) Q_DECL_OVERRIDE; - void engineAboutToBeRemoved(QJSEngine *engine) Q_DECL_OVERRIDE; + void engineAboutToBeAdded(QJSEngine *engine) override; + void engineAboutToBeRemoved(QJSEngine *engine) override; - void stateAboutToBeChanged(State state) Q_DECL_OVERRIDE; + void stateAboutToBeChanged(State state) override; - void messageReceived(const QByteArray &message) Q_DECL_OVERRIDE; + void messageReceived(const QByteArray &message) override; void emitAsynchronousMessageToClient(const QJsonObject &message); diff --git a/src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro b/src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro index 4629a7b81e..ac874b079e 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro +++ b/src/plugins/qmltooling/qmldbg_profiler/qmldbg_profiler.pro @@ -9,17 +9,12 @@ SOURCES += \ $$PWD/qv4profileradapter.cpp HEADERS += \ - $$PWD/../shared/qqmlconfigurabledebugservice.h \ - $$PWD/../shared/qqmldebugpacket.h \ $$PWD/qqmlenginecontrolservice.h \ $$PWD/qqmlprofileradapter.h \ $$PWD/qqmlprofilerservice.h \ $$PWD/qqmlprofilerservicefactory.h \ $$PWD/qv4profileradapter.h -INCLUDEPATH += $$PWD \ - $$PWD/../shared - OTHER_FILES += \ $$PWD/qqmlprofilerservice.json diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp index 9918a95116..4eedb4bd51 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.cpp @@ -38,7 +38,7 @@ ****************************************************************************/ #include "qqmlenginecontrolservice.h" -#include "qqmldebugpacket.h" +#include <private/qqmldebugpacket_p.h> #include <QJSEngine> QT_BEGIN_NAMESPACE @@ -53,8 +53,8 @@ void QQmlEngineControlServiceImpl::messageReceived(const QByteArray &message) { QMutexLocker lock(&dataMutex); QQmlDebugPacket d(message); - int command; - int engineId; + qint32 command; + qint32 engineId; d >> command >> engineId; QJSEngine *engine = qobject_cast<QJSEngine *>(objectForId(engineId)); if (command == StartWaitingEngine && startingEngines.contains(engine)) { @@ -112,10 +112,11 @@ void QQmlEngineControlServiceImpl::engineRemoved(QJSEngine *engine) } } -void QQmlEngineControlServiceImpl::sendMessage(QQmlEngineControlServiceImpl::MessageType type, QJSEngine *engine) +void QQmlEngineControlServiceImpl::sendMessage(QQmlEngineControlServiceImpl::MessageType type, + QJSEngine *engine) { QQmlDebugPacket d; - d << int(type) << idForObject(engine); + d << static_cast<qint32>(type) << idForObject(engine); emit messageToClient(name(), d.data()); } diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h index 6392944519..3c5daa0f4f 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlenginecontrolservice.h @@ -81,15 +81,15 @@ protected: QList<QJSEngine *> stoppingEngines; bool blockingMode; - void messageReceived(const QByteArray &) Q_DECL_OVERRIDE; - void engineAboutToBeAdded(QJSEngine *) Q_DECL_OVERRIDE; - void engineAboutToBeRemoved(QJSEngine *) Q_DECL_OVERRIDE; - void engineAdded(QJSEngine *) Q_DECL_OVERRIDE; - void engineRemoved(QJSEngine *) Q_DECL_OVERRIDE; + void messageReceived(const QByteArray &) override; + void engineAboutToBeAdded(QJSEngine *) override; + void engineAboutToBeRemoved(QJSEngine *) override; + void engineAdded(QJSEngine *) override; + void engineRemoved(QJSEngine *) override; void sendMessage(MessageType type, QJSEngine *engine); - void stateChanged(State) Q_DECL_OVERRIDE; + void stateChanged(State) override; }; QT_END_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp index d676731ba7..5ff1b1f97e 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp @@ -38,8 +38,8 @@ ****************************************************************************/ #include "qqmlprofileradapter.h" -#include "qqmldebugpacket.h" +#include <private/qqmldebugpacket_p.h> #include <private/qqmldebugserviceinterfaces_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.h b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.h index 7531cd1dff..b14b72d254 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.h +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.h @@ -62,7 +62,7 @@ public: QQmlProfilerAdapter(QQmlProfilerService *service, QQmlEnginePrivate *engine); QQmlProfilerAdapter(QQmlProfilerService *service, QQmlTypeLoader *loader); qint64 sendMessages(qint64 until, QList<QByteArray> &messages, - bool trackLocations) Q_DECL_OVERRIDE; + bool trackLocations) override; void receiveData(const QVector<QQmlProfilerData> &new_data, const QQmlProfiler::LocationHash &locations); diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp index 4176ede40e..c388c6e74a 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp @@ -41,9 +41,9 @@ #include "qv4profileradapter.h" #include "qqmlprofileradapter.h" #include "qqmlprofilerservicefactory.h" -#include "qqmldebugpacket.h" #include <private/qjsengine_p.h> +#include <private/qqmldebugpacket_p.h> #include <private/qqmldebugpluginmanager_p.h> #include <QtCore/qurl.h> diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h index bbfc32b681..a5e060a1ab 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h +++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.h @@ -51,7 +51,7 @@ // We mean it. // -#include "qqmlconfigurabledebugservice.h" +#include <private/qqmlconfigurabledebugservice_p.h> #include <private/qqmldebugserviceinterfaces_p.h> #include <private/qqmlprofilerdefinitions_p.h> #include <private/qqmlabstractprofileradapter_p.h> @@ -78,30 +78,30 @@ class QQmlProfilerServiceImpl : Q_OBJECT public: - void engineAboutToBeAdded(QJSEngine *engine) Q_DECL_OVERRIDE; - void engineAboutToBeRemoved(QJSEngine *engine) Q_DECL_OVERRIDE; - void engineAdded(QJSEngine *engine) Q_DECL_OVERRIDE; - void engineRemoved(QJSEngine *engine) Q_DECL_OVERRIDE; + void engineAboutToBeAdded(QJSEngine *engine) override; + void engineAboutToBeRemoved(QJSEngine *engine) override; + void engineAdded(QJSEngine *engine) override; + void engineRemoved(QJSEngine *engine) override; - void addGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) Q_DECL_OVERRIDE; - void removeGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) Q_DECL_OVERRIDE; + void addGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) override; + void removeGlobalProfiler(QQmlAbstractProfilerAdapter *profiler) override; void startProfiling(QJSEngine *engine, - quint64 features = std::numeric_limits<quint64>::max()) Q_DECL_OVERRIDE; - void stopProfiling(QJSEngine *engine) Q_DECL_OVERRIDE; + quint64 features = std::numeric_limits<quint64>::max()) override; + void stopProfiling(QJSEngine *engine) override; QQmlProfilerServiceImpl(QObject *parent = 0); - ~QQmlProfilerServiceImpl() Q_DECL_OVERRIDE; + ~QQmlProfilerServiceImpl() override; - void dataReady(QQmlAbstractProfilerAdapter *profiler) Q_DECL_OVERRIDE; + void dataReady(QQmlAbstractProfilerAdapter *profiler) override; signals: void startFlushTimer(); void stopFlushTimer(); protected: - virtual void stateAboutToBeChanged(State state) Q_DECL_OVERRIDE; - virtual void messageReceived(const QByteArray &) Q_DECL_OVERRIDE; + void stateAboutToBeChanged(State state) override; + void messageReceived(const QByteArray &) override; private: friend class QQmlProfilerServiceFactory; diff --git a/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h b/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h index 5d5b83f7ca..7ac378acd9 100644 --- a/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h +++ b/src/plugins/qmltooling/qmldbg_profiler/qv4profileradapter.h @@ -53,7 +53,7 @@ #include <private/qv4profiling_p.h> #include <private/qqmlabstractprofileradapter_p.h> -#include "qqmldebugpacket.h" +#include <private/qqmldebugpacket_p.h> #include <QStack> #include <QList> diff --git a/src/plugins/qmltooling/qmldbg_quickprofiler/qmldbg_quickprofiler.pro b/src/plugins/qmltooling/qmldbg_quickprofiler/qmldbg_quickprofiler.pro index 6ca0a184ca..f165917041 100644 --- a/src/plugins/qmltooling/qmldbg_quickprofiler/qmldbg_quickprofiler.pro +++ b/src/plugins/qmltooling/qmldbg_quickprofiler/qmldbg_quickprofiler.pro @@ -5,8 +5,6 @@ PLUGIN_TYPE = qmltooling PLUGIN_CLASS_NAME = QQuickProfilerAdapterFactory load(qt_plugin) -INCLUDEPATH += $$PWD/../shared - SOURCES += \ $$PWD/qquickprofileradapter.cpp \ $$PWD/qquickprofileradapterfactory.cpp @@ -14,7 +12,6 @@ SOURCES += \ HEADERS += \ $$PWD/qquickprofileradapter.h \ $$PWD/qquickprofileradapterfactory.h \ - $$PWD/../shared/qqmldebugpacket.h OTHER_FILES += \ qquickprofileradapter.json diff --git a/src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp b/src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp index 35beb0ee0d..a05d11664d 100644 --- a/src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp +++ b/src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp @@ -38,8 +38,9 @@ ****************************************************************************/ #include "qquickprofileradapter.h" -#include "qqmldebugpacket.h" + #include <QCoreApplication> +#include <private/qqmldebugpacket_p.h> #include <private/qqmldebugserviceinterfaces_p.h> #include <private/qquickprofiler_p.h> diff --git a/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro b/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro index fffdb4c888..d7d24a4d39 100644 --- a/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro +++ b/src/plugins/qmltooling/qmldbg_server/qmldbg_server.pro @@ -5,13 +5,7 @@ SOURCES += \ $$PWD/qqmldebugserver.cpp HEADERS += \ - $$PWD/qqmldebugserverfactory.h \ - $$PWD/../shared/qqmldebugserver.h \ - $$PWD/../shared/qqmldebugserverconnection.h \ - $$PWD/../shared/qqmldebugpacket.h - -INCLUDEPATH += $$PWD \ - $$PWD/../shared + $$PWD/qqmldebugserverfactory.h OTHER_FILES += \ qqmldebugserver.json diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp index 0a7421842a..f87ade568b 100644 --- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp +++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp @@ -37,17 +37,17 @@ ** ****************************************************************************/ -#include "qqmldebugserver.h" #include "qqmldebugserverfactory.h" -#include "qqmldebugserverconnection.h" -#include "qqmldebugpacket.h" +#include <private/qqmldebugserver_p.h> +#include <private/qqmldebugserverconnection_p.h> #include <private/qqmldebugservice_p.h> #include <private/qjsengine_p.h> #include <private/qqmlglobal_p.h> #include <private/qqmldebugpluginmanager_p.h> #include <private/qqmldebugserviceinterfaces_p.h> #include <private/qpacketprotocol_p.h> +#include <private/qqmldebugpacket_p.h> #include <QtCore/QAtomicInt> #include <QtCore/QDir> @@ -131,19 +131,19 @@ class QQmlDebugServerImpl : public QQmlDebugServer public: QQmlDebugServerImpl(); - bool blockingMode() const Q_DECL_OVERRIDE; + bool blockingMode() const override; - QQmlDebugService *service(const QString &name) const Q_DECL_OVERRIDE; + QQmlDebugService *service(const QString &name) const override; - void addEngine(QJSEngine *engine) Q_DECL_OVERRIDE; - void removeEngine(QJSEngine *engine) Q_DECL_OVERRIDE; - bool hasEngine(QJSEngine *engine) const Q_DECL_OVERRIDE; + void addEngine(QJSEngine *engine) override; + void removeEngine(QJSEngine *engine) override; + bool hasEngine(QJSEngine *engine) const override; - bool addService(const QString &name, QQmlDebugService *service) Q_DECL_OVERRIDE; - bool removeService(const QString &name) Q_DECL_OVERRIDE; + bool addService(const QString &name, QQmlDebugService *service) override; + bool removeService(const QString &name) override; - bool open(const QVariantHash &configuration) Q_DECL_OVERRIDE; - void setDevice(QIODevice *socket) Q_DECL_OVERRIDE; + bool open(const QVariantHash &configuration) override; + void setDevice(QIODevice *socket) override; void parseArguments(); @@ -767,4 +767,3 @@ QQmlDebugConnector *QQmlDebugServerFactory::create(const QString &key) QT_END_NAMESPACE #include "qqmldebugserver.moc" -#include "moc_qqmldebugserver.cpp" diff --git a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro index 1face1813e..a0e9d06fd5 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro +++ b/src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro @@ -5,12 +5,7 @@ SOURCES += \ $$PWD/qtcpserverconnection.cpp HEADERS += \ - $$PWD/qtcpserverconnectionfactory.h \ - $$PWD/../shared/qqmldebugserver.h \ - $$PWD/../shared/qqmldebugserverconnection.h - -INCLUDEPATH += $$PWD \ - $$PWD/../shared + $$PWD/qtcpserverconnectionfactory.h OTHER_FILES += \ $$PWD/qtcpserverconnection.json diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp index af4f5292ba..c2aafda863 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp +++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp @@ -38,7 +38,8 @@ ****************************************************************************/ #include "qtcpserverconnectionfactory.h" -#include "qqmldebugserver.h" + +#include <private/qqmldebugserver_p.h> #include <QtCore/qplugin.h> #include <QtNetwork/qtcpserver.h> diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnectionfactory.h b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnectionfactory.h index d3b0e00584..d1282c9d47 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnectionfactory.h +++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnectionfactory.h @@ -40,7 +40,7 @@ #ifndef QTCPSERVERCONNECTIONFACTORY_H #define QTCPSERVERCONNECTIONFACTORY_H -#include "qqmldebugserverconnection.h" +#include <private/qqmldebugserverconnection_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/qmltooling/qmltooling.pro b/src/plugins/qmltooling/qmltooling.pro index 27c51b53c8..5895169ca0 100644 --- a/src/plugins/qmltooling/qmltooling.pro +++ b/src/plugins/qmltooling/qmltooling.pro @@ -19,17 +19,19 @@ qtConfig(qml-network) { qmldbg_tcp } +# Services +SUBDIRS += \ + qmldbg_messages \ + qmldbg_profiler +qmldbg_messages.depends = packetprotocol +qmldbg_profiler.depends = packetprotocol + qtConfig(qml-interpreter) { - # Services SUBDIRS += \ qmldbg_debugger \ - qmldbg_profiler \ - qmldbg_messages \ qmldbg_nativedebugger qmldbg_debugger.depends = packetprotocol - qmldbg_profiler.depends = packetprotocol - qmldbg_messages.depends = packetprotocol qmldbg_nativedebugger.depends = packetprotocol } diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 57121e5460..02ff8947c4 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1067,6 +1067,8 @@ void IRBuilder::setBindingValue(QV4::CompiledData::Binding *binding, QQmlJS::AST } else if (QQmlJS::AST::NumericLiteral *lit = QQmlJS::AST::cast<QQmlJS::AST::NumericLiteral *>(expr)) { binding->type = QV4::CompiledData::Binding::Type_Number; binding->setNumberValueInternal(lit->value); + } else if (QQmlJS::AST::cast<QQmlJS::AST::FunctionExpression *>(expr)) { + binding->flags |= QV4::CompiledData::Binding::IsFunctionExpression; } else { if (QQmlJS::AST::UnaryMinusExpression *unaryMinus = QQmlJS::AST::cast<QQmlJS::AST::UnaryMinusExpression *>(expr)) { diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 5b7a7f9050..3fff29bce0 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2628,7 +2628,7 @@ bool Codegen::visit(ReturnStatement *ast) // Since we're leaving, don't let any finally statements we emit as part of the unwinding // jump to exception handlers at run-time if they throw. - IR::BasicBlock *unwindBlock = _function->newBasicBlock(/*no exception handler*/Q_NULLPTR); + IR::BasicBlock *unwindBlock = _function->newBasicBlock(/*no exception handler*/nullptr); _block->JUMP(unwindBlock); _block = unwindBlock; diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index adf6c21cc3..a83dea1a0a 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -301,6 +301,7 @@ struct Q_QML_PRIVATE_EXPORT Binding IsBindingToAlias = 0x40, IsDeferredBinding = 0x80, IsCustomParserBinding = 0x100, + IsFunctionExpression = 0x200 }; union { @@ -368,6 +369,8 @@ struct Q_QML_PRIVATE_EXPORT Binding return false; } + bool isFunctionExpression() const { return (flags & IsFunctionExpression); } + static QString escapedString(const QString &string); bool containsTranslations() const { return type == Type_Translation || type == Type_TranslationById; } @@ -957,7 +960,7 @@ struct Q_QML_PRIVATE_EXPORT CompilationUnit : public CompilationUnitBase, public void markObjects(MarkStack *markStack); - void destroy() Q_DECL_OVERRIDE; + void destroy() override; bool loadFromDisk(const QUrl &url, const QDateTime &sourceTimeStamp, EvalISelFactory *iselFactory, QString *errorString); diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index 4b84bd2831..db49177783 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -72,11 +72,11 @@ struct CompilationUnit : public QV4::CompiledData::CompilationUnit { virtual ~CompilationUnit(); #if !defined(V4_BOOTSTRAP) - void linkBackendToEngine(QV4::ExecutionEngine *engine) Q_DECL_OVERRIDE; - bool memoryMapCode(QString *errorString) Q_DECL_OVERRIDE; + void linkBackendToEngine(QV4::ExecutionEngine *engine) override; + bool memoryMapCode(QString *errorString) override; #endif - void prepareCodeOffsetsForDiskStorage(CompiledData::Unit *unit) Q_DECL_OVERRIDE; - bool saveCodeToDisk(QIODevice *device, const CompiledData::Unit *unit, QString *errorString) Q_DECL_OVERRIDE; + void prepareCodeOffsetsForDiskStorage(CompiledData::Unit *unit) override; + bool saveCodeToDisk(QIODevice *device, const CompiledData::Unit *unit, QString *errorString) override; QVector<QByteArray> codeRefs; @@ -216,11 +216,11 @@ class Q_QML_EXPORT ISelFactory: public EvalISelFactory public: ISelFactory() : EvalISelFactory(QStringLiteral("moth")) {} virtual ~ISelFactory() {} - EvalInstructionSelection *create(QQmlEnginePrivate *qmlEngine, QV4::ExecutableAllocator *execAllocator, IR::Module *module, QV4::Compiler::JSUnitGenerator *jsGenerator) Q_DECL_OVERRIDE Q_DECL_FINAL + EvalInstructionSelection *create(QQmlEnginePrivate *qmlEngine, QV4::ExecutableAllocator *execAllocator, IR::Module *module, QV4::Compiler::JSUnitGenerator *jsGenerator) override final { return new InstructionSelection(qmlEngine, execAllocator, module, jsGenerator, this); } - bool jitCompileRegexps() const Q_DECL_OVERRIDE Q_DECL_FINAL + bool jitCompileRegexps() const override final { return false; } - QQmlRefPointer<QV4::CompiledData::CompilationUnit> createUnitForLoading() Q_DECL_OVERRIDE; + QQmlRefPointer<QV4::CompiledData::CompilationUnit> createUnitForLoading() override; }; diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index 8cf5fac760..cf79168c6c 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -2068,7 +2068,7 @@ public: } protected: - void visitTemp(Temp *e) Q_DECL_OVERRIDE Q_DECL_FINAL + void visitTemp(Temp *e) override final { _collectedTemps.append(e); } @@ -5108,7 +5108,7 @@ private: return checker.seenSideEffects(); } - void visitTemp(Temp *) Q_DECL_OVERRIDE Q_DECL_FINAL {} + void visitTemp(Temp *) override final {} }; void mergeBasicBlocks(IR::Function *function, DefUses *du, DominatorTree *dt) diff --git a/src/qml/debugger/debugger.pri b/src/qml/debugger/debugger.pri index da1ab867d4..b8d2347b17 100644 --- a/src/qml/debugger/debugger.pri +++ b/src/qml/debugger/debugger.pri @@ -3,8 +3,11 @@ contains(QT_CONFIG, no-qml-debug) { MODULE_DEFINES += QT_NO_QML_DEBUGGER } else { HEADERS += \ + $$PWD/qqmlconfigurabledebugservice_p.h \ $$PWD/qqmldebugpluginmanager_p.h \ - $$PWD/qqmldebugservicefactory_p.h + $$PWD/qqmldebugservicefactory_p.h \ + $$PWD/qqmldebugserver_p.h \ + $$PWD/qqmldebugserverconnection_p.h SOURCES += \ $$PWD/qqmldebug.cpp \ diff --git a/src/plugins/qmltooling/shared/qqmlconfigurabledebugservice.h b/src/qml/debugger/qqmlconfigurabledebugservice_p.h index 85ff9b182f..e09d5f779a 100644 --- a/src/plugins/qmltooling/shared/qqmlconfigurabledebugservice.h +++ b/src/qml/debugger/qqmlconfigurabledebugservice_p.h @@ -38,8 +38,8 @@ ****************************************************************************/ -#ifndef QQMLCONFIGURABLEDEBUGSEVICE_H -#define QQMLCONFIGURABLEDEBUGSEVICE_H +#ifndef QQMLCONFIGURABLEDEBUGSEVICE_P_H +#define QQMLCONFIGURABLEDEBUGSEVICE_P_H // // W A R N I N G @@ -52,8 +52,9 @@ // We mean it. // -#include <private/qqmldebugservice_p.h> -#include <private/qqmldebugconnector_p.h> +#include "qqmldebugservice_p.h" +#include "qqmldebugconnector_p.h" + #include <QtCore/qmutex.h> QT_BEGIN_NAMESPACE @@ -85,7 +86,7 @@ protected: QQmlDebugConnector::instance()->blockingMode()); } - void stateChanged(QQmlDebugService::State newState) Q_DECL_OVERRIDE + void stateChanged(QQmlDebugService::State newState) override { if (newState != QQmlDebugService::Enabled) stopWaiting(); @@ -93,7 +94,7 @@ protected: init(); } - void engineAboutToBeAdded(QJSEngine *engine) Q_DECL_OVERRIDE + void engineAboutToBeAdded(QJSEngine *engine) override { QMutexLocker lock(&m_configMutex); if (m_waitingForConfiguration) @@ -109,4 +110,4 @@ protected: QT_END_NAMESPACE -#endif // QQMLCONFIGURABLEDEBUGSEVICE_H +#endif // QQMLCONFIGURABLEDEBUGSEVICE_P_H diff --git a/src/plugins/qmltooling/shared/qqmldebugserver.h b/src/qml/debugger/qqmldebugserver_p.h index 109f1e246c..e848b00bda 100644 --- a/src/plugins/qmltooling/shared/qqmldebugserver.h +++ b/src/qml/debugger/qqmldebugserver_p.h @@ -37,12 +37,12 @@ ** ****************************************************************************/ -#ifndef QQMLDEBUGSERVER_H -#define QQMLDEBUGSERVER_H +#ifndef QQMLDEBUGSERVER_P_H +#define QQMLDEBUGSERVER_P_H -#include <private/qqmldebugconnector_p.h> -#include <private/qtqmlglobal_p.h> +#include "qqmldebugconnector_p.h" +#include <private/qtqmlglobal_p.h> #include <QtCore/QIODevice> // @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE -class QQmlDebugServer : public QQmlDebugConnector +class Q_QML_PRIVATE_EXPORT QQmlDebugServer : public QQmlDebugConnector { Q_OBJECT public: @@ -67,4 +67,4 @@ public: QT_END_NAMESPACE -#endif // QQMLDEBUGSERVER_H +#endif // QQMLDEBUGSERVER_P_H diff --git a/src/plugins/qmltooling/shared/qqmldebugserverconnection.h b/src/qml/debugger/qqmldebugserverconnection_p.h index 3fac15acb2..536ad830b4 100644 --- a/src/plugins/qmltooling/shared/qqmldebugserverconnection.h +++ b/src/qml/debugger/qqmldebugserverconnection_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef QQMLDEBUGSERVERCONNECTION_H -#define QQMLDEBUGSERVERCONNECTION_H +#ifndef QQMLDEBUGSERVERCONNECTION_P_H +#define QQMLDEBUGSERVERCONNECTION_P_H #include <private/qtqmlglobal_p.h> #include <QtCore/qobject.h> @@ -56,9 +56,8 @@ QT_BEGIN_NAMESPACE - class QQmlDebugServer; -class QQmlDebugServerConnection : public QObject +class Q_QML_PRIVATE_EXPORT QQmlDebugServerConnection : public QObject { Q_OBJECT public: @@ -73,7 +72,7 @@ public: virtual void flush() = 0; }; -class QQmlDebugServerConnectionFactory : public QObject +class Q_QML_PRIVATE_EXPORT QQmlDebugServerConnectionFactory : public QObject { Q_OBJECT public: diff --git a/src/qml/debugger/qqmldebugserviceinterfaces_p.h b/src/qml/debugger/qqmldebugserviceinterfaces_p.h index 707ef1a937..12965ff383 100644 --- a/src/qml/debugger/qqmldebugserviceinterfaces_p.h +++ b/src/qml/debugger/qqmldebugserviceinterfaces_p.h @@ -116,7 +116,7 @@ public: protected: friend class QQmlDebugConnector; - QV4DebugService(float version, QObject *parent = 0) : + QV4DebugService(float version, QObject *parent = nullptr) : QQmlDebugService(s_key, version, parent) {} }; @@ -138,7 +138,7 @@ public: protected: friend class QQmlDebugConnector; - QQmlProfilerService(float version, QObject *parent = 0) : + QQmlProfilerService(float version, QObject *parent = nullptr) : QQmlDebugService(s_key, version, parent) {} }; @@ -154,7 +154,7 @@ public: protected: friend class QQmlDebugConnector; - QQmlEngineDebugService(float version, QObject *parent = 0) : + QQmlEngineDebugService(float version, QObject *parent = nullptr) : QQmlDebugService(s_key, version, parent) {} QQmlBoundSignal *nextSignal(QQmlBoundSignal *prev) { return prev->m_nextSignal; } @@ -173,7 +173,7 @@ public: protected: friend class QQmlDebugConnector; - QQmlInspectorService(float version, QObject *parent = 0) : + QQmlInspectorService(float version, QObject *parent = nullptr) : QQmlDebugService(s_key, version, parent) {} }; @@ -188,7 +188,7 @@ public: protected: friend class QQmlDebugConnector; - QDebugMessageService(float version, QObject *parent = 0) : + QDebugMessageService(float version, QObject *parent = nullptr) : QQmlDebugService(s_key, version, parent) {} }; @@ -201,7 +201,7 @@ public: protected: friend class QQmlDebugConnector; - QQmlEngineControlService(float version, QObject *parent = 0) : + QQmlEngineControlService(float version, QObject *parent = nullptr) : QQmlDebugService(s_key, version, parent) {} }; @@ -215,7 +215,7 @@ public: protected: friend class QQmlDebugConnector; - QQmlNativeDebugService(float version, QObject *parent = 0) + QQmlNativeDebugService(float version, QObject *parent = nullptr) : QQmlDebugService(s_key, version, parent) {} }; diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h index 9e38696d7a..2ae4818814 100644 --- a/src/qml/jit/qv4assembler_p.h +++ b/src/qml/jit/qv4assembler_p.h @@ -80,11 +80,11 @@ struct CompilationUnit : public QV4::CompiledData::CompilationUnit virtual ~CompilationUnit(); #if !defined(V4_BOOTSTRAP) - void linkBackendToEngine(QV4::ExecutionEngine *engine) Q_DECL_OVERRIDE; - bool memoryMapCode(QString *errorString) Q_DECL_OVERRIDE; + void linkBackendToEngine(QV4::ExecutionEngine *engine) override; + bool memoryMapCode(QString *errorString) override; #endif - void prepareCodeOffsetsForDiskStorage(CompiledData::Unit *unit) Q_DECL_OVERRIDE; - bool saveCodeToDisk(QIODevice *device, const CompiledData::Unit *unit, QString *errorString) Q_DECL_OVERRIDE; + void prepareCodeOffsetsForDiskStorage(CompiledData::Unit *unit) override; + bool saveCodeToDisk(QIODevice *device, const CompiledData::Unit *unit, QString *errorString) override; // Coderef + execution engine diff --git a/src/qml/jit/qv4isel_masm_p.h b/src/qml/jit/qv4isel_masm_p.h index 7019a117a2..869f857c41 100644 --- a/src/qml/jit/qv4isel_masm_p.h +++ b/src/qml/jit/qv4isel_masm_p.h @@ -302,11 +302,11 @@ class Q_QML_EXPORT ISelFactory: public EvalISelFactory public: ISelFactory() : EvalISelFactory(QStringLiteral("jit")) {} virtual ~ISelFactory() {} - EvalInstructionSelection *create(QQmlEnginePrivate *qmlEngine, QV4::ExecutableAllocator *execAllocator, IR::Module *module, QV4::Compiler::JSUnitGenerator *jsGenerator) Q_DECL_OVERRIDE Q_DECL_FINAL + EvalInstructionSelection *create(QQmlEnginePrivate *qmlEngine, QV4::ExecutableAllocator *execAllocator, IR::Module *module, QV4::Compiler::JSUnitGenerator *jsGenerator) override final { return new InstructionSelection<JITAssembler>(qmlEngine, execAllocator, module, jsGenerator, this); } - bool jitCompileRegexps() const Q_DECL_OVERRIDE Q_DECL_FINAL + bool jitCompileRegexps() const override final { return true; } - QQmlRefPointer<CompiledData::CompilationUnit> createUnitForLoading() Q_DECL_OVERRIDE Q_DECL_FINAL; + QQmlRefPointer<CompiledData::CompilationUnit> createUnitForLoading() override final; }; } // end of namespace JIT diff --git a/src/qml/jit/qv4regalloc.cpp b/src/qml/jit/qv4regalloc.cpp index d418b050c4..cd2d53ab40 100644 --- a/src/qml/jit/qv4regalloc.cpp +++ b/src/qml/jit/qv4regalloc.cpp @@ -87,7 +87,7 @@ public: {} protected: - void addStmtNr(Stmt *s) Q_DECL_OVERRIDE Q_DECL_FINAL + void addStmtNr(Stmt *s) override final { addJustifiedNr(intervals->positionForStatement(s)); } @@ -115,7 +115,7 @@ public: } protected: - void visitTemp(Temp *e) Q_DECL_OVERRIDE Q_DECL_FINAL + void visitTemp(Temp *e) override final { switch (e->kind) { case Temp::PhysicalRegister: { diff --git a/src/qml/jsapi/qjsengine.h b/src/qml/jsapi/qjsengine.h index 41c4b81270..f92a26445f 100644 --- a/src/qml/jsapi/qjsengine.h +++ b/src/qml/jsapi/qjsengine.h @@ -119,7 +119,7 @@ private: friend inline bool qjsvalue_cast_helper(const QJSValue &, int, void *); protected: - QJSEngine(QJSEnginePrivate &dd, QObject *parent = Q_NULLPTR); + QJSEngine(QJSEnginePrivate &dd, QObject *parent = nullptr); private: QV8Engine *d; diff --git a/src/qml/jsruntime/qv4identifier.cpp b/src/qml/jsruntime/qv4identifier.cpp index 6260fd0cc8..e35f72b820 100644 --- a/src/qml/jsruntime/qv4identifier.cpp +++ b/src/qml/jsruntime/qv4identifier.cpp @@ -152,7 +152,7 @@ const IdentifierHashEntry *IdentifierHashBase::lookup(const QString &str) const return 0; Q_ASSERT(d->entries); - uint hash = String::createHashValue(str.constData(), str.length(), Q_NULLPTR); + uint hash = String::createHashValue(str.constData(), str.length(), nullptr); uint idx = hash % d->alloc; while (1) { if (!d->entries[idx].identifier) diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 50cecb6598..17d0c32853 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -601,7 +601,7 @@ struct Q_QML_PRIVATE_EXPORT Primitive : public Value inline Primitive Primitive::undefinedValue() { Primitive v; - v.setM(Q_NULLPTR); + v.setM(nullptr); return v; } diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h index 9ee50ec931..956805d696 100644 --- a/src/qml/qml/ftw/qhashedstring_p.h +++ b/src/qml/qml/ftw/qhashedstring_p.h @@ -1311,12 +1311,12 @@ bool QHashedString::compare(const char *lhs, const char *rhs, int length) quint32 QHashedString::stringHash(const QChar *data, int length) { - return QV4::String::createHashValue(data, length, Q_NULLPTR); + return QV4::String::createHashValue(data, length, nullptr); } quint32 QHashedString::stringHash(const char *data, int length) { - return QV4::String::createHashValue(data, length, Q_NULLPTR); + return QV4::String::createHashValue(data, length, nullptr); } void QHashedString::computeHash() const diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index ddb4af0b81..219df264be 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -112,10 +112,10 @@ int qmlRegisterType() qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), 0, - Q_NULLPTR, + nullptr, QString(), - Q_NULLPTR, 0, 0, Q_NULLPTR, &T::staticMetaObject, + nullptr, 0, 0, nullptr, &T::staticMetaObject, QQmlPrivate::attachedPropertiesFunc<T>(), QQmlPrivate::attachedPropertiesMetaObject<T>(), @@ -124,9 +124,9 @@ int qmlRegisterType() QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - Q_NULLPTR, Q_NULLPTR, + nullptr, nullptr, - Q_NULLPTR, + nullptr, 0 }; @@ -146,7 +146,7 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), 0, - Q_NULLPTR, + nullptr, reason, uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -158,9 +158,9 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - Q_NULLPTR, Q_NULLPTR, + nullptr, nullptr, - Q_NULLPTR, + nullptr, 0 }; @@ -178,7 +178,7 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), 0, - Q_NULLPTR, + nullptr, reason, uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -190,9 +190,9 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - Q_NULLPTR, Q_NULLPTR, + nullptr, nullptr, - Q_NULLPTR, + nullptr, metaObjectRevision }; @@ -217,7 +217,7 @@ int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int ve qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), 0, - Q_NULLPTR, + nullptr, reason, uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -231,7 +231,7 @@ int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int ve QQmlPrivate::createParent<E>, &E::staticMetaObject, - Q_NULLPTR, + nullptr, 0 }; @@ -256,7 +256,7 @@ int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int ve qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), 0, - Q_NULLPTR, + nullptr, reason, uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -270,7 +270,7 @@ int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int ve QQmlPrivate::createParent<E>, &E::staticMetaObject, - Q_NULLPTR, + nullptr, metaObjectRevision }; @@ -301,9 +301,9 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - Q_NULLPTR, Q_NULLPTR, + nullptr, nullptr, - Q_NULLPTR, + nullptr, 0 }; @@ -332,9 +332,9 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - Q_NULLPTR, Q_NULLPTR, + nullptr, nullptr, - Q_NULLPTR, + nullptr, metaObjectRevision }; @@ -363,9 +363,9 @@ int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor) QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - Q_NULLPTR, Q_NULLPTR, + nullptr, nullptr, - Q_NULLPTR, + nullptr, metaObjectRevision }; @@ -384,10 +384,10 @@ int qmlRegisterExtendedType() qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), 0, - Q_NULLPTR, + nullptr, QString(), - Q_NULLPTR, 0, 0, Q_NULLPTR, &T::staticMetaObject, + nullptr, 0, 0, nullptr, &T::staticMetaObject, QQmlPrivate::attachedPropertiesFunc<T>(), QQmlPrivate::attachedPropertiesMetaObject<T>(), @@ -398,7 +398,7 @@ int qmlRegisterExtendedType() QQmlPrivate::createParent<E>, &E::staticMetaObject, - Q_NULLPTR, + nullptr, 0 }; @@ -437,7 +437,7 @@ int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor, QQmlPrivate::createParent<E>, &E::staticMetaObject, - Q_NULLPTR, + nullptr, 0 }; @@ -487,7 +487,7 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - Q_NULLPTR, Q_NULLPTR, + nullptr, nullptr, parser, 0 @@ -583,7 +583,7 @@ inline int qmlRegisterSingletonType(const char *uri, int versionMajor, int versi uri, versionMajor, versionMinor, typeName, - callback, Q_NULLPTR, Q_NULLPTR, 0, 0 + callback, nullptr, nullptr, 0, 0 }; return QQmlPrivate::qmlregister(QQmlPrivate::SingletonRegistration, &api); @@ -601,7 +601,7 @@ inline int qmlRegisterSingletonType(const char *uri, int versionMajor, int versi uri, versionMajor, versionMinor, typeName, - Q_NULLPTR, callback, &T::staticMetaObject, qRegisterNormalizedMetaType<T *>(pointerName.constData()), 0 + nullptr, callback, &T::staticMetaObject, qRegisterNormalizedMetaType<T *>(pointerName.constData()), 0 }; return QQmlPrivate::qmlregister(QQmlPrivate::SingletonRegistration, &api); diff --git a/src/qml/qml/qqmlapplicationengine.h b/src/qml/qml/qqmlapplicationengine.h index 6c57f46c72..d0f9e6d319 100644 --- a/src/qml/qml/qqmlapplicationengine.h +++ b/src/qml/qml/qqmlapplicationengine.h @@ -53,9 +53,9 @@ class Q_QML_EXPORT QQmlApplicationEngine : public QQmlEngine { Q_OBJECT public: - QQmlApplicationEngine(QObject *parent = Q_NULLPTR); - QQmlApplicationEngine(const QUrl &url, QObject *parent = Q_NULLPTR); - QQmlApplicationEngine(const QString &filePath, QObject *parent = Q_NULLPTR); + QQmlApplicationEngine(QObject *parent = nullptr); + QQmlApplicationEngine(const QUrl &url, QObject *parent = nullptr); + QQmlApplicationEngine(const QString &filePath, QObject *parent = nullptr); ~QQmlApplicationEngine(); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 566fbb86ac..43ab74138c 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -180,7 +180,7 @@ class QQmlBindingBinding: public QQmlBinding { protected: void doUpdate(const DeleteWatcher &, - QQmlPropertyData::WriteFlags flags, QV4::Scope &) Q_DECL_OVERRIDE Q_DECL_FINAL + QQmlPropertyData::WriteFlags flags, QV4::Scope &) override final { Q_ASSERT(!m_targetIndex.hasValueTypeIndex()); QQmlPropertyData *pd = nullptr; @@ -196,7 +196,7 @@ class QQmlNonbindingBinding: public QQmlBinding { protected: void doUpdate(const DeleteWatcher &watcher, - QQmlPropertyData::WriteFlags flags, QV4::Scope &scope) Q_DECL_OVERRIDE + QQmlPropertyData::WriteFlags flags, QV4::Scope &scope) override { auto ep = QQmlEnginePrivate::get(scope.engine); ep->referenceScarceResources(); @@ -238,7 +238,7 @@ class GenericBinding: public QQmlNonbindingBinding protected: // Returns true if successful, false if an error description was set on expression Q_ALWAYS_INLINE bool write(const QV4::Value &result, bool isUndefined, - QQmlPropertyData::WriteFlags flags) Q_DECL_OVERRIDE Q_DECL_FINAL + QQmlPropertyData::WriteFlags flags) override final { Q_ASSERT(targetObject()); @@ -307,7 +307,7 @@ public: } void doUpdate(const DeleteWatcher &watcher, - QQmlPropertyData::WriteFlags flags, QV4::Scope &) Q_DECL_OVERRIDE Q_DECL_FINAL + QQmlPropertyData::WriteFlags flags, QV4::Scope &) override final { if (watcher.wasDeleted()) return; @@ -622,7 +622,7 @@ public: protected: Q_ALWAYS_INLINE bool write(const QV4::Value &result, bool isUndefined, - QQmlPropertyData::WriteFlags flags) Q_DECL_OVERRIDE Q_DECL_FINAL + QQmlPropertyData::WriteFlags flags) override final { QQmlPropertyData *pd; QQmlPropertyData vtpd; diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h index 38d59a8919..8bc9554a42 100644 --- a/src/qml/qml/qqmlbinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -86,10 +86,10 @@ public: void setNotifyOnValueChanged(bool); - void refresh() Q_DECL_OVERRIDE; + void refresh() override; - void setEnabled(bool, QQmlPropertyData::WriteFlags flags = QQmlPropertyData::DontRemoveBinding) Q_DECL_OVERRIDE; - QString expression() const Q_DECL_OVERRIDE; + void setEnabled(bool, QQmlPropertyData::WriteFlags flags = QQmlPropertyData::DontRemoveBinding) override; + QString expression() const override; void update(QQmlPropertyData::WriteFlags flags = QQmlPropertyData::DontRemoveBinding); typedef int Identifier; diff --git a/src/qml/qml/qqmlcomponent.h b/src/qml/qml/qqmlcomponent.h index ca60f01eb5..b8cc556e4a 100644 --- a/src/qml/qml/qqmlcomponent.h +++ b/src/qml/qml/qqmlcomponent.h @@ -77,12 +77,12 @@ public: enum CompilationMode { PreferSynchronous, Asynchronous }; Q_ENUM(CompilationMode) - QQmlComponent(QObject *parent = Q_NULLPTR); - QQmlComponent(QQmlEngine *, QObject *parent = Q_NULLPTR); - QQmlComponent(QQmlEngine *, const QString &fileName, QObject *parent = Q_NULLPTR); - QQmlComponent(QQmlEngine *, const QString &fileName, CompilationMode mode, QObject *parent = Q_NULLPTR); - QQmlComponent(QQmlEngine *, const QUrl &url, QObject *parent = Q_NULLPTR); - QQmlComponent(QQmlEngine *, const QUrl &url, CompilationMode mode, QObject *parent = Q_NULLPTR); + QQmlComponent(QObject *parent = nullptr); + QQmlComponent(QQmlEngine *, QObject *parent = nullptr); + QQmlComponent(QQmlEngine *, const QString &fileName, QObject *parent = nullptr); + QQmlComponent(QQmlEngine *, const QString &fileName, CompilationMode mode, QObject *parent = nullptr); + QQmlComponent(QQmlEngine *, const QUrl &url, QObject *parent = nullptr); + QQmlComponent(QQmlEngine *, const QUrl &url, CompilationMode mode, QObject *parent = nullptr); virtual ~QQmlComponent(); enum Status { Null, Ready, Loading, Error }; @@ -101,12 +101,12 @@ public: QUrl url() const; - virtual QObject *create(QQmlContext *context = Q_NULLPTR); + virtual QObject *create(QQmlContext *context = nullptr); virtual QObject *beginCreate(QQmlContext *); virtual void completeCreate(); - void create(QQmlIncubator &, QQmlContext *context = Q_NULLPTR, - QQmlContext *forContext = Q_NULLPTR); + void create(QQmlIncubator &, QQmlContext *context = nullptr, + QQmlContext *forContext = nullptr); QQmlContext *creationContext() const; diff --git a/src/qml/qml/qqmlcontext.h b/src/qml/qml/qqmlcontext.h index 781eac44fc..b2b95b7573 100644 --- a/src/qml/qml/qqmlcontext.h +++ b/src/qml/qml/qqmlcontext.h @@ -62,8 +62,8 @@ class Q_QML_EXPORT QQmlContext : public QObject Q_DECLARE_PRIVATE(QQmlContext) public: - QQmlContext(QQmlEngine *parent, QObject *objParent = Q_NULLPTR); - QQmlContext(QQmlContext *parent, QObject *objParent = Q_NULLPTR); + QQmlContext(QQmlEngine *parent, QObject *objParent = nullptr); + QQmlContext(QQmlContext *parent, QObject *objParent = nullptr); virtual ~QQmlContext(); bool isValid() const; diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 8f3c8ea8dd..a3fe4cad0f 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -131,21 +131,21 @@ int qmlRegisterUncreatableMetaObject(const QMetaObject &staticMetaObject, 0, 0, 0, - Q_NULLPTR, + nullptr, reason, uri, versionMajor, versionMinor, qmlName, &staticMetaObject, QQmlAttachedPropertiesFunc(), - Q_NULLPTR, + nullptr, 0, 0, 0, - Q_NULLPTR, Q_NULLPTR, + nullptr, nullptr, - Q_NULLPTR, + nullptr, 0 }; diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h index 2bf4c0497b..b775054253 100644 --- a/src/qml/qml/qqmlengine.h +++ b/src/qml/qml/qqmlengine.h @@ -97,7 +97,7 @@ class Q_QML_EXPORT QQmlEngine : public QJSEngine Q_PROPERTY(QString offlineStoragePath READ offlineStoragePath WRITE setOfflineStoragePath) Q_OBJECT public: - explicit QQmlEngine(QObject *p = Q_NULLPTR); + explicit QQmlEngine(QObject *p = nullptr); virtual ~QQmlEngine(); QQmlContext *rootContext() const; diff --git a/src/qml/qml/qqmlexpression.h b/src/qml/qml/qqmlexpression.h index 5239d59c8a..e9c8770e92 100644 --- a/src/qml/qml/qqmlexpression.h +++ b/src/qml/qml/qqmlexpression.h @@ -60,8 +60,8 @@ class Q_QML_EXPORT QQmlExpression : public QObject Q_OBJECT public: QQmlExpression(); - QQmlExpression(QQmlContext *, QObject *, const QString &, QObject * = Q_NULLPTR); - explicit QQmlExpression(const QQmlScriptString &, QQmlContext * = Q_NULLPTR, QObject * = Q_NULLPTR, QObject * = Q_NULLPTR); + QQmlExpression(QQmlContext *, QObject *, const QString &, QObject * = nullptr); + explicit QQmlExpression(const QQmlScriptString &, QQmlContext * = nullptr, QObject * = nullptr, QObject * = nullptr); virtual ~QQmlExpression(); QQmlEngine *engine() const; @@ -84,7 +84,7 @@ public: void clearError(); QQmlError error() const; - QVariant evaluate(bool *valueIsUndefined = Q_NULLPTR); + QVariant evaluate(bool *valueIsUndefined = nullptr); Q_SIGNALS: void valueChanged(); diff --git a/src/qml/qml/qqmlextensionplugin.h b/src/qml/qml/qqmlextensionplugin.h index c0915c0abe..84a46fb93e 100644 --- a/src/qml/qml/qqmlextensionplugin.h +++ b/src/qml/qml/qqmlextensionplugin.h @@ -58,7 +58,7 @@ class Q_QML_EXPORT QQmlExtensionPlugin Q_INTERFACES(QQmlExtensionInterface) Q_INTERFACES(QQmlTypesExtensionInterface) public: - explicit QQmlExtensionPlugin(QObject *parent = Q_NULLPTR); + explicit QQmlExtensionPlugin(QObject *parent = nullptr); ~QQmlExtensionPlugin(); QUrl baseUrl() const; diff --git a/src/qml/qml/qqmlfileselector.h b/src/qml/qml/qqmlfileselector.h index 03b951420e..4eaf92c918 100644 --- a/src/qml/qml/qqmlfileselector.h +++ b/src/qml/qml/qqmlfileselector.h @@ -54,7 +54,7 @@ class Q_QML_EXPORT QQmlFileSelector : public QObject Q_OBJECT Q_DECLARE_PRIVATE(QQmlFileSelector) public: - explicit QQmlFileSelector(QQmlEngine *engine, QObject *parent = Q_NULLPTR); + explicit QQmlFileSelector(QQmlEngine *engine, QObject *parent = nullptr); ~QQmlFileSelector(); QFileSelector *selector() const Q_DECL_NOTHROW; void setSelector(QFileSelector *selector); diff --git a/src/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h index e3955deee5..4c6ae0cb8f 100644 --- a/src/qml/qml/qqmllist.h +++ b/src/qml/qml/qqmllist.h @@ -61,20 +61,20 @@ public: typedef void (*ClearFunction)(QQmlListProperty<T> *); QQmlListProperty() - : object(Q_NULLPTR), - data(Q_NULLPTR), - append(Q_NULLPTR), - count(Q_NULLPTR), - at(Q_NULLPTR), - clear(Q_NULLPTR), - dummy1(Q_NULLPTR), - dummy2(Q_NULLPTR) + : object(nullptr), + data(nullptr), + append(nullptr), + count(nullptr), + at(nullptr), + clear(nullptr), + dummy1(nullptr), + dummy2(nullptr) {} QQmlListProperty(QObject *o, QList<T *> &list) : object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at), clear(qlist_clear), - dummy1(Q_NULLPTR), - dummy2(Q_NULLPTR) + dummy1(nullptr), + dummy2(nullptr) {} QQmlListProperty(QObject *o, void *d, AppendFunction a, CountFunction c, AtFunction t, ClearFunction r ) @@ -84,17 +84,17 @@ public: count(c), at(t), clear(r), - dummy1(Q_NULLPTR), - dummy2(Q_NULLPTR) + dummy1(nullptr), + dummy2(nullptr) {} QQmlListProperty(QObject *o, void *d, CountFunction c, AtFunction t) : object(o), data(d), - append(Q_NULLPTR), + append(nullptr), count(c), at(t), - clear(Q_NULLPTR), - dummy1(Q_NULLPTR), - dummy2(Q_NULLPTR) + clear(nullptr), + dummy1(nullptr), + dummy2(nullptr) {} bool operator==(const QQmlListProperty &o) const { return object == o.object && @@ -140,7 +140,7 @@ class Q_QML_EXPORT QQmlListReference { public: QQmlListReference(); - QQmlListReference(QObject *, const char *property, QQmlEngine * = Q_NULLPTR); + QQmlListReference(QObject *, const char *property, QQmlEngine * = nullptr); QQmlListReference(const QQmlListReference &); QQmlListReference &operator=(const QQmlListReference &); ~QQmlListReference(); diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 8e6be538ef..4f69017ff0 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -235,7 +235,7 @@ public: struct PropertyCacheByMinorVersion { - PropertyCacheByMinorVersion() : cache(Q_NULLPTR), minorVersion(-1) {} + PropertyCacheByMinorVersion() : cache(nullptr), minorVersion(-1) {} explicit PropertyCacheByMinorVersion(QQmlPropertyCache *pc, int ver) : cache(pc), minorVersion(ver) {} QQmlPropertyCachePtr cache; int minorVersion; @@ -840,7 +840,7 @@ QQmlPropertyCache *QQmlTypePrivate::propertyCacheForMinorVersion(int minorVersio for (int i = 0; i < propertyCaches.count(); ++i) if (propertyCaches.at(i).minorVersion == minorVersion) return propertyCaches.at(i).cache; - return Q_NULLPTR; + return nullptr; } void QQmlTypePrivate::setPropertyCacheForMinorVersion(int minorVersion, QQmlPropertyCache *cache) @@ -2442,7 +2442,7 @@ void QQmlMetaType::freeUnusedTypesAndCaches() while (it != data->propertyCaches.end()) { if ((*it)->count() == 1) { - QQmlPropertyCache *pc = Q_NULLPTR; + QQmlPropertyCache *pc = nullptr; qSwap(pc, *it); it = data->propertyCaches.erase(it); pc->release(); diff --git a/src/qml/qml/qqmlnotifier.cpp b/src/qml/qml/qqmlnotifier.cpp index 938e2b77e2..e068ad174a 100644 --- a/src/qml/qml/qqmlnotifier.cpp +++ b/src/qml/qml/qqmlnotifier.cpp @@ -74,7 +74,7 @@ namespace { void QQmlNotifier::notify(QQmlData *ddata, int notifierIndex) { if (QQmlNotifierEndpoint *ep = ddata->notify(notifierIndex)) - emitNotify(ep, Q_NULLPTR); + emitNotify(ep, nullptr); } void QQmlNotifier::emitNotify(QQmlNotifierEndpoint *endpoint, void **a) diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 11fc3ceb44..d009536767 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -1113,8 +1113,16 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo return 0; } } - if (parent) + if (instance->isWidgetType()) { + if (parent && parent->isWidgetType()) { + QAbstractDeclarativeData::setWidgetParent(instance, parent); + } else { + // No parent! Layouts need to handle this through a default property that + // reparents accordingly. Otherwise the garbage collector will collect. + } + } else if (parent) { QQml_setParent_noEvent(instance, parent); + } ddata = QQmlData::get(instance, /*create*/true); ddata->lineNumber = obj->location.line; diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index ce47ab9fa9..a5cdccc97a 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -399,11 +399,11 @@ ReturnedValue QQmlValueTypeWrapper::get(const Managed *m, String *name, bool *ha VALUE_TYPE_LOAD(QMetaType::Bool, bool, bool); QVariant v; - void *args[] = { Q_NULLPTR, Q_NULLPTR }; + void *args[] = { nullptr, nullptr }; if (result->propType() == QMetaType::QVariant) { args[0] = &v; } else { - v = QVariant(result->propType(), static_cast<void *>(Q_NULLPTR)); + v = QVariant(result->propType(), static_cast<void *>(nullptr)); args[0] = v.data(); } metaObject->d.static_metacall(reinterpret_cast<QObject*>(gadget), QMetaObject::ReadProperty, index, args); diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h index 891db5eb3f..27e638ceb4 100644 --- a/src/qml/qml/qqmlvmemetaobject_p.h +++ b/src/qml/qml/qqmlvmemetaobject_p.h @@ -101,7 +101,7 @@ public: static QQmlInterceptorMetaObject *get(QObject *obj); - QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *o) Q_DECL_OVERRIDE; + QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *o) override; // Used by auto-tests for inspection QQmlPropertyCache *propertyCache() const { return cache; } @@ -118,7 +118,7 @@ public: } protected: - int metaCall(QObject *o, QMetaObject::Call c, int id, void **a) Q_DECL_OVERRIDE; + int metaCall(QObject *o, QMetaObject::Call c, int id, void **a) override; bool intercept(QMetaObject::Call c, int id, void **a); public: @@ -163,7 +163,7 @@ public: static QQmlVMEMetaObject *getForSignal(QObject *o, int coreIndex); protected: - int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a) Q_DECL_OVERRIDE; + int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a) override; public: QV4::ExecutionEngine *engine; diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index 1630efe081..25d99e0c87 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -521,7 +521,7 @@ void QtObject::method_matrix4x4(const BuiltinFunction *, Scope &scope, CallData QV4::ExecutionEngine *v4 = scope.engine; if (callData->argc == 0) { - scope.result = scope.engine->fromVariant(QQml_valueTypeProvider()->createValueType(QMetaType::QMatrix4x4, 0, Q_NULLPTR)); + scope.result = scope.engine->fromVariant(QQml_valueTypeProvider()->createValueType(QMetaType::QMatrix4x4, 0, nullptr)); return; } diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp index d72d2e9487..c8f8a0fc70 100644 --- a/src/qml/types/qqmllistmodel.cpp +++ b/src/qml/types/qqmllistmodel.cpp @@ -42,6 +42,7 @@ #include <private/qqmlopenmetaobject_p.h> #include <private/qqmljsast_p.h> #include <private/qqmljsengine_p.h> +#include <private/qjsvalue_p.h> #include <private/qqmlcustomparser_p.h> #include <private/qqmlengine_p.h> @@ -84,7 +85,7 @@ static QString roleTypeName(ListLayout::Role::DataType t) static const QString roleTypeNames[] = { QStringLiteral("String"), QStringLiteral("Number"), QStringLiteral("Bool"), QStringLiteral("List"), QStringLiteral("QObject"), QStringLiteral("VariantMap"), - QStringLiteral("DateTime") + QStringLiteral("DateTime"), QStringLiteral("Function") }; if (t > ListLayout::Role::Invalid && t < ListLayout::Role::MaxDataType) @@ -123,8 +124,8 @@ const ListLayout::Role &ListLayout::getRoleOrCreate(QV4::String *key, Role::Data const ListLayout::Role &ListLayout::createRole(const QString &key, ListLayout::Role::DataType type) { - const int dataSizes[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QPointer<QObject>), sizeof(QVariantMap), sizeof(QDateTime) }; - const int dataAlignments[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QObject *), sizeof(QVariantMap), sizeof(QDateTime) }; + const int dataSizes[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QPointer<QObject>), sizeof(QVariantMap), sizeof(QDateTime), sizeof(QJSValue) }; + const int dataAlignments[] = { sizeof(QString), sizeof(double), sizeof(bool), sizeof(ListModel *), sizeof(QObject *), sizeof(QVariantMap), sizeof(QDateTime), sizeof(QJSValue) }; Role *r = new Role; r->name = key; @@ -217,11 +218,20 @@ const ListLayout::Role *ListLayout::getRoleOrCreate(const QString &key, const QV switch (data.type()) { case QVariant::Double: type = Role::Number; break; case QVariant::Int: type = Role::Number; break; - case QVariant::UserType: type = Role::List; break; case QVariant::Bool: type = Role::Bool; break; case QVariant::String: type = Role::String; break; case QVariant::Map: type = Role::VariantMap; break; case QVariant::DateTime: type = Role::DateTime; break; + case QVariant::UserType: { + if (data.userType() == qMetaTypeId<QJSValue>() && + data.value<QJSValue>().isCallable()) { + type = Role::Function; + break; + } else { + type = Role::List; + break; + } + } default: type = Role::Invalid; break; } @@ -465,6 +475,12 @@ void ListModel::set(int elementIndex, QV4::Object *object, QVector<int> *roles) const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::DateTime); QDateTime dt = dd->toQDateTime(); roleIndex = e->setDateTimeProperty(r, dt); + } else if (QV4::FunctionObject *f = propertyValue->as<QV4::FunctionObject>()) { + const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Function); + QV4::ScopedFunctionObject func(scope, f); + QJSValue jsv; + QJSValuePrivate::setValue(&jsv, v4, func); + roleIndex = e->setFunctionProperty(r, jsv); } else if (QV4::Object *o = propertyValue->as<QV4::Object>()) { if (QV4::QObjectWrapper *wrapper = o->as<QV4::QObjectWrapper>()) { QObject *o = wrapper->object(); @@ -688,6 +704,17 @@ QDateTime *ListElement::getDateTimeProperty(const ListLayout::Role &role) return dt; } +QJSValue *ListElement::getFunctionProperty(const ListLayout::Role &role) +{ + QJSValue *f = 0; + + char *mem = getPropertyMemory(role); + if (isMemoryUsed<QJSValue>(mem)) + f = reinterpret_cast<QJSValue *>(mem); + + return f; +} + QPointer<QObject> *ListElement::getGuardProperty(const ListLayout::Role &role) { char *mem = getPropertyMemory(role); @@ -781,6 +808,14 @@ QVariant ListElement::getProperty(const ListLayout::Role &role, const QQmlListMo } } break; + case ListLayout::Role::Function: + { + if (isMemoryUsed<QJSValue>(mem)) { + QJSValue *func = reinterpret_cast<QJSValue *>(mem); + data = QVariant::fromValue(*func); + } + } + break; default: break; } @@ -943,6 +978,24 @@ int ListElement::setDateTimeProperty(const ListLayout::Role &role, const QDateTi return roleIndex; } +int ListElement::setFunctionProperty(const ListLayout::Role &role, const QJSValue &f) +{ + int roleIndex = -1; + + if (role.type == ListLayout::Role::Function) { + char *mem = getPropertyMemory(role); + if (isMemoryUsed<QJSValue>(mem)) { + QJSValue *f = reinterpret_cast<QJSValue *>(mem); + f->~QJSValue(); + } + new (mem) QJSValue(f); + roleIndex = role.index; + } + + return roleIndex; +} + + void ListElement::setStringPropertyFast(const ListLayout::Role &role, const QString &s) { char *mem = getPropertyMemory(role); @@ -989,6 +1042,12 @@ void ListElement::setDateTimePropertyFast(const ListLayout::Role &role, const QD new (mem) QDateTime(dt); } +void ListElement::setFunctionPropertyFast(const ListLayout::Role &role, const QJSValue &f) +{ + char *mem = getPropertyMemory(role); + new (mem) QJSValue(f); +} + void ListElement::clearProperty(const ListLayout::Role &role) { switch (role.type) { @@ -1013,6 +1072,9 @@ void ListElement::clearProperty(const ListLayout::Role &role) case ListLayout::Role::VariantMap: setVariantMapProperty(role, (QVariantMap *)0); break; + case ListLayout::Role::Function: + setFunctionProperty(role, QJSValue()); + break; default: break; } @@ -1070,6 +1132,7 @@ void ListElement::sync(ListElement *src, ListLayout *srcLayout, ListElement *tar case ListLayout::Role::Number: case ListLayout::Role::Bool: case ListLayout::Role::DateTime: + case ListLayout::Role::Function: { QVariant v = src->getProperty(srcRole, 0, 0); target->setVariantProperty(targetRole, v); @@ -1132,6 +1195,13 @@ void ListElement::destroy(ListLayout *layout) dt->~QDateTime(); } break; + case ListLayout::Role::Function: + { + QJSValue *f = getFunctionProperty(r); + if (f) + f->~QJSValue(); + } + break; default: // other types don't need explicit cleanup. break; @@ -1171,6 +1241,9 @@ int ListElement::setVariantProperty(const ListLayout::Role &role, const QVariant case ListLayout::Role::DateTime: roleIndex = setDateTimeProperty(role, d.toDateTime()); break; + case ListLayout::Role::Function: + roleIndex = setFunctionProperty(role, d.value<QJSValue>()); + break; default: break; } @@ -1213,6 +1286,11 @@ int ListElement::setJsProperty(const ListLayout::Role &role, const QV4::Value &d QV4::Scoped<QV4::DateObject> dd(scope, d); QDateTime dt = dd->toQDateTime(); roleIndex = setDateTimeProperty(role, dt); + } else if (d.as<QV4::FunctionObject>()) { + QV4::ScopedFunctionObject f(scope, d); + QJSValue jsv; + QJSValuePrivate::setValue(&jsv, eng, f); + roleIndex = setFunctionProperty(role, jsv); } else if (d.isObject()) { QV4::ScopedObject o(scope, d); QV4::QObjectWrapper *wrapper = o->as<QV4::QObjectWrapper>(); @@ -2443,7 +2521,7 @@ bool QQmlListModelParser::verifyProperty(const QV4::CompiledData::Unit *qmlUnit, } } else if (binding->type == QV4::CompiledData::Binding::Type_Script) { QString scriptStr = binding->valueAsScriptString(qmlUnit); - if (!definesEmptyList(scriptStr)) { + if (!binding->isFunctionExpression() && !definesEmptyList(scriptStr)) { QByteArray script = scriptStr.toUtf8(); bool ok; evaluateEnum(script, &ok); @@ -2457,7 +2535,7 @@ bool QQmlListModelParser::verifyProperty(const QV4::CompiledData::Unit *qmlUnit, return true; } -bool QQmlListModelParser::applyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding, ListModel *model, int outterElementIndex) +bool QQmlListModelParser::applyProperty(QV4::CompiledData::CompilationUnit *compilationUnit, const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding, ListModel *model, int outterElementIndex) { const QString elementName = qmlUnit->stringAt(binding->propertyNameIndex); @@ -2485,7 +2563,7 @@ bool QQmlListModelParser::applyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *subBinding = target->bindingTable(); for (quint32 i = 0; i < target->nBindings; ++i, ++subBinding) { - roleSet |= applyProperty(qmlUnit, subBinding, subModel, elementIndex); + roleSet |= applyProperty(compilationUnit, qmlUnit, subBinding, subModel, elementIndex); } } else { @@ -2503,6 +2581,25 @@ bool QQmlListModelParser::applyProperty(const QV4::CompiledData::Unit *qmlUnit, const ListLayout::Role &role = model->getOrCreateListRole(elementName); ListModel *emptyModel = new ListModel(role.subLayout, 0, -1); value = QVariant::fromValue(emptyModel); + } else if (binding->isFunctionExpression()) { + QQmlBinding::Identifier id = binding->value.compiledScriptIndex; + Q_ASSERT(id != QQmlBinding::Invalid); + + auto v4 = compilationUnit->engine; + QV4::Scope scope(v4); + // for now we do not provide a context object; data from the ListElement must be passed to the function + QV4::ScopedContext context(scope, QV4::QmlContext::create(v4->rootContext(), QQmlContextData::get(qmlContext(model->m_modelCache)), nullptr)); + QV4::ScopedFunctionObject function(scope, QV4::FunctionObject::createScriptFunction(context, compilationUnit->runtimeFunctions[id])); + + // ### we need the inner function declaration (at this point the function has been wrapped) + const unsigned int parameterCount = function->formalParameterCount(); + QV4::ScopedCallData callData(scope, parameterCount); + callData->thisObject = v4->globalObject; + function->call(scope, callData); + + QJSValue v; + QJSValuePrivate::setValue(&v, v4, scope.result); + value.setValue<QJSValue>(v); } else { QByteArray script = scriptStr.toUtf8(); bool ok; @@ -2546,7 +2643,7 @@ void QQmlListModelParser::applyBindings(QObject *obj, QV4::CompiledData::Compila for (const QV4::CompiledData::Binding *binding : bindings) { if (binding->type != QV4::CompiledData::Binding::Type_Object) continue; - setRoles |= applyProperty(qmlUnit, binding, rv->m_listModel, /*outter element index*/-1); + setRoles |= applyProperty(compilationUnit, qmlUnit, binding, rv->m_listModel, /*outter element index*/-1); } if (setRoles == false) @@ -2586,6 +2683,9 @@ bool QQmlListModelParser::definesEmptyList(const QString &s) strings (quoted and optionally within a call to QT_TR_NOOP), boolean values (true, false), numbers, or enumeration values (such as AlignText.AlignHCenter). + Beginning with Qt 5.11 ListElement also allows assigning a function declaration to + a role. This allows the definition of ListElements with callable actions. + \section1 Referencing Roles The role names are used by delegates to obtain data from list elements. diff --git a/src/qml/types/qqmllistmodel_p.h b/src/qml/types/qqmllistmodel_p.h index 1fda703797..499a113504 100644 --- a/src/qml/types/qqmllistmodel_p.h +++ b/src/qml/types/qqmllistmodel_p.h @@ -189,13 +189,13 @@ public: QQmlListModelParser() : QQmlCustomParser(QQmlCustomParser::AcceptsSignalHandlers) {} - void verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &bindings) Q_DECL_OVERRIDE; - void applyBindings(QObject *obj, QV4::CompiledData::CompilationUnit *compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) Q_DECL_OVERRIDE; + void verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override; + void applyBindings(QObject *obj, QV4::CompiledData::CompilationUnit *compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override; private: bool verifyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding); // returns true if a role was set - bool applyProperty(const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding, ListModel *model, int outterElementIndex); + bool applyProperty(QV4::CompiledData::CompilationUnit *compilationUnit, const QV4::CompiledData::Unit *qmlUnit, const QV4::CompiledData::Binding *binding, ListModel *model, int outterElementIndex); static bool definesEmptyList(const QString &); diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h index 271437e680..dea1ef2eb3 100644 --- a/src/qml/types/qqmllistmodel_p_p.h +++ b/src/qml/types/qqmllistmodel_p_p.h @@ -216,6 +216,7 @@ public: QObject, VariantMap, DateTime, + Function, MaxDataType }; @@ -283,6 +284,7 @@ private: int setVariantMapProperty(const ListLayout::Role &role, QV4::Object *o); int setVariantMapProperty(const ListLayout::Role &role, QVariantMap *m); int setDateTimeProperty(const ListLayout::Role &role, const QDateTime &dt); + int setFunctionProperty(const ListLayout::Role &role, const QJSValue &f); void setStringPropertyFast(const ListLayout::Role &role, const QString &s); void setDoublePropertyFast(const ListLayout::Role &role, double n); @@ -291,6 +293,7 @@ private: void setListPropertyFast(const ListLayout::Role &role, ListModel *m); void setVariantMapFast(const ListLayout::Role &role, QV4::Object *o); void setDateTimePropertyFast(const ListLayout::Role &role, const QDateTime &dt); + void setFunctionPropertyFast(const ListLayout::Role &role, const QJSValue &f); void clearProperty(const ListLayout::Role &role); @@ -301,6 +304,7 @@ private: QPointer<QObject> *getGuardProperty(const ListLayout::Role &role); QVariantMap *getVariantMapProperty(const ListLayout::Role &role); QDateTime *getDateTimeProperty(const ListLayout::Role &role); + QJSValue *getFunctionProperty(const ListLayout::Role &role); inline char *getPropertyMemory(const ListLayout::Role &role); @@ -400,6 +404,7 @@ private: friend class ListElement; friend class QQmlListModelWorkerAgent; + friend class QQmlListModelParser; }; QT_END_NAMESPACE diff --git a/src/qml/util/qqmlpropertymap.h b/src/qml/util/qqmlpropertymap.h index 8c5ecce48e..3930ac00a8 100644 --- a/src/qml/util/qqmlpropertymap.h +++ b/src/qml/util/qqmlpropertymap.h @@ -55,7 +55,7 @@ class Q_QML_EXPORT QQmlPropertyMap : public QObject { Q_OBJECT public: - explicit QQmlPropertyMap(QObject *parent = Q_NULLPTR); + explicit QQmlPropertyMap(QObject *parent = nullptr); virtual ~QQmlPropertyMap(); QVariant value(const QString &key) const; diff --git a/src/quick/accessible/qaccessiblequickitem_p.h b/src/quick/accessible/qaccessiblequickitem_p.h index 577a105627..5375d37bf0 100644 --- a/src/quick/accessible/qaccessiblequickitem_p.h +++ b/src/quick/accessible/qaccessiblequickitem_p.h @@ -66,73 +66,73 @@ class QAccessibleQuickItem : public QAccessibleObject, public QAccessibleActionI public: QAccessibleQuickItem(QQuickItem *item); - QWindow *window() const Q_DECL_OVERRIDE; + QWindow *window() const override; - QRect rect() const Q_DECL_OVERRIDE; + QRect rect() const override; QRect viewRect() const; bool clipsChildren() const; - QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE; + QAccessibleInterface *childAt(int x, int y) const override; - QAccessibleInterface *parent() const Q_DECL_OVERRIDE; - QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE; - int childCount() const Q_DECL_OVERRIDE; - int indexOfChild(const QAccessibleInterface *iface) const Q_DECL_OVERRIDE; + QAccessibleInterface *parent() const override; + QAccessibleInterface *child(int index) const override; + int childCount() const override; + int indexOfChild(const QAccessibleInterface *iface) const override; QList<QQuickItem *> childItems() const; - QAccessible::State state() const Q_DECL_OVERRIDE; - QAccessible::Role role() const Q_DECL_OVERRIDE; - QString text(QAccessible::Text) const Q_DECL_OVERRIDE; + QAccessible::State state() const override; + QAccessible::Role role() const override; + QString text(QAccessible::Text) const override; bool isAccessible() const; // Action Interface - QStringList actionNames() const Q_DECL_OVERRIDE; - void doAction(const QString &actionName) Q_DECL_OVERRIDE; - QStringList keyBindingsForAction(const QString &actionName) const Q_DECL_OVERRIDE; + QStringList actionNames() const override; + void doAction(const QString &actionName) override; + QStringList keyBindingsForAction(const QString &actionName) const override; // Value Interface - QVariant currentValue() const Q_DECL_OVERRIDE; - void setCurrentValue(const QVariant &value) Q_DECL_OVERRIDE; - QVariant maximumValue() const Q_DECL_OVERRIDE; - QVariant minimumValue() const Q_DECL_OVERRIDE; - QVariant minimumStepSize() const Q_DECL_OVERRIDE; + QVariant currentValue() const override; + void setCurrentValue(const QVariant &value) override; + QVariant maximumValue() const override; + QVariant minimumValue() const override; + QVariant minimumStepSize() const override; // Text Interface - void selection(int selectionIndex, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE; - int selectionCount() const Q_DECL_OVERRIDE; - void addSelection(int startOffset, int endOffset) Q_DECL_OVERRIDE; - void removeSelection(int selectionIndex) Q_DECL_OVERRIDE; - void setSelection(int selectionIndex, int startOffset, int endOffset) Q_DECL_OVERRIDE; + void selection(int selectionIndex, int *startOffset, int *endOffset) const override; + int selectionCount() const override; + void addSelection(int startOffset, int endOffset) override; + void removeSelection(int selectionIndex) override; + void setSelection(int selectionIndex, int startOffset, int endOffset) override; // cursor - int cursorPosition() const Q_DECL_OVERRIDE; - void setCursorPosition(int position) Q_DECL_OVERRIDE; + int cursorPosition() const override; + void setCursorPosition(int position) override; // text - QString text(int startOffset, int endOffset) const Q_DECL_OVERRIDE; + QString text(int startOffset, int endOffset) const override; QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, - int *startOffset, int *endOffset) const Q_DECL_OVERRIDE; + int *startOffset, int *endOffset) const override; QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, - int *startOffset, int *endOffset) const Q_DECL_OVERRIDE; + int *startOffset, int *endOffset) const override; QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, - int *startOffset, int *endOffset) const Q_DECL_OVERRIDE; - int characterCount() const Q_DECL_OVERRIDE; + int *startOffset, int *endOffset) const override; + int characterCount() const override; // character <-> geometry - QRect characterRect(int /* offset */) const Q_DECL_OVERRIDE { return QRect(); } - int offsetAtPoint(const QPoint & /* point */) const Q_DECL_OVERRIDE { return -1; } + QRect characterRect(int /* offset */) const override { return QRect(); } + int offsetAtPoint(const QPoint & /* point */) const override { return -1; } - void scrollToSubstring(int /* startIndex */, int /* endIndex */) Q_DECL_OVERRIDE {} - QString attributes(int /* offset */, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE + void scrollToSubstring(int /* startIndex */, int /* endIndex */) override {} + QString attributes(int /* offset */, int *startOffset, int *endOffset) const override { *startOffset = 0; *endOffset = 0; return QString(); } QTextDocument *textDocument() const; protected: QQuickItem *item() const { return static_cast<QQuickItem*>(object()); } - void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE; + void *interface_cast(QAccessible::InterfaceType t) override; private: QTextDocument *m_doc; diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 670dc6d032..b492842ad4 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -65,7 +65,7 @@ class QQuickCanvasTextureProvider : public QSGTextureProvider { public: QSGTexture *tex; - QSGTexture *texture() const Q_DECL_OVERRIDE { return tex; } + QSGTexture *texture() const override { return tex; } void fireTextureChanged() { emit textureChanged(); } }; diff --git a/src/quick/items/context2d/qquickcanvasitem_p.h b/src/quick/items/context2d/qquickcanvasitem_p.h index 217ae9bb69..59de847680 100644 --- a/src/quick/items/context2d/qquickcanvasitem_p.h +++ b/src/quick/items/context2d/qquickcanvasitem_p.h @@ -155,8 +155,8 @@ public: Q_INVOKABLE QString toDataURL(const QString& type = QLatin1String("image/png")) const; QQmlRefPointer<QQuickCanvasPixmap> loadedPixmap(const QUrl& url); - bool isTextureProvider() const Q_DECL_OVERRIDE; - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; + bool isTextureProvider() const override; + QSGTextureProvider *textureProvider() const override; Q_SIGNALS: void paint(const QRect ®ion); @@ -185,13 +185,13 @@ private Q_SLOTS: void schedulePolish(); protected: - void componentComplete() Q_DECL_OVERRIDE; - void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) Q_DECL_OVERRIDE; - void updatePolish() Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void releaseResources() Q_DECL_OVERRIDE; - bool event(QEvent *event) Q_DECL_OVERRIDE; + void componentComplete() override; + void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) override; + void updatePolish() override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + void releaseResources() override; + bool event(QEvent *event) override; private: Q_DECLARE_PRIVATE(QQuickCanvasItem) Q_INVOKABLE void delayedCreate(); diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 9ac7422a39..37e574a884 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -3960,7 +3960,7 @@ class QQuickContext2DTextureCleanup : public QRunnable { public: QQuickContext2DTexture *texture; - void run() Q_DECL_OVERRIDE { delete texture; } + void run() override { delete texture; } }; QMutex QQuickContext2D::mutex; diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp index b985cb0ccc..30895d9b0e 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp @@ -100,8 +100,8 @@ namespace { { } - void paint(QPainter *p) const Q_DECL_OVERRIDE { p->fillRect(m_rect, m_brush); } - QRectF boundingRect() const Q_DECL_OVERRIDE { return m_rect; } + void paint(QPainter *p) const override { p->fillRect(m_rect, m_brush); } + QRectF boundingRect() const override { return m_rect; } private: QRectF m_rect; @@ -117,8 +117,8 @@ namespace { { } - void paint(QPainter *p) const Q_DECL_OVERRIDE { p->fillPath(m_path, m_brush); } - QRectF boundingRect() const Q_DECL_OVERRIDE { return m_path.boundingRect(); } + void paint(QPainter *p) const override { p->fillPath(m_path, m_brush); } + QRectF boundingRect() const override { return m_path.boundingRect(); } private: QPainterPath m_path; @@ -134,9 +134,9 @@ namespace { { } - void paint(QPainter *p) const Q_DECL_OVERRIDE { p->strokePath(m_path, m_pen); } + void paint(QPainter *p) const override { p->strokePath(m_path, m_pen); } - QRectF boundingRect() const Q_DECL_OVERRIDE + QRectF boundingRect() const override { qreal d = qMax(qreal(1), m_pen.widthF()); return m_path.boundingRect().adjusted(-d, -d, d, d); @@ -156,9 +156,9 @@ namespace { { } - void paint(QPainter *p) const Q_DECL_OVERRIDE { p->drawImage(m_offset, m_image); } + void paint(QPainter *p) const override { p->drawImage(m_offset, m_image); } - QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(m_image.rect()).translated(m_offset); } + QRectF boundingRect() const override { return QRectF(m_image.rect()).translated(m_offset); } private: QImage m_image; diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h index 81896dcdc1..0e1fbd5d34 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture_p.h +++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h @@ -189,21 +189,21 @@ class QQuickContext2DFBOTexture : public QQuickContext2DTexture public: QQuickContext2DFBOTexture(); ~QQuickContext2DFBOTexture(); - QQuickContext2DTile* createTile() const Q_DECL_OVERRIDE; - QPaintDevice* beginPainting() Q_DECL_OVERRIDE; - void endPainting() Q_DECL_OVERRIDE; + QQuickContext2DTile* createTile() const override; + QPaintDevice* beginPainting() override; + void endPainting() override; QRectF normalizedTextureSubRect() const; - QQuickCanvasItem::RenderTarget renderTarget() const Q_DECL_OVERRIDE; - void compositeTile(QQuickContext2DTile* tile) Q_DECL_OVERRIDE; - QSize adjustedTileSize(const QSize &ts) Q_DECL_OVERRIDE; + QQuickCanvasItem::RenderTarget renderTarget() const override; + void compositeTile(QQuickContext2DTile* tile) override; + QSize adjustedTileSize(const QSize &ts) override; - QSGTexture *textureForNextFrame(QSGTexture *, QQuickWindow *window) Q_DECL_OVERRIDE; + QSGTexture *textureForNextFrame(QSGTexture *, QQuickWindow *window) override; protected: - QVector2D scaleFactor() const Q_DECL_OVERRIDE; + QVector2D scaleFactor() const override; public Q_SLOTS: - void grabImage(const QRectF& region = QRectF()) Q_DECL_OVERRIDE; + void grabImage(const QRectF& region = QRectF()) override; private: bool doMultisampling() const; diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h index d5255edcfc..c3d4dfef64 100644 --- a/src/quick/items/context2d/qquickcontext2dtile_p.h +++ b/src/quick/items/context2d/qquickcontext2dtile_p.h @@ -93,7 +93,7 @@ class QQuickContext2DFBOTile : public QQuickContext2DTile public: QQuickContext2DFBOTile(); ~QQuickContext2DFBOTile(); - virtual void setRect(const QRect& r) override; + void setRect(const QRect& r) override; QOpenGLFramebufferObject* fbo() const {return m_fbo;} void drawFinished() override; diff --git a/src/quick/items/qquickanchors.cpp b/src/quick/items/qquickanchors.cpp index c0bec7d716..45b405bd82 100644 --- a/src/quick/items/qquickanchors.cpp +++ b/src/quick/items/qquickanchors.cpp @@ -832,7 +832,7 @@ void QQuickAnchors::resetTop() Q_D(QQuickAnchors); d->usedAnchors &= ~TopAnchor; d->remDepend(d->topAnchorItem); - d->topAnchorItem = Q_NULLPTR; + d->topAnchorItem = nullptr; d->topAnchorLine = QQuickAnchors::InvalidAnchor; emit topChanged(); d->updateVerticalAnchors(); @@ -872,7 +872,7 @@ void QQuickAnchors::resetBottom() Q_D(QQuickAnchors); d->usedAnchors &= ~BottomAnchor; d->remDepend(d->bottomAnchorItem); - d->bottomAnchorItem = Q_NULLPTR; + d->bottomAnchorItem = nullptr; d->bottomAnchorLine = QQuickAnchors::InvalidAnchor; emit bottomChanged(); d->updateVerticalAnchors(); @@ -912,7 +912,7 @@ void QQuickAnchors::resetVerticalCenter() Q_D(QQuickAnchors); d->usedAnchors &= ~VCenterAnchor; d->remDepend(d->vCenterAnchorItem); - d->vCenterAnchorItem = Q_NULLPTR; + d->vCenterAnchorItem = nullptr; d->vCenterAnchorLine = QQuickAnchors::InvalidAnchor; emit verticalCenterChanged(); d->updateVerticalAnchors(); @@ -952,7 +952,7 @@ void QQuickAnchors::resetBaseline() Q_D(QQuickAnchors); d->usedAnchors &= ~BaselineAnchor; d->remDepend(d->baselineAnchorItem); - d->baselineAnchorItem = Q_NULLPTR; + d->baselineAnchorItem = nullptr; d->baselineAnchorLine = QQuickAnchors::InvalidAnchor; emit baselineChanged(); d->updateVerticalAnchors(); @@ -992,7 +992,7 @@ void QQuickAnchors::resetLeft() Q_D(QQuickAnchors); d->usedAnchors &= ~LeftAnchor; d->remDepend(d->leftAnchorItem); - d->leftAnchorItem = Q_NULLPTR; + d->leftAnchorItem = nullptr; d->leftAnchorLine = QQuickAnchors::InvalidAnchor; emit leftChanged(); d->updateHorizontalAnchors(); @@ -1032,7 +1032,7 @@ void QQuickAnchors::resetRight() Q_D(QQuickAnchors); d->usedAnchors &= ~RightAnchor; d->remDepend(d->rightAnchorItem); - d->rightAnchorItem = Q_NULLPTR; + d->rightAnchorItem = nullptr; d->rightAnchorLine = QQuickAnchors::InvalidAnchor; emit rightChanged(); d->updateHorizontalAnchors(); @@ -1072,7 +1072,7 @@ void QQuickAnchors::resetHorizontalCenter() Q_D(QQuickAnchors); d->usedAnchors &= ~HCenterAnchor; d->remDepend(d->hCenterAnchorItem); - d->hCenterAnchorItem = Q_NULLPTR; + d->hCenterAnchorItem = nullptr; d->hCenterAnchorLine = QQuickAnchors::InvalidAnchor; emit horizontalCenterChanged(); d->updateHorizontalAnchors(); diff --git a/src/quick/items/qquickanchors_p_p.h b/src/quick/items/qquickanchors_p_p.h index 906f607302..ae6ca02786 100644 --- a/src/quick/items/qquickanchors_p_p.h +++ b/src/quick/items/qquickanchors_p_p.h @@ -90,15 +90,15 @@ public: , hCenterOffset(0) , baselineOffset(0) , item(i) - , fill(Q_NULLPTR) - , centerIn(Q_NULLPTR) - , leftAnchorItem(Q_NULLPTR) - , rightAnchorItem(Q_NULLPTR) - , topAnchorItem(Q_NULLPTR) - , bottomAnchorItem(Q_NULLPTR) - , vCenterAnchorItem(Q_NULLPTR) - , hCenterAnchorItem(Q_NULLPTR) - , baselineAnchorItem(Q_NULLPTR) + , fill(nullptr) + , centerIn(nullptr) + , leftAnchorItem(nullptr) + , rightAnchorItem(nullptr) + , topAnchorItem(nullptr) + , bottomAnchorItem(nullptr) + , vCenterAnchorItem(nullptr) + , hCenterAnchorItem(nullptr) + , baselineAnchorItem(nullptr) , leftAnchorLine(QQuickAnchors::InvalidAnchor) , leftMarginExplicit(false) , rightAnchorLine(QQuickAnchors::InvalidAnchor) @@ -141,8 +141,8 @@ public: void updateMe(); // QQuickItemGeometryListener interface - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) Q_DECL_OVERRIDE; - QQuickAnchorsPrivate *anchorPrivate() Q_DECL_OVERRIDE { return this; } + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override; + QQuickAnchorsPrivate *anchorPrivate() override { return this; } bool checkHValid() const; bool checkVValid() const; diff --git a/src/quick/items/qquickanimatedimage_p.h b/src/quick/items/qquickanimatedimage_p.h index 94e44f27cd..f7a6bd808b 100644 --- a/src/quick/items/qquickanimatedimage_p.h +++ b/src/quick/items/qquickanimatedimage_p.h @@ -90,7 +90,7 @@ public: int frameCount() const; // Extends QQuickImage's src property - void setSource(const QUrl&) Q_DECL_OVERRIDE; + void setSource(const QUrl&) override; virtual QSize sourceSize(); Q_SIGNALS: @@ -106,8 +106,8 @@ private Q_SLOTS: void onCacheChanged(); protected: - void load() Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; + void load() override; + void componentComplete() override; private: Q_DISABLE_COPY(QQuickAnimatedImage) diff --git a/src/quick/items/qquickanimatedsprite_p.h b/src/quick/items/qquickanimatedsprite_p.h index 850461a011..276e6fbb92 100644 --- a/src/quick/items/qquickanimatedsprite_p.h +++ b/src/quick/items/qquickanimatedsprite_p.h @@ -169,8 +169,8 @@ protected Q_SLOTS: void reset(); protected: - void componentComplete() Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + void componentComplete() override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: void maybeUpdate(); bool isCurrentFrameChangedConnected(); diff --git a/src/quick/items/qquickborderimage_p.h b/src/quick/items/qquickborderimage_p.h index 844f71e2c9..f43e6c8e1e 100644 --- a/src/quick/items/qquickborderimage_p.h +++ b/src/quick/items/qquickborderimage_p.h @@ -83,7 +83,7 @@ public: TileMode verticalTileMode() const; void setVerticalTileMode(TileMode); - void setSource(const QUrl &url) Q_DECL_OVERRIDE; + void setSource(const QUrl &url) override; Q_SIGNALS: void horizontalTileModeChanged(); @@ -91,16 +91,16 @@ Q_SIGNALS: void sourceSizeChanged(); protected: - void load() Q_DECL_OVERRIDE; - void pixmapChange() Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + void load() override; + void pixmapChange() override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: void setGridScaledImage(const QQuickGridScaledImage& sci); private Q_SLOTS: void doUpdate(); - void requestFinished() Q_DECL_OVERRIDE; + void requestFinished() override; #if QT_CONFIG(qml_network) void sciRequestFinished(); #endif diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index 7c936ff21c..6dc005a03c 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -82,8 +82,8 @@ public: { } - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) Q_DECL_OVERRIDE; - void itemParentChanged(QQuickItem *, QQuickItem *parent) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override; + void itemParentChanged(QQuickItem *, QQuickItem *parent) override; void updatePosition(); void restartDrag(); void deliverEnterEvent(); diff --git a/src/quick/items/qquickdroparea_p.h b/src/quick/items/qquickdroparea_p.h index 0c4c072db7..d25cd4decc 100644 --- a/src/quick/items/qquickdroparea_p.h +++ b/src/quick/items/qquickdroparea_p.h @@ -175,10 +175,10 @@ Q_SIGNALS: void dropped(QQuickDropEvent *drop); protected: - void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; - void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; - void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE; - void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; + void dropEvent(QDropEvent *event) override; private: Q_DISABLE_COPY(QQuickDropArea) diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index ee5f177855..cd918cef5f 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -213,7 +213,7 @@ public: } protected: - void finished() Q_DECL_OVERRIDE { + void finished() override { if (!flickable) return; axisData->move.setValue(axisData->transitionTo); diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h index 7558ee7df8..4ad01323a4 100644 --- a/src/quick/items/qquickflickable_p.h +++ b/src/quick/items/qquickflickable_p.h @@ -263,14 +263,14 @@ Q_SIGNALS: Q_REVISION(9) void verticalOvershootChanged(); protected: - bool childMouseEventFilter(QQuickItem *, QEvent *) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + bool childMouseEventFilter(QQuickItem *, QEvent *) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; #if QT_CONFIG(wheelevent) - void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *event) override; #endif - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *event) override; QQuickFlickableVisibleArea *visibleArea(); @@ -288,11 +288,11 @@ protected: virtual qreal maxYExtent() const; qreal vWidth() const; qreal vHeight() const; - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; virtual void viewportMoved(Qt::Orientations orient); void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void mouseUngrabEvent() Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; + void mouseUngrabEvent() override; bool filterMouseEvent(QQuickItem *receiver, QMouseEvent *event); bool xflick() const; diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h index 8609a15fcd..54cc67875a 100644 --- a/src/quick/items/qquickflickable_p_p.h +++ b/src/quick/items/qquickflickable_p_p.h @@ -87,7 +87,7 @@ public: { Velocity(QQuickFlickablePrivate *p) : parent(p) {} - void setValue(qreal v) Q_DECL_OVERRIDE { + void setValue(qreal v) override { if (v != value()) { QQuickTimeLineValue::setValue(v); parent->updateVelocity(); @@ -195,7 +195,7 @@ public: qreal overShootDistance(qreal size) const; - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override; void draggingStarting(); void draggingEnding(); diff --git a/src/quick/items/qquickflipable.cpp b/src/quick/items/qquickflipable.cpp index a960cd8b80..4273ed4881 100644 --- a/src/quick/items/qquickflipable.cpp +++ b/src/quick/items/qquickflipable.cpp @@ -57,7 +57,7 @@ public: transform = t; update(); } - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE { + void applyTo(QMatrix4x4 *matrix) const override { *matrix *= transform; } private: @@ -70,7 +70,7 @@ class QQuickFlipablePrivate : public QQuickItemPrivate public: QQuickFlipablePrivate() : current(QQuickFlipable::Front), front(0), back(0), sideDirty(false) {} - void transformChanged() Q_DECL_OVERRIDE; + void transformChanged() override; void updateSide(); void setBackTransform(); diff --git a/src/quick/items/qquickflipable_p.h b/src/quick/items/qquickflipable_p.h index a76977d4ac..ec922725ef 100644 --- a/src/quick/items/qquickflipable_p.h +++ b/src/quick/items/qquickflipable_p.h @@ -93,7 +93,7 @@ Q_SIGNALS: void sideChanged(); protected: - void updatePolish() Q_DECL_OVERRIDE; + void updatePolish() override; private Q_SLOTS: void retransformBack(); diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp index 042ee21aec..5a40d6b705 100644 --- a/src/quick/items/qquickframebufferobject.cpp +++ b/src/quick/items/qquickframebufferobject.cpp @@ -219,7 +219,7 @@ public: window->update(); } - QSGTexture *texture() const Q_DECL_OVERRIDE + QSGTexture *texture() const override { return QSGSimpleTextureNode::texture(); } diff --git a/src/quick/items/qquickframebufferobject.h b/src/quick/items/qquickframebufferobject.h index 13eeb931ad..d66ca40b3a 100644 --- a/src/quick/items/qquickframebufferobject.h +++ b/src/quick/items/qquickframebufferobject.h @@ -75,7 +75,7 @@ public: void *data; }; - QQuickFramebufferObject(QQuickItem *parent = Q_NULLPTR); + QQuickFramebufferObject(QQuickItem *parent = nullptr); bool textureFollowsItemSize() const; void setTextureFollowsItemSize(bool follows); @@ -85,15 +85,15 @@ public: virtual Renderer *createRenderer() const = 0; - bool isTextureProvider() const Q_DECL_OVERRIDE; - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; - void releaseResources() Q_DECL_OVERRIDE; + bool isTextureProvider() const override; + QSGTextureProvider *textureProvider() const override; + void releaseResources() override; protected: - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; protected: - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; Q_SIGNALS: void textureFollowsItemSizeChanged(bool); diff --git a/src/quick/items/qquickimage_p.h b/src/quick/items/qquickimage_p.h index a5331266c9..09b2c1eeb7 100644 --- a/src/quick/items/qquickimage_p.h +++ b/src/quick/items/qquickimage_p.h @@ -91,7 +91,7 @@ public: qreal paintedWidth() const; qreal paintedHeight() const; - QRectF boundingRect() const Q_DECL_OVERRIDE; + QRectF boundingRect() const override; HAlignment horizontalAlignment() const; void setHorizontalAlignment(HAlignment align); @@ -99,13 +99,13 @@ public: VAlignment verticalAlignment() const; void setVerticalAlignment(VAlignment align); - bool isTextureProvider() const Q_DECL_OVERRIDE { return true; } - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; + bool isTextureProvider() const override { return true; } + QSGTextureProvider *textureProvider() const override; bool mipmap() const; void setMipmap(bool use); - virtual void emitAutoTransformBaseChanged() Q_DECL_OVERRIDE { emit autoTransformChanged(); } + void emitAutoTransformBaseChanged() override { emit autoTransformChanged(); } Q_SIGNALS: void fillModeChanged(); @@ -120,12 +120,12 @@ private Q_SLOTS: protected: QQuickImage(QQuickImagePrivate &dd, QQuickItem *parent); - void pixmapChange() Q_DECL_OVERRIDE; + void pixmapChange() override; void updatePaintedGeometry(); - void releaseResources() Q_DECL_OVERRIDE; + void releaseResources() override; - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: Q_DISABLE_COPY(QQuickImage) diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h index 54b1f789c9..4d4a6fceaf 100644 --- a/src/quick/items/qquickimagebase_p.h +++ b/src/quick/items/qquickimagebase_p.h @@ -115,9 +115,9 @@ Q_SIGNALS: protected: virtual void load(); - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; virtual void pixmapChange(); - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; + void itemChange(ItemChange change, const ItemChangeData &value) override; QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent); private Q_SLOTS: diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index ccc4e90abf..6579175cc6 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2489,13 +2489,13 @@ QQuickItem *QQuickItemPrivate::nextTabChildItem(const QQuickItem *item, int star { if (!item) { qWarning() << "QQuickItemPrivate::nextTabChildItem called with null item."; - return Q_NULLPTR; + return nullptr; } const QList<QQuickItem *> &children = item->childItems(); const int count = children.count(); if (start < 0 || start >= count) { qWarning() << "QQuickItemPrivate::nextTabChildItem: Start index value out of range for item" << item; - return Q_NULLPTR; + return nullptr; } while (start < count) { QQuickItem *child = children.at(start); @@ -2503,14 +2503,14 @@ QQuickItem *QQuickItemPrivate::nextTabChildItem(const QQuickItem *item, int star return child; ++start; } - return Q_NULLPTR; + return nullptr; } QQuickItem *QQuickItemPrivate::prevTabChildItem(const QQuickItem *item, int start) { if (!item) { qWarning() << "QQuickItemPrivate::prevTabChildItem called with null item."; - return Q_NULLPTR; + return nullptr; } const QList<QQuickItem *> &children = item->childItems(); const int count = children.count(); @@ -2518,7 +2518,7 @@ QQuickItem *QQuickItemPrivate::prevTabChildItem(const QQuickItem *item, int star start = count - 1; if (start < 0 || start >= count) { qWarning() << "QQuickItemPrivate::prevTabChildItem: Start index value out of range for item" << item; - return Q_NULLPTR; + return nullptr; } while (start >= 0) { QQuickItem *child = children.at(start); @@ -2526,7 +2526,7 @@ QQuickItem *QQuickItemPrivate::prevTabChildItem(const QQuickItem *item, int star return child; --start; } - return Q_NULLPTR; + return nullptr; } QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, bool forward) @@ -2566,8 +2566,8 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo QQuickItem *last = current; bool hasChildren = !current->childItems().isEmpty() && current->isEnabled() && current->isVisible(); - QQuickItem *firstChild = Q_NULLPTR; - QQuickItem *lastChild = Q_NULLPTR; + QQuickItem *firstChild = nullptr; + QQuickItem *lastChild = nullptr; if (hasChildren) { firstChild = nextTabChildItem(current, 0); if (!firstChild) @@ -2599,11 +2599,11 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo if (!current->childItems().isEmpty()) skip = true; // back to the parent - } else if (QQuickItem *parent = !isTabFence ? current->parentItem() : Q_NULLPTR) { + } else if (QQuickItem *parent = !isTabFence ? current->parentItem() : nullptr) { // we would evaluate the parent twice, thus we skip if (forward) { skip = true; - } else if (QQuickItem *firstSibling = !forward ? nextTabChildItem(parent, 0) : Q_NULLPTR) { + } else if (QQuickItem *firstSibling = !forward ? nextTabChildItem(parent, 0) : nullptr) { if (last != firstSibling || (parent->isFocusScope() && parent->activeFocusOnTab() && parent->hasActiveFocus())) skip = true; diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index 25641f16f9..f6ee54e94d 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -59,7 +59,7 @@ class Q_QUICK_EXPORT QQuickTransform : public QObject { Q_OBJECT public: - explicit QQuickTransform(QObject *parent = Q_NULLPTR); + explicit QQuickTransform(QObject *parent = nullptr); ~QQuickTransform(); void appendToItem(QQuickItem *); @@ -196,7 +196,7 @@ public: }; Q_ENUM(TransformOrigin) - explicit QQuickItem(QQuickItem *parent = Q_NULLPTR); + explicit QQuickItem(QQuickItem *parent = nullptr); virtual ~QQuickItem(); QQuickWindow *window() const; @@ -392,7 +392,7 @@ Q_SIGNALS: void implicitHeightChanged(); protected: - bool event(QEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *) override; bool isComponentComplete() const; virtual void itemChange(ItemChange, const ItemChangeData &); @@ -405,8 +405,8 @@ protected: bool heightValid() const; // ### better name? void setImplicitSize(qreal, qreal); - void classBegin() Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; + void classBegin() override; + void componentComplete() override; virtual void keyPressEvent(QKeyEvent *event); virtual void keyReleaseEvent(QKeyEvent *event); @@ -445,7 +445,7 @@ protected: virtual void updatePolish(); protected: - QQuickItem(QQuickItemPrivate &dd, QQuickItem *parent = Q_NULLPTR); + QQuickItem(QQuickItemPrivate &dd, QQuickItem *parent = nullptr); private: Q_PRIVATE_SLOT(d_func(), void _q_resourceObjectDeleted(QObject *)) diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index 2f0c316602..9ed5286f22 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -101,10 +101,10 @@ public: void complete(); protected: - void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) Q_DECL_OVERRIDE; - void itemDestroyed(QQuickItem *item) Q_DECL_OVERRIDE; - void itemChildAdded(QQuickItem *, QQuickItem *) Q_DECL_OVERRIDE; - void itemChildRemoved(QQuickItem *, QQuickItem *) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override; + void itemDestroyed(QQuickItem *item) override; + void itemChildAdded(QQuickItem *, QQuickItem *) override; + void itemChildRemoved(QQuickItem *, QQuickItem *) override; //void itemVisibilityChanged(QQuickItem *item) private: @@ -194,11 +194,11 @@ public: QQuickShaderEffectSource *effectSource() const { return m_effectSource; } - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) Q_DECL_OVERRIDE; - void itemOpacityChanged(QQuickItem *) Q_DECL_OVERRIDE; - void itemParentChanged(QQuickItem *, QQuickItem *) Q_DECL_OVERRIDE; - void itemSiblingOrderChanged(QQuickItem *) Q_DECL_OVERRIDE; - void itemVisibilityChanged(QQuickItem *) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override; + void itemOpacityChanged(QQuickItem *) override; + void itemParentChanged(QQuickItem *, QQuickItem *) override; + void itemSiblingOrderChanged(QQuickItem *) override; + void itemVisibilityChanged(QQuickItem *) override; void updateMatrix(); void updateGeometry(); @@ -714,8 +714,8 @@ Q_SIGNALS: void priorityChanged(); private: - void keyPressed(QKeyEvent *event, bool post) Q_DECL_OVERRIDE; - void keyReleased(QKeyEvent *event, bool post) Q_DECL_OVERRIDE; + void keyPressed(QKeyEvent *event, bool post) override; + void keyReleased(QKeyEvent *event, bool post) override; void setFocusNavigation(QQuickItem *currentItem, const char *dir, Qt::FocusReason reason = Qt::OtherFocusReason); }; @@ -751,7 +751,7 @@ class QQuickEnterKeyAttached : public QObject Q_PROPERTY(Qt::EnterKeyType type READ type WRITE setType NOTIFY typeChanged) public: - explicit QQuickEnterKeyAttached(QObject *parent = Q_NULLPTR); + explicit QQuickEnterKeyAttached(QObject *parent = nullptr); Qt::EnterKeyType type() const; void setType(Qt::EnterKeyType type); @@ -819,7 +819,7 @@ public: return QQmlListProperty<QQuickItem>(this, d->targets); } - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; static QQuickKeysAttached *qmlAttachedProperties(QObject *); @@ -871,11 +871,11 @@ Q_SIGNALS: void volumeDownPressed(QQuickKeyEvent *event); private: - void keyPressed(QKeyEvent *event, bool post) Q_DECL_OVERRIDE; - void keyReleased(QKeyEvent *event, bool post) Q_DECL_OVERRIDE; + void keyPressed(QKeyEvent *event, bool post) override; + void keyReleased(QKeyEvent *event, bool post) override; #if QT_CONFIG(im) - void inputMethodEvent(QInputMethodEvent *, bool post) Q_DECL_OVERRIDE; - QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; + void inputMethodEvent(QInputMethodEvent *, bool post) override; + QVariant inputMethodQuery(Qt::InputMethodQuery query) const override; #endif void shortcutOverride(QKeyEvent *event) override; static QByteArray keyToSignal(int key); diff --git a/src/quick/items/qquickitemanimation.cpp b/src/quick/items/qquickitemanimation.cpp index d4d346def9..4b5c81b4d4 100644 --- a/src/quick/items/qquickitemanimation.cpp +++ b/src/quick/items/qquickitemanimation.cpp @@ -211,7 +211,7 @@ struct QQuickParentAnimationData : public QAbstractAnimationAction //### reverse should probably apply on a per-action basis bool reverse; QList<QQuickParentChange *> pc; - void doAction() Q_DECL_OVERRIDE + void doAction() override { for (int ii = 0; ii < actions.count(); ++ii) { const QQuickStateAction &action = actions.at(ii); diff --git a/src/quick/items/qquickitemanimation_p.h b/src/quick/items/qquickitemanimation_p.h index a503cff223..3b3fad9cc4 100644 --- a/src/quick/items/qquickitemanimation_p.h +++ b/src/quick/items/qquickitemanimation_p.h @@ -89,7 +89,7 @@ protected: QAbstractAnimationJob* transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, - QObject *defaultTarget = 0) Q_DECL_OVERRIDE; + QObject *defaultTarget = 0) override; }; class QQuickAnchorAnimationPrivate; @@ -121,7 +121,7 @@ protected: QAbstractAnimationJob* transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, - QObject *defaultTarget = 0) Q_DECL_OVERRIDE; + QObject *defaultTarget = 0) override; }; #if QT_CONFIG(quick_path) @@ -188,7 +188,7 @@ protected: QAbstractAnimationJob* transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, - QObject *defaultTarget = 0) Q_DECL_OVERRIDE; + QObject *defaultTarget = 0) override; Q_SIGNALS: void durationChanged(int); void easingChanged(const QEasingCurve &); diff --git a/src/quick/items/qquickitemgrabresult.h b/src/quick/items/qquickitemgrabresult.h index 30f8f0c2ef..3dc10e2d75 100644 --- a/src/quick/items/qquickitemgrabresult.h +++ b/src/quick/items/qquickitemgrabresult.h @@ -82,7 +82,7 @@ private Q_SLOTS: private: friend class QQuickItem; - QQuickItemGrabResult(QObject *parent = Q_NULLPTR); + QQuickItemGrabResult(QObject *parent = nullptr); }; QT_END_NAMESPACE diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 1406e5b547..3c87496c83 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -156,6 +156,9 @@ 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); + #if !QT_CONFIG(quick_animatedimage) qmlRegisterTypeNotAvailable(uri,major,minor,"AnimatedImage", QCoreApplication::translate("QQuickAnimatedImage","Qt was built without support for QMovie")); #else diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index 2c04022cde..374b8388ba 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -201,7 +201,7 @@ public: void regenerate(bool orientationChanged=false); void layout(); - virtual void animationFinished(QAbstractAnimationJob *) override; + void animationFinished(QAbstractAnimationJob *) override; void refill(); void refill(qreal from, qreal to); void mirrorChange() override; diff --git a/src/quick/items/qquickloader_p.h b/src/quick/items/qquickloader_p.h index db171dcd1e..27e5d1ec8b 100644 --- a/src/quick/items/qquickloader_p.h +++ b/src/quick/items/qquickloader_p.h @@ -105,8 +105,8 @@ Q_SIGNALS: void asynchronousChanged(); protected: - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + void componentComplete() override; private: void setSource(const QUrl &sourceUrl, bool needsClear); diff --git a/src/quick/items/qquickloader_p_p.h b/src/quick/items/qquickloader_p_p.h index 9b6267e011..7492527401 100644 --- a/src/quick/items/qquickloader_p_p.h +++ b/src/quick/items/qquickloader_p_p.h @@ -68,8 +68,8 @@ public: QQuickLoaderIncubator(QQuickLoaderPrivate *l, IncubationMode mode) : QQmlIncubator(mode), loader(l) {} protected: - void statusChanged(Status) Q_DECL_OVERRIDE; - void setInitialState(QObject *) Q_DECL_OVERRIDE; + void statusChanged(Status) override; + void setInitialState(QObject *) override; private: QQuickLoaderPrivate *loader; @@ -84,9 +84,9 @@ public: QQuickLoaderPrivate(); ~QQuickLoaderPrivate(); - void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void itemImplicitWidthChanged(QQuickItem *) Q_DECL_OVERRIDE; - void itemImplicitHeightChanged(QQuickItem *) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) override; + void itemImplicitWidthChanged(QQuickItem *) override; + void itemImplicitHeightChanged(QQuickItem *) override; void clear(); void initResize(); void load(); @@ -97,8 +97,8 @@ public: static QUrl resolveSourceUrl(QQmlV4Function *args); QV4::ReturnedValue extractInitialPropertyValues(QQmlV4Function *args, QObject *loader, bool *error); - qreal getImplicitWidth() const Q_DECL_OVERRIDE; - qreal getImplicitHeight() const Q_DECL_OVERRIDE; + qreal getImplicitWidth() const override; + qreal getImplicitHeight() const override; QUrl source; QQuickItem *item; diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h index ee166a2082..ae6c56726e 100644 --- a/src/quick/items/qquickmousearea_p.h +++ b/src/quick/items/qquickmousearea_p.h @@ -164,25 +164,25 @@ protected: bool setPressed(Qt::MouseButton button, bool p, Qt::MouseEventSource source); bool sendMouseEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseUngrabEvent() Q_DECL_OVERRIDE; - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseUngrabEvent() override; + void hoverEnterEvent(QHoverEvent *event) override; + void hoverMoveEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; #if QT_CONFIG(wheelevent) - void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *event) override; #endif - bool childMouseEventFilter(QQuickItem *i, QEvent *e) Q_DECL_OVERRIDE; - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; - void windowDeactivateEvent() Q_DECL_OVERRIDE; + bool childMouseEventFilter(QQuickItem *i, QEvent *e) override; + void timerEvent(QTimerEvent *event) override; + void windowDeactivateEvent() override; void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData& value) Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; + void itemChange(ItemChange change, const ItemChangeData& value) override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: void handlePress(); diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp index 54136b1bbf..bdf30469ce 100644 --- a/src/quick/items/qquickmultipointtoucharea.cpp +++ b/src/quick/items/qquickmultipointtoucharea.cpp @@ -491,7 +491,7 @@ void QQuickMultiPointTouchArea::setMouseEnabled(bool arg) if (_mouseEnabled != arg) { _mouseEnabled = arg; if (_mouseTouchPoint && !arg) - _mouseTouchPoint = Q_NULLPTR; + _mouseTouchPoint = nullptr; emit mouseEnabledChanged(); } } @@ -835,7 +835,7 @@ void QQuickMultiPointTouchArea::mouseReleaseEvent(QMouseEvent *event) updateTouchData(event); _mouseTouchPoint->setInUse(false); _releasedTouchPoints.removeAll(_mouseTouchPoint); - _mouseTouchPoint = Q_NULLPTR; + _mouseTouchPoint = nullptr; } QQuickWindow *c = window(); diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h index 25e1056712..64fe81563d 100644 --- a/src/quick/items/qquickmultipointtoucharea_p.h +++ b/src/quick/items/qquickmultipointtoucharea_p.h @@ -265,13 +265,13 @@ Q_SIGNALS: void mouseEnabledChanged(); protected: - void touchEvent(QTouchEvent *) Q_DECL_OVERRIDE; - bool childMouseEventFilter(QQuickItem *receiver, QEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseUngrabEvent() Q_DECL_OVERRIDE; - void touchUngrabEvent() Q_DECL_OVERRIDE; + void touchEvent(QTouchEvent *) override; + bool childMouseEventFilter(QQuickItem *receiver, QEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseUngrabEvent() override; + void touchUngrabEvent() override; void addTouchPrototype(QQuickTouchPoint* prototype); void addTouchPoint(const QTouchEvent::TouchPoint *p); @@ -285,10 +285,10 @@ protected: bool sendMouseEvent(QMouseEvent *event); bool shouldFilter(QEvent *event); void grabGesture(); - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; #ifdef Q_OS_OSX - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + void hoverEnterEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; void setTouchEventsEnabled(bool enable); #endif diff --git a/src/quick/items/qquickopenglshadereffectnode.cpp b/src/quick/items/qquickopenglshadereffectnode.cpp index 5dbfee73cb..a6431135eb 100644 --- a/src/quick/items/qquickopenglshadereffectnode.cpp +++ b/src/quick/items/qquickopenglshadereffectnode.cpp @@ -67,16 +67,16 @@ class QQuickCustomMaterialShader : public QSGMaterialShader { public: QQuickCustomMaterialShader(const QQuickOpenGLShaderEffectMaterialKey &key, const QVector<QByteArray> &attributes); - void deactivate() Q_DECL_OVERRIDE; - void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) Q_DECL_OVERRIDE; - char const *const *attributeNames() const Q_DECL_OVERRIDE; + void deactivate() override; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + char const *const *attributeNames() const override; protected: friend class QQuickOpenGLShaderEffectNode; - void compile() Q_DECL_OVERRIDE; - const char *vertexShader() const Q_DECL_OVERRIDE; - const char *fragmentShader() const Q_DECL_OVERRIDE; + void compile() override; + const char *vertexShader() const override; + const char *fragmentShader() const override; const QQuickOpenGLShaderEffectMaterialKey m_key; QVector<QByteArray> m_attributes; diff --git a/src/quick/items/qquickopenglshadereffectnode_p.h b/src/quick/items/qquickopenglshadereffectnode_p.h index 784294d9eb..68eece7660 100644 --- a/src/quick/items/qquickopenglshadereffectnode_p.h +++ b/src/quick/items/qquickopenglshadereffectnode_p.h @@ -110,9 +110,9 @@ public: }; explicit QQuickOpenGLShaderEffectMaterial(QQuickOpenGLShaderEffectNode *node = 0); - QSGMaterialType *type() const Q_DECL_OVERRIDE; - QSGMaterialShader *createShader() const Q_DECL_OVERRIDE; - int compare(const QSGMaterial *other) const Q_DECL_OVERRIDE; + QSGMaterialType *type() const override; + QSGMaterialShader *createShader() const override; + int compare(const QSGMaterial *other) const override; QVector<QByteArray> attributes; QVector<UniformData> uniforms[QQuickOpenGLShaderEffectMaterialKey::ShaderTypeCount]; @@ -151,7 +151,7 @@ public: QQuickOpenGLShaderEffectNode(); virtual ~QQuickOpenGLShaderEffectNode(); - void preprocess() Q_DECL_OVERRIDE; + void preprocess() override; Q_SIGNALS: void logAndStatusChanged(const QString &, int status); diff --git a/src/quick/items/qquickpainteditem.h b/src/quick/items/qquickpainteditem.h index e8b471ac01..66a0ea83c9 100644 --- a/src/quick/items/qquickpainteditem.h +++ b/src/quick/items/qquickpainteditem.h @@ -57,7 +57,7 @@ class Q_QUICK_EXPORT QQuickPaintedItem : public QQuickItem Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged) public: - explicit QQuickPaintedItem(QQuickItem *parent = Q_NULLPTR); + explicit QQuickPaintedItem(QQuickItem *parent = nullptr); virtual ~QQuickPaintedItem(); enum RenderTarget { @@ -107,8 +107,8 @@ public: virtual void paint(QPainter *painter) = 0; - bool isTextureProvider() const Q_DECL_OVERRIDE; - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; + bool isTextureProvider() const override; + QSGTextureProvider *textureProvider() const override; Q_SIGNALS: void fillColorChanged(); @@ -118,10 +118,10 @@ Q_SIGNALS: void textureSizeChanged(); protected: - QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *parent = Q_NULLPTR); - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; - void releaseResources() Q_DECL_OVERRIDE; - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; + QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *parent = nullptr); + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; + void releaseResources() override; + void itemChange(ItemChange, const ItemChangeData &) override; private Q_SLOTS: void invalidateSceneGraph(); diff --git a/src/quick/items/qquickpincharea_p.h b/src/quick/items/qquickpincharea_p.h index fc96594a4b..2363f1e2d4 100644 --- a/src/quick/items/qquickpincharea_p.h +++ b/src/quick/items/qquickpincharea_p.h @@ -286,13 +286,13 @@ Q_SIGNALS: Q_REVISION(1) void smartZoom(QQuickPinchEvent *pinch); protected: - bool childMouseEventFilter(QQuickItem *i, QEvent *e) Q_DECL_OVERRIDE; - void touchEvent(QTouchEvent *event) Q_DECL_OVERRIDE; + bool childMouseEventFilter(QQuickItem *i, QEvent *e) override; + void touchEvent(QTouchEvent *event) override; void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData& value) Q_DECL_OVERRIDE; - bool event(QEvent *) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; + void itemChange(ItemChange change, const ItemChangeData& value) override; + bool event(QEvent *) override; private: void clearPinch(); diff --git a/src/quick/items/qquickpositioners_p.h b/src/quick/items/qquickpositioners_p.h index 9ae7029d69..ce583aefe8 100644 --- a/src/quick/items/qquickpositioners_p.h +++ b/src/quick/items/qquickpositioners_p.h @@ -158,10 +158,10 @@ public: protected: QQuickBasePositioner(QQuickBasePositionerPrivate &dd, PositionerType at, QQuickItem *parent); - void componentComplete() Q_DECL_OVERRIDE; - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; + void componentComplete() override; + void itemChange(ItemChange, const ItemChangeData &) override; - void updatePolish() Q_DECL_OVERRIDE; + void updatePolish() override; Q_SIGNALS: void spacingChanged(); @@ -234,8 +234,8 @@ public: QQuickColumn(QQuickItem *parent=0); protected: - void doPositioning(QSizeF *contentSize) Q_DECL_OVERRIDE; - void reportConflictingAnchors() Q_DECL_OVERRIDE; + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; private: Q_DISABLE_COPY(QQuickColumn) }; @@ -258,8 +258,8 @@ Q_SIGNALS: void effectiveLayoutDirectionChanged(); protected: - void doPositioning(QSizeF *contentSize) Q_DECL_OVERRIDE; - void reportConflictingAnchors() Q_DECL_OVERRIDE; + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; private: Q_DISABLE_COPY(QQuickRow) Q_DECLARE_PRIVATE(QQuickRow) @@ -335,8 +335,8 @@ Q_SIGNALS: Q_REVISION(1) void verticalAlignmentChanged(VAlignment alignment); protected: - void doPositioning(QSizeF *contentSize) Q_DECL_OVERRIDE; - void reportConflictingAnchors() Q_DECL_OVERRIDE; + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; private: int m_rows; @@ -377,8 +377,8 @@ Q_SIGNALS: void effectiveLayoutDirectionChanged(); protected: - void doPositioning(QSizeF *contentSize) Q_DECL_OVERRIDE; - void reportConflictingAnchors() Q_DECL_OVERRIDE; + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; protected: QQuickFlow(QQuickFlowPrivate &dd, QQuickItem *parent); private: diff --git a/src/quick/items/qquickpositioners_p_p.h b/src/quick/items/qquickpositioners_p_p.h index 0be4c56df6..f4cb283a22 100644 --- a/src/quick/items/qquickpositioners_p_p.h +++ b/src/quick/items/qquickpositioners_p_p.h @@ -122,7 +122,7 @@ public: Qt::LayoutDirection layoutDirection; - void mirrorChange() Q_DECL_OVERRIDE { + void mirrorChange() override { effectiveLayoutDirectionChange(); } bool isLeftToRight() const { @@ -132,24 +132,24 @@ public: return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight; } - void itemSiblingOrderChanged(QQuickItem* other) Q_DECL_OVERRIDE + void itemSiblingOrderChanged(QQuickItem* other) override { Q_UNUSED(other); setPositioningDirty(); } - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange change, const QRectF &) Q_DECL_OVERRIDE + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange change, const QRectF &) override { if (change.sizeChange()) setPositioningDirty(); } - void itemVisibilityChanged(QQuickItem *) Q_DECL_OVERRIDE + void itemVisibilityChanged(QQuickItem *) override { setPositioningDirty(); } - void itemDestroyed(QQuickItem *item) Q_DECL_OVERRIDE + void itemDestroyed(QQuickItem *item) override { Q_Q(QQuickBasePositioner); int index = q->positionedItems.find(QQuickBasePositioner::PositionedItem(item)); diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h index 724a06013c..52f0bc975b 100644 --- a/src/quick/items/qquickrectangle_p.h +++ b/src/quick/items/qquickrectangle_p.h @@ -170,7 +170,7 @@ Q_SIGNALS: void radiusChanged(); protected: - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private Q_SLOTS: void doUpdate(); diff --git a/src/quick/items/qquickrendercontrol.h b/src/quick/items/qquickrendercontrol.h index 31ea176cc1..a626216f84 100644 --- a/src/quick/items/qquickrendercontrol.h +++ b/src/quick/items/qquickrendercontrol.h @@ -55,7 +55,7 @@ class Q_QUICK_EXPORT QQuickRenderControl : public QObject Q_OBJECT public: - explicit QQuickRenderControl(QObject *parent = Q_NULLPTR); + explicit QQuickRenderControl(QObject *parent = nullptr); ~QQuickRenderControl(); void prepareThread(QThread *targetThread); @@ -68,8 +68,8 @@ public: QImage grab(); - static QWindow *renderWindowFor(QQuickWindow *win, QPoint *offset = Q_NULLPTR); - virtual QWindow *renderWindow(QPoint *offset) { Q_UNUSED(offset); return Q_NULLPTR; } + static QWindow *renderWindowFor(QQuickWindow *win, QPoint *offset = nullptr); + virtual QWindow *renderWindow(QPoint *offset) { Q_UNUSED(offset); return nullptr; } Q_SIGNALS: void renderRequested(); diff --git a/src/quick/items/qquickrepeater_p.h b/src/quick/items/qquickrepeater_p.h index c14c1fb8cb..b630999547 100644 --- a/src/quick/items/qquickrepeater_p.h +++ b/src/quick/items/qquickrepeater_p.h @@ -94,8 +94,8 @@ private: void regenerate(); protected: - void componentComplete() Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; + void componentComplete() override; + void itemChange(ItemChange change, const ItemChangeData &value) override; private Q_SLOTS: void createdItem(int index, QObject *item); diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 8f0866f417..592485d6fa 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -876,7 +876,7 @@ void QQuickShaderEffectPrivate::updatePolish() #if QT_CONFIG(opengl) bool QQuickShaderEffect::isOpenGLShaderEffect() const { - return m_glImpl != Q_NULLPTR; + return m_glImpl != nullptr; } #endif diff --git a/src/quick/items/qquickshadereffectmesh_p.h b/src/quick/items/qquickshadereffectmesh_p.h index aa3112b5a5..f3ac956f60 100644 --- a/src/quick/items/qquickshadereffectmesh_p.h +++ b/src/quick/items/qquickshadereffectmesh_p.h @@ -95,10 +95,10 @@ class QQuickGridMesh : public QQuickShaderEffectMesh Q_PROPERTY(QSize resolution READ resolution WRITE setResolution NOTIFY resolutionChanged) public: QQuickGridMesh(QObject *parent = 0); - bool validateAttributes(const QVector<QByteArray> &attributes, int *posIndex) Q_DECL_OVERRIDE; + bool validateAttributes(const QVector<QByteArray> &attributes, int *posIndex) override; QSGGeometry *updateGeometry(QSGGeometry *geometry, int attrCount, int posIndex, - const QRectF &srcRect, const QRectF &rect) Q_DECL_OVERRIDE; - QString log() const Q_DECL_OVERRIDE { return m_log; } + const QRectF &srcRect, const QRectF &rect) override; + QString log() const override { return m_log; } void setResolution(const QSize &res); QSize resolution() const; diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp index f61bad1179..b4a45431c5 100644 --- a/src/quick/items/qquickshadereffectsource.cpp +++ b/src/quick/items/qquickshadereffectsource.cpp @@ -87,7 +87,7 @@ public: : texture(t) , provider(p) {} - void run() Q_DECL_OVERRIDE { + void run() override { delete texture; delete provider; } diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h index d9f9079a3d..185c5179b6 100644 --- a/src/quick/items/qquickshadereffectsource_p.h +++ b/src/quick/items/qquickshadereffectsource_p.h @@ -146,8 +146,8 @@ public: TextureMirroring textureMirroring() const; void setTextureMirroring(TextureMirroring mirroring); - bool isTextureProvider() const Q_DECL_OVERRIDE { return true; } - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; + bool isTextureProvider() const override { return true; } + QSGTextureProvider *textureProvider() const override; Q_INVOKABLE void scheduleUpdate(); @@ -174,11 +174,11 @@ private Q_SLOTS: void invalidateSceneGraph(); protected: - void releaseResources() Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + void releaseResources() override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; - void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override; + void itemChange(ItemChange change, const ItemChangeData &value) override; private: void ensureTexture(); diff --git a/src/quick/items/qquicksprite_p.h b/src/quick/items/qquicksprite_p.h index d68a45ecc0..2f7f6da5c0 100644 --- a/src/quick/items/qquicksprite_p.h +++ b/src/quick/items/qquicksprite_p.h @@ -161,7 +161,7 @@ public: return m_frameDurationVariation; } - int variedDuration() const Q_DECL_OVERRIDE; + int variedDuration() const override; bool frameSync() const { diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h index 4e5458a938..a1c156fa94 100644 --- a/src/quick/items/qquickspriteengine_p.h +++ b/src/quick/items/qquickspriteengine_p.h @@ -290,8 +290,8 @@ public: int spriteCount() const;//Like state count int maxFrames() const; - void restart(int index=0) Q_DECL_OVERRIDE; - void advance(int index=0) Q_DECL_OVERRIDE; + void restart(int index=0) override; + void advance(int index=0) override; //Similar API to QQuickPixmap for async loading convenience bool isNull() const { return status() == QQuickPixmap::Null; } diff --git a/src/quick/items/qquickspritesequence_p.h b/src/quick/items/qquickspritesequence_p.h index b80a8348aa..ffcefecaec 100644 --- a/src/quick/items/qquickspritesequence_p.h +++ b/src/quick/items/qquickspritesequence_p.h @@ -105,7 +105,7 @@ private Q_SLOTS: protected: void reset(); - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: void prepareNextFrame(QSGSpriteNode *node); QSGSpriteNode* initNode(); diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp index a4ce13a199..386bb058b5 100644 --- a/src/quick/items/qquickstateoperations.cpp +++ b/src/quick/items/qquickstateoperations.cpp @@ -510,7 +510,7 @@ QQuickStateActionEvent::EventType QQuickParentChange::type() const return ParentChange; } -bool QQuickParentChange::override(QQuickStateActionEvent*other) +bool QQuickParentChange::mayOverride(QQuickStateActionEvent*other) { Q_D(QQuickParentChange); if (other->type() != ParentChange) @@ -1302,7 +1302,7 @@ void QQuickAnchorChanges::clearBindings() } } -bool QQuickAnchorChanges::override(QQuickStateActionEvent*other) +bool QQuickAnchorChanges::mayOverride(QQuickStateActionEvent*other) { if (other->type() != AnchorChanges) return false; diff --git a/src/quick/items/qquickstateoperations_p.h b/src/quick/items/qquickstateoperations_p.h index 48b4b23a76..d61ed294cb 100644 --- a/src/quick/items/qquickstateoperations_p.h +++ b/src/quick/items/qquickstateoperations_p.h @@ -110,17 +110,17 @@ public: void setRotation(QQmlScriptString rotation); bool rotationIsSet() const; - ActionList actions() Q_DECL_OVERRIDE; + ActionList actions() override; - void saveOriginals() Q_DECL_OVERRIDE; + void saveOriginals() override; //virtual void copyOriginals(QQuickStateActionEvent*); - void execute() Q_DECL_OVERRIDE; - bool isReversable() Q_DECL_OVERRIDE; - void reverse() Q_DECL_OVERRIDE; - EventType type() const Q_DECL_OVERRIDE; - bool override(QQuickStateActionEvent*other) Q_DECL_OVERRIDE; - void rewind() Q_DECL_OVERRIDE; - void saveCurrentValues() Q_DECL_OVERRIDE; + void execute() override; + bool isReversable() override; + void reverse() override; + EventType type() const override; + bool mayOverride(QQuickStateActionEvent*other) override; + void rewind() override; + void saveCurrentValues() override; }; class QQuickAnchorChanges; @@ -190,28 +190,28 @@ public: QQuickAnchorChanges(QObject *parent=0); ~QQuickAnchorChanges(); - ActionList actions() Q_DECL_OVERRIDE; + ActionList actions() override; QQuickAnchorSet *anchors() const; QQuickItem *object() const; void setObject(QQuickItem *); - void execute() Q_DECL_OVERRIDE; - bool isReversable() Q_DECL_OVERRIDE; - void reverse() Q_DECL_OVERRIDE; - EventType type() const Q_DECL_OVERRIDE; - bool override(QQuickStateActionEvent*other) Q_DECL_OVERRIDE; - bool changesBindings() Q_DECL_OVERRIDE; - void saveOriginals() Q_DECL_OVERRIDE; - bool needsCopy() Q_DECL_OVERRIDE { return true; } - void copyOriginals(QQuickStateActionEvent*) Q_DECL_OVERRIDE; - void clearBindings() Q_DECL_OVERRIDE; - void rewind() Q_DECL_OVERRIDE; - void saveCurrentValues() Q_DECL_OVERRIDE; + void execute() override; + bool isReversable() override; + void reverse() override; + EventType type() const override; + bool mayOverride(QQuickStateActionEvent*other) override; + bool changesBindings() override; + void saveOriginals() override; + bool needsCopy() override { return true; } + void copyOriginals(QQuickStateActionEvent*) override; + void clearBindings() override; + void rewind() override; + void saveCurrentValues() override; QList<QQuickStateAction> additionalActions() const; - void saveTargetValues() Q_DECL_OVERRIDE; + void saveTargetValues() override; }; QT_END_NAMESPACE diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h index a56bcdb87b..6c48dd86a9 100644 --- a/src/quick/items/qquicktext_p.h +++ b/src/quick/items/qquicktext_p.h @@ -212,15 +212,15 @@ public: FontSizeMode fontSizeMode() const; void setFontSizeMode(FontSizeMode mode); - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; int resourcesLoading() const; // mainly for testing qreal contentWidth() const; qreal contentHeight() const; - QRectF boundingRect() const Q_DECL_OVERRIDE; - QRectF clipRect() const Q_DECL_OVERRIDE; + QRectF boundingRect() const override; + QRectF clipRect() const override; Q_INVOKABLE void doLayout(); // ### Qt 6: remove Q_REVISION(9) Q_INVOKABLE void forceLayout(); @@ -291,18 +291,18 @@ Q_SIGNALS: protected: QQuickText(QQuickTextPrivate &dd, QQuickItem *parent = 0); - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void itemChange(ItemChange change, const ItemChangeData &value) override; void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; - void updatePolish() Q_DECL_OVERRIDE; + void updatePolish() override; - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + void hoverEnterEvent(QHoverEvent *event) override; + void hoverMoveEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; void invalidateFontCaches(); private Q_SLOTS: diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h index 87f5162384..6fd0876a5f 100644 --- a/src/quick/items/qquicktext_p_p.h +++ b/src/quick/items/qquicktext_p_p.h @@ -78,7 +78,7 @@ public: void updateLayout(); bool determineHorizontalAlignment(); bool setHAlign(QQuickText::HAlignment, bool forceAlign = false); - void mirrorChange() Q_DECL_OVERRIDE; + void mirrorChange() override; bool isLineLaidOutConnected(); void setLineGeometry(QTextLine &line, qreal lineWidth, qreal &height); @@ -177,8 +177,8 @@ public: static const QChar elideChar; - qreal getImplicitWidth() const Q_DECL_OVERRIDE; - qreal getImplicitHeight() const Q_DECL_OVERRIDE; + qreal getImplicitWidth() const override; + qreal getImplicitHeight() const override; qreal availableWidth() const; qreal availableHeight() const; diff --git a/src/quick/items/qquicktextcontrol_p.h b/src/quick/items/qquicktextcontrol_p.h index 70104a97e0..862a81af28 100644 --- a/src/quick/items/qquicktextcontrol_p.h +++ b/src/quick/items/qquicktextcontrol_p.h @@ -177,9 +177,9 @@ public: bool cursorOn() const; protected: - void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *e) override; - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; private: Q_DISABLE_COPY(QQuickTextControl) diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h index 23033edb88..c883e39168 100644 --- a/src/quick/items/qquicktextedit_p.h +++ b/src/quick/items/qquicktextedit_p.h @@ -235,7 +235,7 @@ public: bool canUndo() const; bool canRedo() const; - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; /* FROM EDIT */ void setReadOnly(bool); @@ -244,7 +244,7 @@ public: QRectF cursorRectangle() const; #if QT_CONFIG(im) - QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE; + QVariant inputMethodQuery(Qt::InputMethodQuery property) const override; Q_REVISION(4) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif @@ -260,8 +260,8 @@ public: Q_INVOKABLE void moveCursorSelection(int pos); Q_INVOKABLE void moveCursorSelection(int pos, SelectionMode mode); - QRectF boundingRect() const Q_DECL_OVERRIDE; - QRectF clipRect() const Q_DECL_OVERRIDE; + QRectF boundingRect() const override; + QRectF clipRect() const override; bool isInputMethodComposing() const; @@ -387,28 +387,28 @@ protected: QQuickTextEdit(QQuickTextEditPrivate &dd, QQuickItem *parent = 0); void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; - bool event(QEvent *) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void keyReleaseEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE; - void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *) override; + void keyPressEvent(QKeyEvent *) override; + void keyReleaseEvent(QKeyEvent *) override; + void focusInEvent(QFocusEvent *event) override; + void focusOutEvent(QFocusEvent *event) override; - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + void hoverEnterEvent(QHoverEvent *event) override; + void hoverMoveEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; // mouse filter? - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; #if QT_CONFIG(im) - void inputMethodEvent(QInputMethodEvent *e) Q_DECL_OVERRIDE; + void inputMethodEvent(QInputMethodEvent *e) override; #endif - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) Q_DECL_OVERRIDE; - void updatePolish() Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) override; + void updatePolish() override; friend class QQuickTextUtil; friend class QQuickTextDocument; diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h index 455fffbcbc..09718cb49a 100644 --- a/src/quick/items/qquicktextedit_p_p.h +++ b/src/quick/items/qquicktextedit_p_p.h @@ -143,8 +143,8 @@ public: void relayoutDocument(); bool determineHorizontalAlignment(); bool setHAlign(QQuickTextEdit::HAlignment, bool forceAlign = false); - void mirrorChange() Q_DECL_OVERRIDE; - qreal getImplicitWidth() const Q_DECL_OVERRIDE; + void mirrorChange() override; + qreal getImplicitWidth() const override; Qt::LayoutDirection textDirection(const QString &text) const; bool isLinkHoveredConnected(); diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h index c4da807471..b7d3fb00fa 100644 --- a/src/quick/items/qquicktextinput_p.h +++ b/src/quick/items/qquicktextinput_p.h @@ -118,7 +118,7 @@ public: QQuickTextInput(QQuickItem * parent=0); ~QQuickTextInput(); - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; enum EchoMode {//To match QLineEdit::EchoMode Normal, @@ -267,12 +267,12 @@ public: bool hasAcceptableInput() const; #if QT_CONFIG(im) - QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE; + QVariant inputMethodQuery(Qt::InputMethodQuery property) const override; Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif - QRectF boundingRect() const Q_DECL_OVERRIDE; - QRectF clipRect() const Q_DECL_OVERRIDE; + QRectF boundingRect() const override; + QRectF clipRect() const override; bool canPaste() const; @@ -366,23 +366,23 @@ protected: QQuickTextInput(QQuickTextInputPrivate &dd, QQuickItem *parent = 0); void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent* ev) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void keyPressEvent(QKeyEvent* ev) override; #if QT_CONFIG(im) - void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE; + void inputMethodEvent(QInputMethodEvent *) override; #endif - void mouseUngrabEvent() Q_DECL_OVERRIDE; - bool event(QEvent *e) Q_DECL_OVERRIDE; - void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE; - void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE; - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) Q_DECL_OVERRIDE; - void updatePolish() Q_DECL_OVERRIDE; + void mouseUngrabEvent() override; + bool event(QEvent *e) override; + void focusOutEvent(QFocusEvent *event) override; + void focusInEvent(QFocusEvent *event) override; + void timerEvent(QTimerEvent *event) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override; + void updatePolish() override; public Q_SLOTS: void selectAll(); diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h index c3218197a4..c795aebfa9 100644 --- a/src/quick/items/qquicktextinput_p_p.h +++ b/src/quick/items/qquicktextinput_p_p.h @@ -172,7 +172,7 @@ public: void updateVerticalScroll(); bool determineHorizontalAlignment(); bool setHAlign(QQuickTextInput::HAlignment, bool forceAlign = false); - void mirrorChange() Q_DECL_OVERRIDE; + void mirrorChange() override; bool sendMouseEventToInputContext(QMouseEvent *event); #if QT_CONFIG(im) Qt::InputMethodHints effectiveInputMethodHints() const; @@ -451,7 +451,7 @@ public: void updateLayout(); void updateBaselineOffset(); - qreal getImplicitWidth() const Q_DECL_OVERRIDE; + qreal getImplicitWidth() const override; inline qreal padding() const { return extra.isAllocated() ? extra->padding : 0.0; } void setTopPadding(qreal value, bool reset = false); diff --git a/src/quick/items/qquicktranslate_p.h b/src/quick/items/qquicktranslate_p.h index 1bceba20cf..b0199cef40 100644 --- a/src/quick/items/qquicktranslate_p.h +++ b/src/quick/items/qquicktranslate_p.h @@ -75,7 +75,7 @@ public: qreal y() const; void setY(qreal); - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE; + void applyTo(QMatrix4x4 *matrix) const override; Q_SIGNALS: void xChanged(); @@ -111,7 +111,7 @@ public: qreal zScale() const; void setZScale(qreal); - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE; + void applyTo(QMatrix4x4 *matrix) const override; Q_SIGNALS: void originChanged(); @@ -146,7 +146,7 @@ public: void setAxis(const QVector3D &axis); void setAxis(Qt::Axis axis); - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE; + void applyTo(QMatrix4x4 *matrix) const override; Q_SIGNALS: void originChanged(); @@ -170,7 +170,7 @@ public: QMatrix4x4 matrix() const; void setMatrix(const QMatrix4x4& matrix); - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE; + void applyTo(QMatrix4x4 *matrix) const override; Q_SIGNALS: void matrixChanged(); diff --git a/src/quick/items/qquickview.h b/src/quick/items/qquickview.h index 6d3b30e4c4..142607fa39 100644 --- a/src/quick/items/qquickview.h +++ b/src/quick/items/qquickview.h @@ -60,9 +60,9 @@ class Q_QUICK_EXPORT QQuickView : public QQuickWindow Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(QUrl source READ source WRITE setSource DESIGNABLE true) public: - explicit QQuickView(QWindow *parent = Q_NULLPTR); + explicit QQuickView(QWindow *parent = nullptr); QQuickView(QQmlEngine* engine, QWindow *parent); - explicit QQuickView(const QUrl &source, QWindow *parent = Q_NULLPTR); + explicit QQuickView(const QUrl &source, QWindow *parent = nullptr); virtual ~QQuickView(); QUrl source() const; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 45c14f10a1..caae188ed8 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -132,7 +132,7 @@ public: } protected: - void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE + void timerEvent(QTimerEvent *) override { killTimer(m_timer); m_timer = 0; @@ -163,7 +163,7 @@ public slots: void animationStopped() { incubate(); } protected: - void incubatingObjectCountChanged(int count) Q_DECL_OVERRIDE + void incubatingObjectCountChanged(int count) override { if (count && !m_renderLoop->interleaveIncubation()) incubateAgain(); diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h index 022c4738f2..58cfff5ace 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -106,7 +106,7 @@ public: }; Q_ENUM(TextRenderType) - explicit QQuickWindow(QWindow *parent = Q_NULLPTR); + explicit QQuickWindow(QWindow *parent = nullptr); explicit QQuickWindow(QQuickRenderControl *renderControl); virtual ~QQuickWindow(); @@ -114,7 +114,7 @@ public: QQuickItem *contentItem() const; QQuickItem *activeFocusItem() const; - QObject *focusObject() const Q_DECL_OVERRIDE; + QObject *focusObject() const override; QQuickItem *mouseGrabberItem() const; @@ -136,7 +136,7 @@ public: QQmlIncubationController *incubationController() const; #if QT_CONFIG(accessibility) - QAccessibleInterface *accessibleRoot() const Q_DECL_OVERRIDE; + QAccessibleInterface *accessibleRoot() const override; #endif // Scene graph specific functions @@ -202,27 +202,27 @@ public Q_SLOTS: void releaseResources(); protected: - QQuickWindow(QQuickWindowPrivate &dd, QWindow *parent = Q_NULLPTR); + QQuickWindow(QQuickWindowPrivate &dd, QWindow *parent = nullptr); - void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; + void exposeEvent(QExposeEvent *) override; + void resizeEvent(QResizeEvent *) override; - void showEvent(QShowEvent *) Q_DECL_OVERRIDE; - void hideEvent(QHideEvent *) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *) override; + void hideEvent(QHideEvent *) override; // TODO Qt 6: reimplement QWindow::closeEvent to emit closing - void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE; - void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE; + void focusInEvent(QFocusEvent *) override; + void focusOutEvent(QFocusEvent *) override; - bool event(QEvent *) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void keyReleaseEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *) override; + void keyPressEvent(QKeyEvent *) override; + void keyReleaseEvent(QKeyEvent *) override; + void mousePressEvent(QMouseEvent *) override; + void mouseReleaseEvent(QMouseEvent *) override; + void mouseDoubleClickEvent(QMouseEvent *) override; + void mouseMoveEvent(QMouseEvent *) override; #if QT_CONFIG(wheelevent) - void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *) override; #endif private Q_SLOTS: diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 2d7b81cec8..06891406ab 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -334,7 +334,7 @@ class QQuickWindowQObjectCleanupJob : public QRunnable { public: QQuickWindowQObjectCleanupJob(QObject *o) : object(o) { } - void run() Q_DECL_OVERRIDE { delete object; } + void run() override { delete object; } QObject *object; static void schedule(QQuickWindow *window, QObject *object) { Q_ASSERT(window); diff --git a/src/quick/items/qquickwindowattached.cpp b/src/quick/items/qquickwindowattached.cpp index c8d71139ca..ae62a7a496 100644 --- a/src/quick/items/qquickwindowattached.cpp +++ b/src/quick/items/qquickwindowattached.cpp @@ -68,12 +68,12 @@ bool QQuickWindowAttached::isActive() const QQuickItem *QQuickWindowAttached::activeFocusItem() const { - return (m_window ? m_window->activeFocusItem() : Q_NULLPTR); + return (m_window ? m_window->activeFocusItem() : nullptr); } QQuickItem *QQuickWindowAttached::contentItem() const { - return (m_window ? m_window->contentItem() : Q_NULLPTR); + return (m_window ? m_window->contentItem() : nullptr); } int QQuickWindowAttached::width() const diff --git a/src/quick/items/qquickwindowmodule_p.h b/src/quick/items/qquickwindowmodule_p.h index 869d5b9a8e..e7033e9b8d 100644 --- a/src/quick/items/qquickwindowmodule_p.h +++ b/src/quick/items/qquickwindowmodule_p.h @@ -70,7 +70,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickWindowQmlImpl : public QQuickWindow, public Q Q_PROPERTY(QObject *screen READ screen WRITE setScreen NOTIFY screenChanged REVISION 2) public: - QQuickWindowQmlImpl(QWindow *parent = Q_NULLPTR); + QQuickWindowQmlImpl(QWindow *parent = nullptr); void setVisible(bool visible); void setVisibility(Visibility visibility); @@ -86,8 +86,8 @@ Q_SIGNALS: Q_REVISION(2) void screenChanged(); protected: - void classBegin() Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; + void classBegin() override; + void componentComplete() override; private Q_SLOTS: void setWindowVisibility(); diff --git a/src/quick/scenegraph/coreapi/qsgabstractrenderer.h b/src/quick/scenegraph/coreapi/qsgabstractrenderer.h index eb9e7cea7c..304dc008d5 100644 --- a/src/quick/scenegraph/coreapi/qsgabstractrenderer.h +++ b/src/quick/scenegraph/coreapi/qsgabstractrenderer.h @@ -90,7 +90,7 @@ Q_SIGNALS: void sceneGraphChanged(); protected: - explicit QSGAbstractRenderer(QObject *parent = Q_NULLPTR); + explicit QSGAbstractRenderer(QObject *parent = nullptr); virtual void nodeChanged(QSGNode *node, QSGNode::DirtyState state) = 0; private: diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h index b0a14d23b9..5c39242029 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h @@ -627,9 +627,9 @@ public: }; protected: - void nodeChanged(QSGNode *node, QSGNode::DirtyState state) Q_DECL_OVERRIDE; - void render() Q_DECL_OVERRIDE; - void releaseCachedResources() Q_DECL_OVERRIDE; + void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override; + void render() override; + void releaseCachedResources() override; private: enum ClipTypeBit @@ -698,7 +698,7 @@ private: void visualizeOverdraw(); void visualizeOverdraw_helper(Node *node); void visualizeDrawGeometry(const QSGGeometry *g); - void setCustomRenderMode(const QByteArray &mode) Q_DECL_OVERRIDE; + void setCustomRenderMode(const QByteArray &mode) override; QSGDefaultRenderContext *m_context; QSet<Node *> m_taggedRoots; diff --git a/src/quick/scenegraph/coreapi/qsgnode.h b/src/quick/scenegraph/coreapi/qsgnode.h index 1467f2233d..f2708b2b96 100644 --- a/src/quick/scenegraph/coreapi/qsgnode.h +++ b/src/quick/scenegraph/coreapi/qsgnode.h @@ -151,7 +151,7 @@ public: QT_DEPRECATED void clearDirty() { } void markDirty(DirtyState bits); - QT_DEPRECATED DirtyState dirtyState() const { return Q_NULLPTR; } + QT_DEPRECATED DirtyState dirtyState() const { return nullptr; } virtual bool isSubtreeBlocked() const; diff --git a/src/quick/scenegraph/coreapi/qsgrenderer_p.h b/src/quick/scenegraph/coreapi/qsgrenderer_p.h index 1cb4c56316..b890728fd8 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgrenderer_p.h @@ -86,8 +86,8 @@ public: bool isMirrored() const; void renderScene(const QSGBindable &bindable); - virtual void renderScene(uint fboId = 0) Q_DECL_OVERRIDE; - virtual void nodeChanged(QSGNode *node, QSGNode::DirtyState state) Q_DECL_OVERRIDE; + void renderScene(uint fboId = 0) override; + void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override; QSGNodeUpdater *nodeUpdater() const; void setNodeUpdater(QSGNodeUpdater *updater); diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index d460794573..fb66a6ebb1 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -143,7 +143,7 @@ public: qCDebug(QSG_LOG_INFO, "Animation Driver: using walltime"); } - void start() Q_DECL_OVERRIDE + void start() override { m_time = 0; m_timer.start(); @@ -151,14 +151,14 @@ public: QAnimationDriver::start(); } - qint64 elapsed() const Q_DECL_OVERRIDE + qint64 elapsed() const override { return m_mode == VSyncMode ? qint64(m_time) : qint64(m_time) + m_wallTime.elapsed(); } - void advance() Q_DECL_OVERRIDE + void advance() override { qint64 delta = m_timer.restart(); diff --git a/src/quick/scenegraph/qsgcontextplugin_p.h b/src/quick/scenegraph/qsgcontextplugin_p.h index 5914b42809..02d4b79b76 100644 --- a/src/quick/scenegraph/qsgcontextplugin_p.h +++ b/src/quick/scenegraph/qsgcontextplugin_p.h @@ -90,7 +90,7 @@ public: explicit QSGContextPlugin(QObject *parent = 0); virtual ~QSGContextPlugin(); - virtual QStringList keys() const override = 0; + QStringList keys() const override = 0; QQuickTextureFactory *createTextureFactoryFromImage(const QImage &) override { return 0; } QSGRenderLoop *createWindowManager() override { return 0; } diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index edb6e92a0d..0169f097bc 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -301,7 +301,7 @@ public: setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/32bitcolortext.frag")); } - void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) Q_DECL_OVERRIDE; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; }; void QSG32BitColorTextShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) @@ -310,7 +310,7 @@ void QSG32BitColorTextShader::updateState(const RenderState &state, QSGMaterial QSGTextMaskMaterial *material = static_cast<QSGTextMaskMaterial *>(newEffect); QSGTextMaskMaterial *oldMaterial = static_cast<QSGTextMaskMaterial *>(oldEffect); - if (oldMaterial == Q_NULLPTR || material->color() != oldMaterial->color() || state.isOpacityDirty()) { + if (oldMaterial == nullptr || material->color() != oldMaterial->color() || state.isOpacityDirty()) { float opacity = material->color().w() * state.opacity(); program()->setUniformValue(m_color_id, opacity); } diff --git a/src/quick/scenegraph/qsgdefaultlayer.cpp b/src/quick/scenegraph/qsgdefaultlayer.cpp index 86d74acf54..cd9c4a9a90 100644 --- a/src/quick/scenegraph/qsgdefaultlayer.cpp +++ b/src/quick/scenegraph/qsgdefaultlayer.cpp @@ -60,7 +60,7 @@ namespace public: BindableFbo(QOpenGLFramebufferObject *fbo, QSGDepthStencilBuffer *depthStencil); virtual ~BindableFbo(); - void bind() const Q_DECL_OVERRIDE; + void bind() const override; private: QOpenGLFramebufferObject *m_fbo; QSGDepthStencilBuffer *m_depthStencil; diff --git a/src/quick/scenegraph/qsgdefaultlayer_p.h b/src/quick/scenegraph/qsgdefaultlayer_p.h index 7b09293095..06355e0c21 100644 --- a/src/quick/scenegraph/qsgdefaultlayer_p.h +++ b/src/quick/scenegraph/qsgdefaultlayer_p.h @@ -69,56 +69,56 @@ public: QSGDefaultLayer(QSGRenderContext *context); ~QSGDefaultLayer(); - bool updateTexture() Q_DECL_OVERRIDE; + bool updateTexture() override; // The item's "paint node", not effect node. QSGNode *item() const { return m_item; } - void setItem(QSGNode *item) Q_DECL_OVERRIDE; + void setItem(QSGNode *item) override; QRectF rect() const { return m_rect; } - void setRect(const QRectF &rect) Q_DECL_OVERRIDE; + void setRect(const QRectF &rect) override; QSize size() const { return m_size; } - void setSize(const QSize &size) Q_DECL_OVERRIDE; + void setSize(const QSize &size) override; - void setHasMipmaps(bool mipmap) Q_DECL_OVERRIDE; + void setHasMipmaps(bool mipmap) override; - void bind() Q_DECL_OVERRIDE; + void bind() override; - bool hasAlphaChannel() const Q_DECL_OVERRIDE; - bool hasMipmaps() const Q_DECL_OVERRIDE; - int textureId() const Q_DECL_OVERRIDE; - QSize textureSize() const Q_DECL_OVERRIDE { return m_size; } + bool hasAlphaChannel() const override; + bool hasMipmaps() const override; + int textureId() const override; + QSize textureSize() const override { return m_size; } GLenum format() const { return m_format; } - void setFormat(GLenum format) Q_DECL_OVERRIDE; + void setFormat(GLenum format) override; bool live() const { return bool(m_live); } - void setLive(bool live) Q_DECL_OVERRIDE; + void setLive(bool live) override; bool recursive() const { return bool(m_recursive); } - void setRecursive(bool recursive) Q_DECL_OVERRIDE; + void setRecursive(bool recursive) override; - void setDevicePixelRatio(qreal ratio) Q_DECL_OVERRIDE { m_device_pixel_ratio = ratio; } + void setDevicePixelRatio(qreal ratio) override { m_device_pixel_ratio = ratio; } bool mirrorHorizontal() const { return bool(m_mirrorHorizontal); } - void setMirrorHorizontal(bool mirror) Q_DECL_OVERRIDE; + void setMirrorHorizontal(bool mirror) override; bool mirrorVertical() const { return bool(m_mirrorVertical); } - void setMirrorVertical(bool mirror) Q_DECL_OVERRIDE; + void setMirrorVertical(bool mirror) override; - void scheduleUpdate() Q_DECL_OVERRIDE; + void scheduleUpdate() override; - QImage toImage() const Q_DECL_OVERRIDE; + QImage toImage() const override; - QRectF normalizedTextureSubRect() const Q_DECL_OVERRIDE; + QRectF normalizedTextureSubRect() const override; int samples() const { return m_samples; } - void setSamples(int samples) Q_DECL_OVERRIDE { m_samples = samples; } + void setSamples(int samples) override { m_samples = samples; } public Q_SLOTS: - void markDirtyTexture() Q_DECL_OVERRIDE; - void invalidated() Q_DECL_OVERRIDE; + void markDirtyTexture() override; + void invalidated() override; private: void grab(); diff --git a/src/quick/scenegraph/qsgdefaultspritenode.cpp b/src/quick/scenegraph/qsgdefaultspritenode.cpp index 5eb8fb6e08..7fe6048d59 100644 --- a/src/quick/scenegraph/qsgdefaultspritenode.cpp +++ b/src/quick/scenegraph/qsgdefaultspritenode.cpp @@ -109,7 +109,7 @@ public: setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/sprite.frag")); } - void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *) Q_DECL_OVERRIDE + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *) override { QQuickSpriteMaterial *m = static_cast<QQuickSpriteMaterial *>(newEffect); m->texture->bind(); @@ -122,14 +122,14 @@ public: program()->setUniformValue(m_matrix_id, state.combinedMatrix()); } - void initialize() Q_DECL_OVERRIDE { + void initialize() override { m_matrix_id = program()->uniformLocation("qt_Matrix"); m_opacity_id = program()->uniformLocation("qt_Opacity"); m_animData_id = program()->uniformLocation("animData"); m_animPos_id = program()->uniformLocation("animPos"); } - char const *const *attributeNames() const Q_DECL_OVERRIDE { + char const *const *attributeNames() const override { static const char *attr[] = { "vPos", "vTex", diff --git a/src/quick/scenegraph/util/qsgengine.h b/src/quick/scenegraph/util/qsgengine.h index 3c8b61852e..514e6e8c2b 100644 --- a/src/quick/scenegraph/util/qsgengine.h +++ b/src/quick/scenegraph/util/qsgengine.h @@ -67,7 +67,7 @@ public: }; Q_DECLARE_FLAGS(CreateTextureOptions, CreateTextureOption) - explicit QSGEngine(QObject *parent = Q_NULLPTR); + explicit QSGEngine(QObject *parent = nullptr); ~QSGEngine(); void initialize(QOpenGLContext *context); diff --git a/src/quick/util/qquickanimation_p_p.h b/src/quick/util/qquickanimation_p_p.h index a7abc5a004..7a1bd8ff13 100644 --- a/src/quick/util/qquickanimation_p_p.h +++ b/src/quick/util/qquickanimation_p_p.h @@ -199,7 +199,7 @@ public: QQuickAnimationGroup *group; QAbstractAnimationJob* animationInstance; - static QQmlProperty createProperty(QObject *obj, const QString &str, QObject *infoObj, QString *errorMessage = Q_NULLPTR); + static QQmlProperty createProperty(QObject *obj, const QString &str, QObject *infoObj, QString *errorMessage = nullptr); }; class QQuickPauseAnimationPrivate : public QQuickAbstractAnimationPrivate diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index 14ead56740..5f8d2b94d3 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -398,7 +398,7 @@ public: return QMatrix4x4(matVals); } - const QMetaObject *getMetaObjectForMetaType(int type) Q_DECL_OVERRIDE + const QMetaObject *getMetaObjectForMetaType(int type) override { switch (type) { case QMetaType::QColor: @@ -422,7 +422,7 @@ public: return 0; } - bool init(int type, QVariant& dst) Q_DECL_OVERRIDE + bool init(int type, QVariant& dst) override { switch (type) { case QMetaType::QColor: @@ -452,7 +452,7 @@ public: return false; } - bool create(int type, int argc, const void *argv[], QVariant *v) Q_DECL_OVERRIDE + bool create(int type, int argc, const void *argv[], QVariant *v) override { switch (type) { case QMetaType::QFont: // must specify via js-object. @@ -519,7 +519,7 @@ public: return true; } - bool createFromString(int type, const QString &s, void *data, size_t dataSize) Q_DECL_OVERRIDE + bool createFromString(int type, const QString &s, void *data, size_t dataSize) override { bool ok = false; @@ -542,7 +542,7 @@ public: return false; } - bool createStringFrom(int type, const void *data, QString *s) Q_DECL_OVERRIDE + bool createStringFrom(int type, const void *data, QString *s) override { if (type == QMetaType::QColor) { const QColor *color = reinterpret_cast<const QColor *>(data); @@ -553,7 +553,7 @@ public: return false; } - bool variantFromString(const QString &s, QVariant *v) Q_DECL_OVERRIDE + bool variantFromString(const QString &s, QVariant *v) override { QColor c(s); if (c.isValid()) { @@ -596,7 +596,7 @@ public: return false; } - bool variantFromString(int type, const QString &s, QVariant *v) Q_DECL_OVERRIDE + bool variantFromString(int type, const QString &s, QVariant *v) override { bool ok = false; @@ -639,7 +639,7 @@ public: return false; } - bool variantFromJsObject(int type, QQmlV4Handle object, QV4::ExecutionEngine *v4, QVariant *v) Q_DECL_OVERRIDE + bool variantFromJsObject(int type, QQmlV4Handle object, QV4::ExecutionEngine *v4, QVariant *v) override { QV4::Scope scope(v4); #ifndef QT_NO_DEBUG @@ -665,7 +665,7 @@ public: return (*(reinterpret_cast<const T *>(lhs)) == rhs.value<T>()); } - bool equal(int type, const void *lhs, const QVariant &rhs) Q_DECL_OVERRIDE + bool equal(int type, const void *lhs, const QVariant &rhs) override { switch (type) { case QMetaType::QColor: @@ -698,7 +698,7 @@ public: return true; } - bool store(int type, const void *src, void *dst, size_t dstSize) Q_DECL_OVERRIDE + bool store(int type, const void *src, void *dst, size_t dstSize) override { Q_UNUSED(dstSize); switch (type) { @@ -728,7 +728,7 @@ public: return true; } - bool read(const QVariant &src, void *dst, int dstType) Q_DECL_OVERRIDE + bool read(const QVariant &src, void *dst, int dstType) override { switch (dstType) { case QMetaType::QColor: @@ -762,7 +762,7 @@ public: return false; } - bool write(int type, const void *src, QVariant& dst) Q_DECL_OVERRIDE + bool write(int type, const void *src, QVariant& dst) override { switch (type) { case QMetaType::QColor: diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index 61380b3ea0..4a9b4a95c1 100644 --- a/src/quick/util/qquickpropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -180,7 +180,7 @@ public: rewindExpression = QQmlPropertyPrivate::signalExpression(property); } - bool override(QQuickStateActionEvent *other) override { + bool mayOverride(QQuickStateActionEvent *other) override { if (other == this) return true; if (other->type() != type()) diff --git a/src/quick/util/qquickshortcut_p.h b/src/quick/util/qquickshortcut_p.h index db918058b2..c5d5501cb7 100644 --- a/src/quick/util/qquickshortcut_p.h +++ b/src/quick/util/qquickshortcut_p.h @@ -74,7 +74,7 @@ class QQuickShortcut : public QObject, public QQmlParserStatus Q_PROPERTY(Qt::ShortcutContext context READ context WRITE setContext NOTIFY contextChanged FINAL) public: - explicit QQuickShortcut(QObject *parent = Q_NULLPTR); + explicit QQuickShortcut(QObject *parent = nullptr); ~QQuickShortcut(); QVariant sequence() const; @@ -106,9 +106,9 @@ Q_SIGNALS: void activatedAmbiguously(); protected: - void classBegin() Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; - bool event(QEvent *event) Q_DECL_OVERRIDE; + void classBegin() override; + void componentComplete() override; + bool event(QEvent *event) override; struct Shortcut { Shortcut() : id(0) { } diff --git a/src/quick/util/qquickstate.cpp b/src/quick/util/qquickstate.cpp index 0a49d41491..65e51feb81 100644 --- a/src/quick/util/qquickstate.cpp +++ b/src/quick/util/qquickstate.cpp @@ -106,7 +106,7 @@ void QQuickStateActionEvent::clearBindings() { } -bool QQuickStateActionEvent::override(QQuickStateActionEvent *other) +bool QQuickStateActionEvent::mayOverride(QQuickStateActionEvent *other) { Q_UNUSED(other); return false; @@ -574,7 +574,7 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert) for (int jj = 0; jj < d->revertList.count(); ++jj) { QQuickStateActionEvent *event = d->revertList.at(jj).event(); if (event && event->type() == action.event->type()) { - if (action.event->override(event)) { + if (action.event->mayOverride(event)) { found = true; if (action.event != d->revertList.at(jj).event() && action.event->needsCopy()) { @@ -636,7 +636,7 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert) for (int jj = 0; !found && jj < applyList.count(); ++jj) { const QQuickStateAction &action = applyList.at(jj); if (action.event && action.event->type() == event->type()) { - if (action.event->override(event)) + if (action.event->mayOverride(event)) found = true; } } diff --git a/src/quick/util/qquickstate_p.h b/src/quick/util/qquickstate_p.h index 7d22ca9f8c..ac720f4189 100644 --- a/src/quick/util/qquickstate_p.h +++ b/src/quick/util/qquickstate_p.h @@ -115,7 +115,7 @@ public: virtual bool changesBindings(); virtual void clearBindings(); - virtual bool override(QQuickStateActionEvent*other); + virtual bool mayOverride(QQuickStateActionEvent*other); }; //### rename to QQuickStateChange? diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index bbe0192eac..7c221850ab 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -80,7 +80,7 @@ class QQuickWidgetRenderControl : public QQuickRenderControl { public: QQuickWidgetRenderControl(QQuickWidget *quickwidget) : m_quickWidget(quickwidget) {} - QWindow *renderWindow(QPoint *offset) Q_DECL_OVERRIDE { + QWindow *renderWindow(QPoint *offset) override { if (offset) *offset = m_quickWidget->mapTo(m_quickWidget->window(), QPoint()); return m_quickWidget->window()->windowHandle(); diff --git a/src/quickwidgets/qquickwidget.h b/src/quickwidgets/qquickwidget.h index 2d159778ed..e7fbc62967 100644 --- a/src/quickwidgets/qquickwidget.h +++ b/src/quickwidgets/qquickwidget.h @@ -64,9 +64,9 @@ class Q_QUICKWIDGETS_EXPORT QQuickWidget : public QWidget Q_PROPERTY(QUrl source READ source WRITE setSource DESIGNABLE true) public: - explicit QQuickWidget(QWidget *parent = Q_NULLPTR); + explicit QQuickWidget(QWidget *parent = nullptr); QQuickWidget(QQmlEngine* engine, QWidget *parent); - explicit QQuickWidget(const QUrl &source, QWidget *parent = Q_NULLPTR); + explicit QQuickWidget(const QUrl &source, QWidget *parent = nullptr); virtual ~QQuickWidget(); QUrl source() const; diff --git a/src/quickwidgets/qquickwidget_p.h b/src/quickwidgets/qquickwidget_p.h index 9747315577..03571e8dc7 100644 --- a/src/quickwidgets/qquickwidget_p.h +++ b/src/quickwidgets/qquickwidget_p.h @@ -87,7 +87,7 @@ public: ~QQuickWidgetPrivate(); void execute(); - void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) override; void initResize(); void updateSize(); void updatePosition(); @@ -100,8 +100,8 @@ public: void handleContextCreationFailure(const QSurfaceFormat &format, bool isEs); #if QT_CONFIG(opengl) - GLuint textureId() const Q_DECL_OVERRIDE; - QImage grabFramebuffer() Q_DECL_OVERRIDE; + GLuint textureId() const override; + QImage grabFramebuffer() override; #else QImage grabFramebuffer(); #endif |