diff options
28 files changed, 206 insertions, 206 deletions
diff --git a/.qmake.conf b/.qmake.conf index 4c5fedd..7c1ac12 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) CONFIG += qt_example_installs CONFIG += warning_clean -MODULE_VERSION = 5.10.1 +MODULE_VERSION = 5.11.0 diff --git a/examples/scxml/ftpclient/ftpclient.pro b/examples/scxml/ftpclient/ftpclient.pro index 3ba8adf..a1b2bc4 100644 --- a/examples/scxml/ftpclient/ftpclient.pro +++ b/examples/scxml/ftpclient/ftpclient.pro @@ -1,4 +1,4 @@ -QT = core scxml +QT = core scxml network TARGET = ftpclient diff --git a/examples/scxml/trafficlight-common/trafficlight.cpp b/examples/scxml/trafficlight-common/trafficlight.cpp index 8792ae2..5e2c6f9 100644 --- a/examples/scxml/trafficlight-common/trafficlight.cpp +++ b/examples/scxml/trafficlight-common/trafficlight.cpp @@ -76,14 +76,14 @@ public: LightWidget *greenLight() const { return m_green; } - virtual void paintEvent(QPaintEvent *) override + void paintEvent(QPaintEvent *) override { QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); painter.drawImage(0, 0, m_background); } - virtual QSize sizeHint() const override + QSize sizeHint() const override { return m_background.size(); } diff --git a/examples/scxml/trafficlight-common/trafficlight.h b/examples/scxml/trafficlight-common/trafficlight.h index 2639cb7..c42e41d 100644 --- a/examples/scxml/trafficlight-common/trafficlight.h +++ b/examples/scxml/trafficlight-common/trafficlight.h @@ -85,8 +85,8 @@ public slots: void switchLight(bool onoff); protected: - virtual void paintEvent(QPaintEvent *) override; - virtual QSize sizeHint() const override; + void paintEvent(QPaintEvent *) override; + QSize sizeHint() const override; private: QImage m_image; @@ -100,8 +100,8 @@ public: ButtonWidget(QWidget *parent = nullptr); protected: - virtual void paintEvent(QPaintEvent *) override; - virtual QSize sizeHint() const override; + void paintEvent(QPaintEvent *) override; + QSize sizeHint() const override; private: QImage m_playIcon; diff --git a/src/imports/scxmlstatemachine/statemachineloader.cpp b/src/imports/scxmlstatemachine/statemachineloader.cpp index 0d28e6c..d691479 100644 --- a/src/imports/scxmlstatemachine/statemachineloader.cpp +++ b/src/imports/scxmlstatemachine/statemachineloader.cpp @@ -58,9 +58,9 @@ QScxmlStateMachineLoader::QScxmlStateMachineLoader(QObject *parent) : QObject(parent) - , m_dataModel(Q_NULLPTR) - , m_implicitDataModel(Q_NULLPTR) - , m_stateMachine(Q_NULLPTR) + , m_dataModel(nullptr) + , m_implicitDataModel(nullptr) + , m_stateMachine(nullptr) { } @@ -93,8 +93,8 @@ void QScxmlStateMachineLoader::setSource(const QUrl &source) QUrl oldSource = m_source; if (m_stateMachine) { delete m_stateMachine; - m_stateMachine = Q_NULLPTR; - m_implicitDataModel = Q_NULLPTR; + m_stateMachine = nullptr; + m_implicitDataModel = nullptr; } if (parse(source)) { diff --git a/src/scxml/qscxmlcompiler.cpp b/src/scxml/qscxmlcompiler.cpp index d4a6fd7..61ad030 100644 --- a/src/scxml/qscxmlcompiler.cpp +++ b/src/scxml/qscxmlcompiler.cpp @@ -77,7 +77,7 @@ class ScxmlVerifier: public DocumentModel::NodeVisitor public: ScxmlVerifier(std::function<void (const DocumentModel::XmlLocation &, const QString &)> errorHandler) : m_errorHandler(errorHandler) - , m_doc(Q_NULLPTR) + , m_doc(nullptr) , m_hasErrors(false) {} @@ -106,7 +106,7 @@ public: } private: - bool visit(DocumentModel::Scxml *scxml) Q_DECL_OVERRIDE + bool visit(DocumentModel::Scxml *scxml) override { if (!scxml->name.isEmpty() && !isValidToken(scxml->name, XmlNmtoken)) { error(scxml->xmlLocation, @@ -133,12 +133,12 @@ private: return true; } - void endVisit(DocumentModel::Scxml *) Q_DECL_OVERRIDE + void endVisit(DocumentModel::Scxml *) override { m_parentNodes.removeLast(); } - bool visit(DocumentModel::State *state) Q_DECL_OVERRIDE + bool visit(DocumentModel::State *state) override { if (!state->id.isEmpty() && !isValidToken(state->id, XmlNCName)) { error(state->xmlLocation, QStringLiteral("'%1' is not a valid XML ID").arg(state->id)); @@ -197,12 +197,12 @@ private: return true; } - void endVisit(DocumentModel::State *) Q_DECL_OVERRIDE + void endVisit(DocumentModel::State *) override { m_parentNodes.removeLast(); } - bool visit(DocumentModel::Transition *transition) Q_DECL_OVERRIDE + bool visit(DocumentModel::Transition *transition) override { Q_ASSERT(transition->targetStates.isEmpty()); @@ -226,12 +226,12 @@ private: return true; } - void endVisit(DocumentModel::Transition *) Q_DECL_OVERRIDE + void endVisit(DocumentModel::Transition *) override { m_parentNodes.removeLast(); } - bool visit(DocumentModel::HistoryState *state) Q_DECL_OVERRIDE + bool visit(DocumentModel::HistoryState *state) override { bool seenTransition = false; for (DocumentModel::StateOrTransition *sot : qAsConst(state->children)) { @@ -252,25 +252,25 @@ private: return false; } - bool visit(DocumentModel::Send *node) Q_DECL_OVERRIDE + bool visit(DocumentModel::Send *node) override { checkEvent(node->event, node->xmlLocation, ForbidWildCards); checkExpr(node->xmlLocation, QStringLiteral("send"), QStringLiteral("eventexpr"), node->eventexpr); return true; } - void visit(DocumentModel::Cancel *node) Q_DECL_OVERRIDE + void visit(DocumentModel::Cancel *node) override { checkExpr(node->xmlLocation, QStringLiteral("cancel"), QStringLiteral("sendidexpr"), node->sendidexpr); } - bool visit(DocumentModel::DoneData *node) Q_DECL_OVERRIDE + bool visit(DocumentModel::DoneData *node) override { checkExpr(node->xmlLocation, QStringLiteral("donedata"), QStringLiteral("expr"), node->expr); return false; } - bool visit(DocumentModel::Invoke *node) Q_DECL_OVERRIDE + bool visit(DocumentModel::Invoke *node) override { if (!node->srcexpr.isEmpty()) return false; @@ -478,7 +478,7 @@ public: void setContent(const QSharedPointer<DocumentModel::ScxmlDocument> &content) { m_content = content; } - QScxmlInvokableService *invoke(QScxmlStateMachine *child) Q_DECL_OVERRIDE; + QScxmlInvokableService *invoke(QScxmlStateMachine *child) override; private: QSharedPointer<DocumentModel::ScxmlDocument> m_content; @@ -496,10 +496,10 @@ class DynamicStateMachine: public QScxmlStateMachine, public QScxmlInternal::Gen Q_DECLARE_PRIVATE(DynamicStateMachine) // Manually expanded from Q_OBJECT macro: public: - const QMetaObject *metaObject() const Q_DECL_OVERRIDE + const QMetaObject *metaObject() const override { return d_func()->m_metaObject; } - int qt_metacall(QMetaObject::Call _c, int _id, void **_a) Q_DECL_OVERRIDE + int qt_metacall(QMetaObject::Call _c, int _id, void **_a) override { Q_D(DynamicStateMachine); _id = QScxmlStateMachine::qt_metacall(_c, _id, _a); @@ -593,7 +593,7 @@ public: } } - QScxmlInvokableServiceFactory *serviceFactory(int id) const Q_DECL_OVERRIDE Q_DECL_FINAL + QScxmlInvokableServiceFactory *serviceFactory(int id) const override final { return m_allFactoriesById.at(id); } static DynamicStateMachine *build(DocumentModel::ScxmlDocument *doc) @@ -640,7 +640,7 @@ inline QScxmlInvokableService *InvokeDynamicScxmlFactory::invoke( bool ok = true; auto srcexpr = calculateSrcexpr(parentStateMachine, invokeInfo().expr, &ok); if (!ok) - return Q_NULLPTR; + return nullptr; if (!srcexpr.isEmpty()) return invokeDynamicScxmlService(srcexpr, parentStateMachine, this); @@ -670,7 +670,7 @@ QScxmlScxmlService *invokeDynamicScxmlService(const QString &sourceUrl, if (!errs.isEmpty()) { qWarning() << errs; - return Q_NULLPTR; + return nullptr; } QXmlStreamReader reader(data); @@ -682,7 +682,7 @@ QScxmlScxmlService *invokeDynamicScxmlService(const QString &sourceUrl, const auto errors = compiler.errors(); for (const QScxmlError &error : errors) qWarning().noquote() << error.toString(); - return Q_NULLPTR; + return nullptr; } auto mainDoc = QScxmlCompilerPrivate::get(&compiler)->scxmlDocument(); @@ -691,7 +691,7 @@ QScxmlScxmlService *invokeDynamicScxmlService(const QString &sourceUrl, const auto errors = compiler.errors(); for (const QScxmlError &error : errors) qWarning().noquote() << error.toString(); - return Q_NULLPTR; + return nullptr; } auto childStateMachine = DynamicStateMachine::build(mainDoc); @@ -810,7 +810,7 @@ QScxmlStateMachine *QScxmlCompiler::compile() QScxmlStateMachine *QScxmlCompilerPrivate::instantiateStateMachine() const { #ifdef BUILD_QSCXMLC - return Q_NULLPTR; + return nullptr; #else // BUILD_QSCXMLC DocumentModel::ScxmlDocument *doc = scxmlDocument(); if (doc && doc->root) { @@ -848,15 +848,15 @@ void QScxmlCompilerPrivate::instantiateDataModel(QScxmlStateMachine *stateMachin return; } - auto doc = m_doc.data(); - auto root = doc ? doc->root : Q_NULLPTR; - if (root == Q_NULLPTR) { + auto doc = scxmlDocument(); + auto root = doc ? doc->root : nullptr; + if (root == nullptr) { qWarning() << "SCXML document has no root element"; } else { QScxmlDataModel *dm = QScxmlDataModelPrivate::instantiateDataModel(root->dataModel); QScxmlStateMachinePrivate::get(stateMachine)->parserData()->m_ownedDataModel.reset(dm); stateMachine->setDataModel(dm); - if (dm == Q_NULLPTR) + if (dm == nullptr) qWarning() << "No data-model instantiated"; } #endif // BUILD_QSCXMLC @@ -1158,7 +1158,7 @@ DocumentModel::AbstractState *DocumentModel::Node::asAbstractState() return state; if (HistoryState *history = asHistoryState()) return history; - return Q_NULLPTR; + return nullptr; } void DocumentModel::DataElement::accept(DocumentModel::NodeVisitor *visitor) @@ -1320,7 +1320,7 @@ QScxmlCompilerPrivate *QScxmlCompilerPrivate::get(QScxmlCompiler *compiler) } QScxmlCompilerPrivate::QScxmlCompilerPrivate(QXmlStreamReader *reader) - : m_currentState(Q_NULLPTR) + : m_currentState(nullptr) , m_loader(&m_defaultLoader) , m_reader(reader) {} @@ -1342,7 +1342,7 @@ bool QScxmlCompilerPrivate::verifyDocument() DocumentModel::ScxmlDocument *QScxmlCompilerPrivate::scxmlDocument() const { - return m_doc && m_errors.isEmpty() ? m_doc.data() : Q_NULLPTR; + return m_doc && m_errors.isEmpty() ? m_doc.data() : nullptr; } QString QScxmlCompilerPrivate::fileName() const @@ -1963,7 +1963,7 @@ bool QScxmlCompilerPrivate::postReadElementDataModel() bool QScxmlCompilerPrivate::postReadElementData() { const ParserState parserState = current(); - DocumentModel::DataElement *data = Q_NULLPTR; + DocumentModel::DataElement *data = nullptr; if (auto state = m_currentState->asState()) { data = state->dataElements.last(); } else if (auto scxml = m_currentState->asScxml()) { @@ -2345,7 +2345,7 @@ void QScxmlCompilerPrivate::addError(const DocumentModel::XmlLocation &location, DocumentModel::AbstractState *QScxmlCompilerPrivate::currentParent() const { - return m_currentState ? m_currentState->asAbstractState() : Q_NULLPTR; + return m_currentState ? m_currentState->asAbstractState() : nullptr; } DocumentModel::XmlLocation QScxmlCompilerPrivate::xmlLocation() const @@ -2372,18 +2372,18 @@ DocumentModel::If *QScxmlCompilerPrivate::lastIf() { if (!hasPrevious()) { addError(QStringLiteral("No previous instruction found for else block")); - return Q_NULLPTR; + return nullptr; } DocumentModel::Instruction *lastI = previous().instruction; if (!lastI) { addError(QStringLiteral("No previous instruction found for else block")); - return Q_NULLPTR; + return nullptr; } DocumentModel::If *ifI = lastI->asIf(); if (!ifI) { addError(QStringLiteral("Previous instruction for else block is not an 'if'")); - return Q_NULLPTR; + return nullptr; } return ifI; } diff --git a/src/scxml/qscxmlcompiler_p.h b/src/scxml/qscxmlcompiler_p.h index d3e25df..4b270f8 100644 --- a/src/scxml/qscxmlcompiler_p.h +++ b/src/scxml/qscxmlcompiler_p.h @@ -90,14 +90,14 @@ struct Node { virtual ~Node(); virtual void accept(NodeVisitor *visitor) = 0; - virtual If *asIf() { return Q_NULLPTR; } - virtual Send *asSend() { return Q_NULLPTR; } - virtual Invoke *asInvoke() { return Q_NULLPTR; } - virtual Script *asScript() { return Q_NULLPTR; } - virtual State *asState() { return Q_NULLPTR; } - virtual Transition *asTransition() { return Q_NULLPTR; } - virtual HistoryState *asHistoryState() { return Q_NULLPTR; } - virtual Scxml *asScxml() { return Q_NULLPTR; } + virtual If *asIf() { return nullptr; } + virtual Send *asSend() { return nullptr; } + virtual Invoke *asInvoke() { return nullptr; } + virtual Script *asScript() { return nullptr; } + virtual State *asState() { return nullptr; } + virtual Transition *asTransition() { return nullptr; } + virtual HistoryState *asHistoryState() { return nullptr; } + virtual Scxml *asScxml() { return nullptr; } AbstractState *asAbstractState(); private: @@ -112,7 +112,7 @@ struct DataElement: public Node QString content; DataElement(const XmlLocation &xmlLocation): Node(xmlLocation) {} - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct Param: public Node @@ -122,7 +122,7 @@ struct Param: public Node QString location; Param(const XmlLocation &xmlLocation): Node(xmlLocation) {} - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct DoneData: public Node @@ -132,7 +132,7 @@ struct DoneData: public Node QVector<Param *> params; DoneData(const XmlLocation &xmlLocation): Node(xmlLocation) {} - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct Instruction: public Node @@ -162,8 +162,8 @@ struct Send: public Instruction QString contentexpr; Send(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - Send *asSend() Q_DECL_OVERRIDE { return this; } - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + Send *asSend() override { return this; } + void accept(NodeVisitor *visitor) override; }; struct ScxmlDocument; @@ -183,8 +183,8 @@ struct Invoke: public Instruction QSharedPointer<ScxmlDocument> content; Invoke(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - Invoke *asInvoke() Q_DECL_OVERRIDE { return this; } - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + Invoke *asInvoke() override { return this; } + void accept(NodeVisitor *visitor) override; }; struct Raise: public Instruction @@ -192,7 +192,7 @@ struct Raise: public Instruction QString event; Raise(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct Log: public Instruction @@ -200,7 +200,7 @@ struct Log: public Instruction QString label, expr; Log(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct Script: public Instruction @@ -209,8 +209,8 @@ struct Script: public Instruction QString content; Script(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - Script *asScript() Q_DECL_OVERRIDE { return this; } - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + Script *asScript() override { return this; } + void accept(NodeVisitor *visitor) override; }; struct Assign: public Instruction @@ -220,7 +220,7 @@ struct Assign: public Instruction QString content; Assign(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct If: public Instruction @@ -229,8 +229,8 @@ struct If: public Instruction InstructionSequences blocks; If(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - If *asIf() Q_DECL_OVERRIDE { return this; } - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + If *asIf() override { return this; } + void accept(NodeVisitor *visitor) override; }; struct Foreach: public Instruction @@ -241,7 +241,7 @@ struct Foreach: public Instruction InstructionSequence block; Foreach(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct Cancel: public Instruction @@ -250,7 +250,7 @@ struct Cancel: public Instruction QString sendidexpr; Cancel(const XmlLocation &xmlLocation): Instruction(xmlLocation) {} - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct StateOrTransition: public Node @@ -261,23 +261,23 @@ struct StateOrTransition: public Node struct StateContainer { StateContainer() - : parent(Q_NULLPTR) + : parent(nullptr) {} StateContainer *parent; virtual ~StateContainer() {} virtual void add(StateOrTransition *s) = 0; - virtual AbstractState *asAbstractState() { return Q_NULLPTR; } - virtual State *asState() { return Q_NULLPTR; } - virtual Scxml *asScxml() { return Q_NULLPTR; } + virtual AbstractState *asAbstractState() { return nullptr; } + virtual State *asState() { return nullptr; } + virtual Scxml *asScxml() { return nullptr; } }; struct AbstractState: public StateContainer { QString id; - AbstractState *asAbstractState() Q_DECL_OVERRIDE { return this; } + AbstractState *asAbstractState() override { return this; } }; struct State: public AbstractState, public StateOrTransition @@ -297,20 +297,20 @@ struct State: public AbstractState, public StateOrTransition State(const XmlLocation &xmlLocation) : StateOrTransition(xmlLocation) - , doneData(Q_NULLPTR) + , doneData(nullptr) , type(Normal) - , initialTransition(Q_NULLPTR) + , initialTransition(nullptr) {} - void add(StateOrTransition *s) Q_DECL_OVERRIDE + void add(StateOrTransition *s) override { Q_ASSERT(s); children.append(s); } - State *asState() Q_DECL_OVERRIDE { return this; } + State *asState() override { return this; } - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct Transition: public StateOrTransition @@ -329,9 +329,9 @@ struct Transition: public StateOrTransition , type(External) {} - Transition *asTransition() Q_DECL_OVERRIDE { return this; } + Transition *asTransition() override { return this; } - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct HistoryState: public AbstractState, public StateOrTransition @@ -345,17 +345,17 @@ struct HistoryState: public AbstractState, public StateOrTransition , type(Shallow) {} - void add(StateOrTransition *s) Q_DECL_OVERRIDE + void add(StateOrTransition *s) override { Q_ASSERT(s); children.append(s); } Transition *defaultConfiguration() - { return children.isEmpty() ? Q_NULLPTR : children.first()->asTransition(); } + { return children.isEmpty() ? nullptr : children.first()->asTransition(); } - HistoryState *asHistoryState() Q_DECL_OVERRIDE { return this; } - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + HistoryState *asHistoryState() override { return this; } + void accept(NodeVisitor *visitor) override; }; struct Scxml: public StateContainer, public Node @@ -390,15 +390,15 @@ struct Scxml: public StateContainer, public Node , initialTransition(nullptr) {} - void add(StateOrTransition *s) Q_DECL_OVERRIDE + void add(StateOrTransition *s) override { Q_ASSERT(s); children.append(s); } - Scxml *asScxml() Q_DECL_OVERRIDE { return this; } + Scxml *asScxml() override { return this; } - void accept(NodeVisitor *visitor) Q_DECL_OVERRIDE; + void accept(NodeVisitor *visitor) override; }; struct ScxmlDocument @@ -414,7 +414,7 @@ struct ScxmlDocument ScxmlDocument(const QString &fileName) : fileName(fileName) - , root(Q_NULLPTR) + , root(nullptr) , isVerified(false) {} @@ -706,7 +706,7 @@ public: DefaultLoader(); QByteArray load(const QString &name, const QString &baseDir, - QStringList *errors) Q_DECL_OVERRIDE Q_DECL_FINAL; + QStringList *errors) override final; }; private: diff --git a/src/scxml/qscxmlcppdatamodel.h b/src/scxml/qscxmlcppdatamodel.h index 244259f..8f71229 100644 --- a/src/scxml/qscxmlcppdatamodel.h +++ b/src/scxml/qscxmlcppdatamodel.h @@ -44,10 +44,10 @@ #define Q_SCXML_DATAMODEL \ public: \ - QString evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; \ - bool evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; \ - QVariant evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; \ - void evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; \ + QString evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; \ + bool evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; \ + QVariant evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; \ + void evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; \ private: QT_BEGIN_NAMESPACE @@ -60,18 +60,18 @@ class Q_SCXML_EXPORT QScxmlCppDataModel: public QScxmlDataModel public: explicit QScxmlCppDataModel(QObject *parent = nullptr); - Q_INVOKABLE bool setup(const QVariantMap &initialDataValues) Q_DECL_OVERRIDE; + Q_INVOKABLE bool setup(const QVariantMap &initialDataValues) override; - void evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE; - void evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE; - void evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, ForeachLoopBody *body) Q_DECL_OVERRIDE; + void evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) override; + void evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) override; + void evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, ForeachLoopBody *body) override; - void setScxmlEvent(const QScxmlEvent &scxmlEvent) Q_DECL_OVERRIDE Q_DECL_FINAL; + void setScxmlEvent(const QScxmlEvent &scxmlEvent) override final; const QScxmlEvent &scxmlEvent() const; - QVariant scxmlProperty(const QString &name) const Q_DECL_OVERRIDE; - bool hasScxmlProperty(const QString &name) const Q_DECL_OVERRIDE; - bool setScxmlProperty(const QString &name, const QVariant &value, const QString &context) Q_DECL_OVERRIDE; + QVariant scxmlProperty(const QString &name) const override; + bool hasScxmlProperty(const QString &name) const override; + bool setScxmlProperty(const QString &name, const QVariant &value, const QString &context) override; bool inState(const QString &stateName) const; }; diff --git a/src/scxml/qscxmldatamodel.cpp b/src/scxml/qscxmldatamodel.cpp index f7a7bb2..b67628b 100644 --- a/src/scxml/qscxmldatamodel.cpp +++ b/src/scxml/qscxmldatamodel.cpp @@ -120,7 +120,7 @@ void QScxmlDataModel::setStateMachine(QScxmlStateMachine *stateMachine) { Q_D(QScxmlDataModel); - if (d->m_stateMachine == Q_NULLPTR && stateMachine != Q_NULLPTR) { + if (d->m_stateMachine == nullptr && stateMachine != nullptr) { d->m_stateMachine = stateMachine; if (stateMachine) stateMachine->setDataModel(this); @@ -139,7 +139,7 @@ QScxmlStateMachine *QScxmlDataModel::stateMachine() const QScxmlDataModel *QScxmlDataModelPrivate::instantiateDataModel(DocumentModel::Scxml::DataModelType type) { - QScxmlDataModel *dataModel = Q_NULLPTR; + QScxmlDataModel *dataModel = nullptr; switch (type) { case DocumentModel::Scxml::NullDataModel: dataModel = new QScxmlNullDataModel; diff --git a/src/scxml/qscxmldatamodel_p.h b/src/scxml/qscxmldatamodel_p.h index 089071a..b91c63c 100644 --- a/src/scxml/qscxmldatamodel_p.h +++ b/src/scxml/qscxmldatamodel_p.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE class QScxmlDataModelPrivate : public QObjectPrivate { public: - QScxmlDataModelPrivate() : m_stateMachine(Q_NULLPTR) {} + QScxmlDataModelPrivate() : m_stateMachine(nullptr) {} static QScxmlDataModel *instantiateDataModel(DocumentModel::Scxml::DataModelType type); diff --git a/src/scxml/qscxmlecmascriptdatamodel.cpp b/src/scxml/qscxmlecmascriptdatamodel.cpp index 2bbf134..d8548d7 100644 --- a/src/scxml/qscxmlecmascriptdatamodel.cpp +++ b/src/scxml/qscxmlecmascriptdatamodel.cpp @@ -66,7 +66,7 @@ class QScxmlEcmaScriptDataModelPrivate : public QScxmlDataModelPrivate Q_DECLARE_PUBLIC(QScxmlEcmaScriptDataModel) public: QScxmlEcmaScriptDataModelPrivate() - : jsEngine(Q_NULLPTR) + : jsEngine(nullptr) {} QString evalStr(const QString &expr, const QString &context, bool *ok) @@ -312,7 +312,7 @@ private: // Uses private API QV4::Scope scope(engine); QV4::ScopedObject o(scope, QJSValuePrivate::getValue(object)); - if (o == Q_NULLPTR) { + if (o == nullptr) { return SetPropertyFailedForAnotherReason; } diff --git a/src/scxml/qscxmlecmascriptdatamodel.h b/src/scxml/qscxmlecmascriptdatamodel.h index 2e105ea..658df6d 100644 --- a/src/scxml/qscxmlecmascriptdatamodel.h +++ b/src/scxml/qscxmlecmascriptdatamodel.h @@ -51,21 +51,21 @@ class Q_SCXML_EXPORT QScxmlEcmaScriptDataModel: public QScxmlDataModel public: explicit QScxmlEcmaScriptDataModel(QObject *parent = nullptr); - Q_INVOKABLE bool setup(const QVariantMap &initialDataValues) Q_DECL_OVERRIDE; + Q_INVOKABLE bool setup(const QVariantMap &initialDataValues) override; - QString evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - bool evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - QVariant evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - void evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - void evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - void evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - void evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, ForeachLoopBody *body) Q_DECL_OVERRIDE Q_DECL_FINAL; + QString evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + bool evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + QVariant evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + void evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + void evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + void evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + void evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, ForeachLoopBody *body) override final; - void setScxmlEvent(const QScxmlEvent &event) Q_DECL_OVERRIDE; + void setScxmlEvent(const QScxmlEvent &event) override; - QVariant scxmlProperty(const QString &name) const Q_DECL_OVERRIDE; - bool hasScxmlProperty(const QString &name) const Q_DECL_OVERRIDE; - bool setScxmlProperty(const QString &name, const QVariant &value, const QString &context) Q_DECL_OVERRIDE; + QVariant scxmlProperty(const QString &name) const override; + bool hasScxmlProperty(const QString &name) const override; + bool setScxmlProperty(const QString &name, const QVariant &value, const QString &context) override; }; QT_END_NAMESPACE diff --git a/src/scxml/qscxmlecmascriptplatformproperties.cpp b/src/scxml/qscxmlecmascriptplatformproperties.cpp index c4bb195..95e3b4f 100644 --- a/src/scxml/qscxmlecmascriptplatformproperties.cpp +++ b/src/scxml/qscxmlecmascriptplatformproperties.cpp @@ -47,7 +47,7 @@ class QScxmlPlatformProperties::Data { public: Data() - : m_stateMachine(Q_NULLPTR) + : m_stateMachine(nullptr) {} QScxmlStateMachine *m_stateMachine; diff --git a/src/scxml/qscxmlerror.cpp b/src/scxml/qscxmlerror.cpp index 84cf4fe..3033040 100644 --- a/src/scxml/qscxmlerror.cpp +++ b/src/scxml/qscxmlerror.cpp @@ -94,7 +94,7 @@ public: * Creates a new invalid SCXML error. */ QScxmlError::QScxmlError() - : d(Q_NULLPTR) + : d(nullptr) {} /*! @@ -115,7 +115,7 @@ QScxmlError::QScxmlError(const QString &fileName, int line, int column, const QS * Constructs a copy of \a other. */ QScxmlError::QScxmlError(const QScxmlError &other) - : d(Q_NULLPTR) + : d(nullptr) { *this = other; } @@ -135,7 +135,7 @@ QScxmlError &QScxmlError::operator=(const QScxmlError &other) d->description = other.d->description; } else { delete d; - d = Q_NULLPTR; + d = nullptr; } return *this; } @@ -146,7 +146,7 @@ QScxmlError &QScxmlError::operator=(const QScxmlError &other) QScxmlError::~QScxmlError() { delete d; - d = Q_NULLPTR; + d = nullptr; } /*! @@ -156,7 +156,7 @@ QScxmlError::~QScxmlError() */ bool QScxmlError::isValid() const { - return d != Q_NULLPTR; + return d != nullptr; } /*! diff --git a/src/scxml/qscxmlevent.cpp b/src/scxml/qscxmlevent.cpp index d8c7c1d..2ec7566 100644 --- a/src/scxml/qscxmlevent.cpp +++ b/src/scxml/qscxmlevent.cpp @@ -52,8 +52,8 @@ QAtomicInt QScxmlEventBuilder::idCounter = QAtomicInt(0); QScxmlEvent *QScxmlEventBuilder::buildEvent() { - auto dataModel = stateMachine ? stateMachine->dataModel() : Q_NULLPTR; - auto tableData = stateMachine ? stateMachine->tableData() : Q_NULLPTR; + auto dataModel = stateMachine ? stateMachine->dataModel() : nullptr; + auto tableData = stateMachine ? stateMachine->tableData() : nullptr; QString eventName = event; bool ok = true; @@ -95,14 +95,14 @@ QScxmlEvent *QScxmlEventBuilder::buildEvent() sendid = generateId(); ok = stateMachine->dataModel()->setScxmlProperty(idLocation, sendid, tableData->string(instructionLocation)); if (!ok) - return Q_NULLPTR; + return nullptr; } QString origin = target; if (targetexpr != NoEvaluator) { origin = dataModel->evaluateToString(targetexpr, &ok); if (!ok) - return Q_NULLPTR; + return nullptr; } if (origin.isEmpty()) { if (eventType == QScxmlEvent::ExternalEvent) { @@ -116,14 +116,14 @@ QScxmlEvent *QScxmlEventBuilder::buildEvent() QStringLiteral("Error in %1: %2 is not a legal target") .arg(tableData->string(instructionLocation), origin), sendid); - return Q_NULLPTR; + return nullptr; } else if (!stateMachine->isDispatchableTarget(origin)) { // [6.2.4] and test521. submitError(QStringLiteral("error.communication"), QStringLiteral("Error in %1: cannot dispatch to target '%2'") .arg(tableData->string(instructionLocation), origin), sendid); - return Q_NULLPTR; + return nullptr; } QString origintype = type; @@ -134,7 +134,7 @@ QScxmlEvent *QScxmlEventBuilder::buildEvent() if (typeexpr != NoEvaluator) { origintype = dataModel->evaluateToString(typeexpr, &ok); if (!ok) - return Q_NULLPTR; + return nullptr; } if (!origintype.isEmpty() && origintype != QStringLiteral("http://www.w3.org/TR/scxml/#SCXMLEventProcessor")) { @@ -143,7 +143,7 @@ QScxmlEvent *QScxmlEventBuilder::buildEvent() QStringLiteral("Error in %1: %2 is not a valid type") .arg(tableData->string(instructionLocation), origintype), sendid); - return Q_NULLPTR; + return nullptr; } QString invokeid; diff --git a/src/scxml/qscxmlevent_p.h b/src/scxml/qscxmlevent_p.h index f5f5164..6d7f1c4 100644 --- a/src/scxml/qscxmlevent_p.h +++ b/src/scxml/qscxmlevent_p.h @@ -94,14 +94,14 @@ class QScxmlEventBuilder void init() // Because stupid VS2012 can't cope with non-static field initializers. { - stateMachine = Q_NULLPTR; + stateMachine = nullptr; eventexpr = QScxmlExecutableContent::NoEvaluator; contentExpr = QScxmlExecutableContent::NoEvaluator; - params = Q_NULLPTR; + params = nullptr; eventType = QScxmlEvent::ExternalEvent; targetexpr = QScxmlExecutableContent::NoEvaluator; typeexpr = QScxmlExecutableContent::NoEvaluator; - namelist = Q_NULLPTR; + namelist = nullptr; } public: diff --git a/src/scxml/qscxmlexecutablecontent.cpp b/src/scxml/qscxmlexecutablecontent.cpp index 2401aa6..26c8ab2 100644 --- a/src/scxml/qscxmlexecutablecontent.cpp +++ b/src/scxml/qscxmlexecutablecontent.cpp @@ -387,7 +387,7 @@ const InstructionId *QScxmlExecutionEngine::step(const InstructionId *ip, bool * , loopStart(loopStart) {} - void run(bool *ok) Q_DECL_OVERRIDE + void run(bool *ok) override { engine->step(loopStart, ok); } diff --git a/src/scxml/qscxmlinvokableservice.cpp b/src/scxml/qscxmlinvokableservice.cpp index 4cf9bd9..912be00 100644 --- a/src/scxml/qscxmlinvokableservice.cpp +++ b/src/scxml/qscxmlinvokableservice.cpp @@ -419,7 +419,7 @@ QScxmlInvokableService *QScxmlDynamicScxmlServiceFactory::invoke( bool ok = true; auto srcexpr = calculateSrcexpr(parentStateMachine, invokeInfo().expr, &ok); if (!ok) - return Q_NULLPTR; + return nullptr; return invokeDynamicScxmlService(srcexpr, parentStateMachine, this); } diff --git a/src/scxml/qscxmlinvokableservice.h b/src/scxml/qscxmlinvokableservice.h index a3c09e8..65ce4fc 100644 --- a/src/scxml/qscxmlinvokableservice.h +++ b/src/scxml/qscxmlinvokableservice.h @@ -108,7 +108,7 @@ public: const QVector<QScxmlExecutableContent::ParameterInfo> ¶meters, QObject *parent = nullptr); - QScxmlInvokableService *invoke(QScxmlStateMachine *parentStateMachine) Q_DECL_OVERRIDE; + QScxmlInvokableService *invoke(QScxmlStateMachine *parentStateMachine) override; }; class Q_SCXML_EXPORT QScxmlDynamicScxmlServiceFactory: public QScxmlInvokableServiceFactory @@ -121,7 +121,7 @@ public: const QVector<QScxmlExecutableContent::ParameterInfo> ¶meters, QObject *parent = nullptr); - QScxmlInvokableService *invoke(QScxmlStateMachine *parentStateMachine) Q_DECL_OVERRIDE; + QScxmlInvokableService *invoke(QScxmlStateMachine *parentStateMachine) override; }; QT_END_NAMESPACE diff --git a/src/scxml/qscxmlinvokableservice_p.h b/src/scxml/qscxmlinvokableservice_p.h index 37ca870..dce1d64 100644 --- a/src/scxml/qscxmlinvokableservice_p.h +++ b/src/scxml/qscxmlinvokableservice_p.h @@ -95,10 +95,10 @@ public: QScxmlInvokableServiceFactory *parent); ~QScxmlScxmlService(); - bool start() Q_DECL_OVERRIDE; - QString id() const Q_DECL_OVERRIDE; - QString name() const Q_DECL_OVERRIDE; - void postEvent(QScxmlEvent *event) Q_DECL_OVERRIDE; + bool start() override; + QString id() const override; + QString name() const override; + void postEvent(QScxmlEvent *event) override; QScxmlStateMachine *stateMachine() const; private: diff --git a/src/scxml/qscxmlnulldatamodel.h b/src/scxml/qscxmlnulldatamodel.h index 830162f..b34428d 100644 --- a/src/scxml/qscxmlnulldatamodel.h +++ b/src/scxml/qscxmlnulldatamodel.h @@ -53,21 +53,21 @@ public: explicit QScxmlNullDataModel(QObject *parent = nullptr); ~QScxmlNullDataModel(); - Q_INVOKABLE bool setup(const QVariantMap &initialDataValues) Q_DECL_OVERRIDE; + Q_INVOKABLE bool setup(const QVariantMap &initialDataValues) override; - QString evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - bool evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - QVariant evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - void evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - void evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - void evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) Q_DECL_OVERRIDE Q_DECL_FINAL; - void evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, ForeachLoopBody *body) Q_DECL_OVERRIDE Q_DECL_FINAL; + QString evaluateToString(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + bool evaluateToBool(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + QVariant evaluateToVariant(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + void evaluateToVoid(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + void evaluateAssignment(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + void evaluateInitialization(QScxmlExecutableContent::EvaluatorId id, bool *ok) override final; + void evaluateForeach(QScxmlExecutableContent::EvaluatorId id, bool *ok, ForeachLoopBody *body) override final; - void setScxmlEvent(const QScxmlEvent &event) Q_DECL_OVERRIDE; + void setScxmlEvent(const QScxmlEvent &event) override; - QVariant scxmlProperty(const QString &name) const Q_DECL_OVERRIDE; - bool hasScxmlProperty(const QString &name) const Q_DECL_OVERRIDE; - bool setScxmlProperty(const QString &name, const QVariant &value, const QString &context) Q_DECL_OVERRIDE; + QVariant scxmlProperty(const QString &name) const override; + bool hasScxmlProperty(const QString &name) const override; + bool setScxmlProperty(const QString &name, const QVariant &value, const QString &context) override; }; QT_END_NAMESPACE diff --git a/src/scxml/qscxmlstatemachine.cpp b/src/scxml/qscxmlstatemachine.cpp index 7cbabc7..c1d9a68 100644 --- a/src/scxml/qscxmlstatemachine.cpp +++ b/src/scxml/qscxmlstatemachine.cpp @@ -399,7 +399,7 @@ QMetaObject::Connection ScxmlEventRouter::connectToEvent(const QStringList &segm { QString segment = nextSegment(segments); if (segment.isEmpty()) { - const int *types = Q_NULLPTR; + const int *types = nullptr; if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection) types = QtPrivate::ConnectionTypes<QtPrivate::List<QScxmlEvent> >::types(); @@ -422,11 +422,11 @@ QScxmlStateMachinePrivate::QScxmlStateMachinePrivate(const QMetaObject *metaObje , m_isInvoked(false) , m_isInitialized(false) , m_isProcessingEvents(false) - , m_dataModel(Q_NULLPTR) + , m_dataModel(nullptr) , m_loader(&m_defaultLoader) - , m_executionEngine(Q_NULLPTR) - , m_tableData(Q_NULLPTR) - , m_parentStateMachine(Q_NULLPTR) + , m_executionEngine(nullptr) + , m_tableData(nullptr) + , m_parentStateMachine(nullptr) , m_eventLoopHook(this) , m_metaObject(metaObject) , m_infoSignalProxy(nullptr) @@ -729,7 +729,7 @@ void QScxmlStateMachinePrivate::resetEvent() void QScxmlStateMachinePrivate::emitStateActive(int stateIndex, bool active) { Q_Q(QScxmlStateMachine); - void *args[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&active)) }; + void *args[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&active)) }; const int signalIndex = m_stateIndexToSignalIndex.value(stateIndex, -1); if (signalIndex >= 0) QMetaObject::activate(q, m_metaObject, signalIndex, args); @@ -1717,7 +1717,7 @@ void QScxmlStateMachine::setDataModel(QScxmlDataModel *model) { Q_D(QScxmlStateMachine); - if (d->m_dataModel == Q_NULLPTR && model != Q_NULLPTR) { + if (d->m_dataModel == nullptr && model != nullptr) { d->m_dataModel = model; if (model) model->setStateMachine(this); @@ -1893,7 +1893,7 @@ QMetaObject::Connection QScxmlStateMachine::connectToStateImpl(const QString &sc QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) { - const int *types = Q_NULLPTR; + const int *types = nullptr; if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection) types = QtPrivate::ConnectionTypes<QtPrivate::List<bool> >::types(); diff --git a/src/scxml/qscxmlstatemachine_p.h b/src/scxml/qscxmlstatemachine_p.h index a2926a8..aa08f1c 100644 --- a/src/scxml/qscxmlstatemachine_p.h +++ b/src/scxml/qscxmlstatemachine_p.h @@ -77,7 +77,7 @@ public: Q_INVOKABLE void doProcessEvents(); protected: - void timerEvent(QTimerEvent *timerEvent) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *timerEvent) override; }; class ScxmlEventRouter : public QObject diff --git a/src/scxml/qscxmltabledata.cpp b/src/scxml/qscxmltabledata.cpp index f9665d3..aa9a35e 100644 --- a/src/scxml/qscxmltabledata.cpp +++ b/src/scxml/qscxmltabledata.cpp @@ -213,7 +213,7 @@ public: protected: // visitor using NodeVisitor::visit; - bool visit(DocumentModel::Scxml *node) Q_DECL_OVERRIDE Q_DECL_FINAL + bool visit(DocumentModel::Scxml *node) override final { setName(node->name); @@ -278,7 +278,7 @@ protected: // visitor return false; } - bool visit(DocumentModel::State *state) Q_DECL_OVERRIDE Q_DECL_FINAL + bool visit(DocumentModel::State *state) override final { m_stateNames.add(state->id); const int stateIndex = m_docStatesIndices.value(state, -1); @@ -378,7 +378,7 @@ protected: // visitor return false; } - bool visit(DocumentModel::Transition *transition) Q_DECL_OVERRIDE Q_DECL_FINAL + bool visit(DocumentModel::Transition *transition) override final { const int transitionIndex = m_docTransitionIndices.value(transition, -1); Q_ASSERT(transitionIndex != -1); @@ -428,7 +428,7 @@ protected: // visitor return false; } - bool visit(DocumentModel::HistoryState *historyState) Q_DECL_OVERRIDE Q_DECL_FINAL + bool visit(DocumentModel::HistoryState *historyState) override final { const int stateIndex = m_docStatesIndices.value(historyState, -1); Q_ASSERT(stateIndex != -1); @@ -454,7 +454,7 @@ protected: // visitor return false; } - bool visit(DocumentModel::Send *node) Q_DECL_OVERRIDE Q_DECL_FINAL + bool visit(DocumentModel::Send *node) override final { auto instr = m_instructions.add<Send>(Send::calculateExtraSize(node->params.size(), node->namelist.size())); @@ -486,13 +486,13 @@ protected: // visitor return false; } - void visit(DocumentModel::Raise *node) Q_DECL_OVERRIDE Q_DECL_FINAL + void visit(DocumentModel::Raise *node) override final { auto instr = m_instructions.add<Raise>(); instr->event = addString(node->event); } - void visit(DocumentModel::Log *node) Q_DECL_OVERRIDE Q_DECL_FINAL + void visit(DocumentModel::Log *node) override final { auto instr = m_instructions.add<Log>(); instr->label = addString(node->label); @@ -501,7 +501,7 @@ protected: // visitor node->expr); } - void visit(DocumentModel::Script *node) Q_DECL_OVERRIDE Q_DECL_FINAL + void visit(DocumentModel::Script *node) override final { auto instr = m_instructions.add<JavaScript>(); instr->go = createEvaluatorVoid(QStringLiteral("script"), @@ -509,14 +509,14 @@ protected: // visitor node->content); } - void visit(DocumentModel::Assign *node) Q_DECL_OVERRIDE Q_DECL_FINAL + void visit(DocumentModel::Assign *node) override final { auto instr = m_instructions.add<Assign>(); auto ctxt = createContext(QStringLiteral("assign"), QStringLiteral("expr"), node->expr); instr->expression = addAssignment(node->location, node->expr, ctxt); } - bool visit(DocumentModel::If *node) Q_DECL_OVERRIDE Q_DECL_FINAL + bool visit(DocumentModel::If *node) override final { auto instr = m_instructions.add<If>(node->conditions.size()); instr->conditions.count = node->conditions.size(); @@ -533,7 +533,7 @@ protected: // visitor return false; } - bool visit(DocumentModel::Foreach *node) Q_DECL_OVERRIDE Q_DECL_FINAL + bool visit(DocumentModel::Foreach *node) override final { auto instr = m_instructions.add<Foreach>(); auto ctxt = createContextString(QStringLiteral("foreach")); @@ -544,7 +544,7 @@ protected: // visitor return false; } - void visit(DocumentModel::Cancel *node) Q_DECL_OVERRIDE Q_DECL_FINAL + void visit(DocumentModel::Cancel *node) override final { auto instr = m_instructions.add<Cancel>(); instr->sendid = addString(node->sendid); @@ -667,7 +667,7 @@ protected: { SequenceInfo info = m_activeSequences.back(); m_activeSequences.pop_back(); - m_instructions.setSequenceInfo(m_activeSequences.isEmpty() ? Q_NULLPTR : + m_instructions.setSequenceInfo(m_activeSequences.isEmpty() ? nullptr : &m_activeSequences.last()); auto sequence = m_instructions.at<InstructionSequence>(info.location); @@ -896,7 +896,7 @@ private: public: InstructionStorage(QVector<qint32> &storage) : m_instr(storage) - , m_info(Q_NULLPTR) + , m_info(nullptr) {} ContainerId newContainerId() const { return m_instr.size(); } diff --git a/src/scxml/qscxmltabledata_p.h b/src/scxml/qscxmltabledata_p.h index 767b88a..47d8bac 100644 --- a/src/scxml/qscxmltabledata_p.h +++ b/src/scxml/qscxmltabledata_p.h @@ -95,19 +95,19 @@ public: static QString toString(const int *stateMachineTable); public: - QString string(QScxmlExecutableContent::StringId id) const Q_DECL_OVERRIDE Q_DECL_FINAL; - QScxmlExecutableContent::InstructionId *instructions() const Q_DECL_OVERRIDE Q_DECL_FINAL; + QString string(QScxmlExecutableContent::StringId id) const override final; + QScxmlExecutableContent::InstructionId *instructions() const override final; QScxmlExecutableContent::EvaluatorInfo evaluatorInfo( - QScxmlExecutableContent::EvaluatorId evaluatorId) const Q_DECL_OVERRIDE Q_DECL_FINAL; + QScxmlExecutableContent::EvaluatorId evaluatorId) const override final; QScxmlExecutableContent::AssignmentInfo assignmentInfo( - QScxmlExecutableContent::EvaluatorId assignmentId) const Q_DECL_OVERRIDE Q_DECL_FINAL; + QScxmlExecutableContent::EvaluatorId assignmentId) const override final; QScxmlExecutableContent::ForeachInfo foreachInfo( - QScxmlExecutableContent::EvaluatorId foreachId) const Q_DECL_OVERRIDE Q_DECL_FINAL; - QScxmlExecutableContent::StringId *dataNames(int *count) const Q_DECL_OVERRIDE Q_DECL_FINAL; - QScxmlExecutableContent::ContainerId initialSetup() const Q_DECL_OVERRIDE Q_DECL_FINAL; - QString name() const Q_DECL_OVERRIDE Q_DECL_FINAL; - const qint32 *stateMachineTable() const Q_DECL_OVERRIDE Q_DECL_FINAL; - QScxmlInvokableServiceFactory *serviceFactory(int id) const Q_DECL_OVERRIDE; + QScxmlExecutableContent::EvaluatorId foreachId) const override final; + QScxmlExecutableContent::StringId *dataNames(int *count) const override final; + QScxmlExecutableContent::ContainerId initialSetup() const override final; + QString name() const override final; + const qint32 *stateMachineTable() const override final; + QScxmlInvokableServiceFactory *serviceFactory(int id) const override; public: QVector<qint32> theStateMachineTable; diff --git a/tests/auto/scion/tst_scion.cpp b/tests/auto/scion/tst_scion.cpp index 296c63d..7b7c008 100644 --- a/tests/auto/scion/tst_scion.cpp +++ b/tests/auto/scion/tst_scion.cpp @@ -92,7 +92,7 @@ public: DynamicLoader(); QByteArray load(const QString &name, const QString &baseDir, - QStringList *errors) Q_DECL_OVERRIDE Q_DECL_FINAL; + QStringList *errors) override final; }; @@ -209,7 +209,7 @@ void TestScion::dynamic() QVERIFY(compiler.errors().isEmpty()); scxmlFile.close(); - QVERIFY(stateMachine != Q_NULLPTR); + QVERIFY(stateMachine != nullptr); stateMachine->setLoader(&loader); const bool runResult = runTest(stateMachine.data(), testDescription.object()); @@ -251,10 +251,10 @@ void TestScion::compiled() jsonFile.close(); QScopedPointer<QScxmlStateMachine> stateMachine(creator()); - if (stateMachine == Q_NULLPTR && testStatus == TestFailsOnRun) { + if (stateMachine == nullptr && testStatus == TestFailsOnRun) { QEXPECT_FAIL("", "This is expected to fail", Abort); } - QVERIFY(stateMachine != Q_NULLPTR); + QVERIFY(stateMachine != nullptr); DynamicLoader loader; stateMachine->setLoader(&loader); diff --git a/tools/qscxmlc/generator.cpp b/tools/qscxmlc/generator.cpp index 048cf3e..3de3736 100644 --- a/tools/qscxmlc/generator.cpp +++ b/tools/qscxmlc/generator.cpp @@ -502,7 +502,7 @@ void Generator::generateCode() for (int i = 0; i < extraList.count(); ++i) { fprintf(out, " &%s::staticMetaObject,\n", extraList.at(i).constData()); } - fprintf(out, " Q_NULLPTR\n};\n\n"); + fprintf(out, " nullptr\n};\n\n"); } // @@ -514,24 +514,24 @@ void Generator::generateCode() fprintf(out, "const QMetaObject %s::staticMetaObject = {\n", cdef->qualified.constData()); if (isQObject) - fprintf(out, " { Q_NULLPTR, "); + fprintf(out, " { nullptr, "); else if (cdef->superclassList.size() && (!cdef->hasQGadget || knownGadgets.contains(purestSuperClass))) fprintf(out, " { &%s::staticMetaObject, ", purestSuperClass.constData()); else - fprintf(out, " { Q_NULLPTR, "); + fprintf(out, " { nullptr, "); fprintf(out, "qt_meta_stringdata_%s.data,\n" " qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(), qualifiedClassNameIdentifier.constData()); if (hasStaticMetaCall) fprintf(out, " qt_static_metacall, "); else - fprintf(out, " Q_NULLPTR, "); + fprintf(out, " nullptr, "); if (extraList.isEmpty()) - fprintf(out, "Q_NULLPTR, "); + fprintf(out, "nullptr, "); else fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData()); - fprintf(out, "Q_NULLPTR}\n};\n\n"); + fprintf(out, "nullptr}\n};\n\n"); if(isQt) return; @@ -546,7 +546,7 @@ void Generator::generateCode() // Generate smart cast function // fprintf(out, "\nvoid *%s::qt_metacast(const char *_clname)\n{\n", cdef->qualified.constData()); - fprintf(out, " if (!_clname) return Q_NULLPTR;\n"); + fprintf(out, " if (!_clname) return nullptr;\n"); fprintf(out, " if (!strcmp(_clname, reinterpret_cast<const char *>(\n" " qt_meta_stringdata_%s.stringdata0)))\n" " return static_cast<void*>(const_cast< %s*>(this));\n", @@ -572,7 +572,7 @@ void Generator::generateCode() QByteArray superClass = purestSuperClass; fprintf(out, " return %s::qt_metacast(_clname);\n", superClass.constData()); } else { - fprintf(out, " return Q_NULLPTR;\n"); + fprintf(out, " return nullptr;\n"); } fprintf(out, "}\n"); @@ -1473,7 +1473,7 @@ void Generator::generateSignal(FunctionDef *def,int index) fprintf(out, "QPrivateSignal"); fprintf(out, ")%s\n{\n" - " QMetaObject::activate(%s, &staticMetaObject, %d, Q_NULLPTR);\n" + " QMetaObject::activate(%s, &staticMetaObject, %d, nullptr);\n" "}\n", constQualifier, thisPtr.constData(), index); return; } @@ -1503,7 +1503,7 @@ void Generator::generateSignal(FunctionDef *def,int index) fprintf(out, " void *_a[] = { "); if (def->normalizedType == "void") { - fprintf(out, "Q_NULLPTR"); + fprintf(out, "nullptr"); } else { fprintf(out, "const_cast<void*>(reinterpret_cast<const void*>(&_t0))"); } @@ -1541,7 +1541,7 @@ void Generator::generateSignalDefs() fprintf(out, "void %s::%s(bool _t1)\n{\n", cdef->classname.constData(), f.mangledName.constData()); - fprintf(out, " void *_a[] = { Q_NULLPTR, " + fprintf(out, " void *_a[] = { nullptr, " "const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };\n "); fprintf(out, f.implementation, "this", methodindex); fprintf(out, "\n}\n\n"); diff --git a/tools/qscxmlc/scxmlcppdumper.h b/tools/qscxmlc/scxmlcppdumper.h index a987f80..35849c0 100644 --- a/tools/qscxmlc/scxmlcppdumper.h +++ b/tools/qscxmlc/scxmlcppdumper.h @@ -42,7 +42,7 @@ struct TranslationUnit { TranslationUnit() : stateMethods(false) - , mainDocument(Q_NULLPTR) + , mainDocument(nullptr) {} QString scxmlFileName; |