diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-20 11:07:26 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-28 12:02:40 +0000 |
commit | 7182dfbfd2b19068ee09bd2f653bc19347ac9b96 (patch) | |
tree | 6b5aa039936b8615bf01c2962121b64da53b6a1b /src | |
parent | abb18449b0416524f9145e539dcbb922f226ad83 (diff) |
Fix deprecation warnings and developer build
- Fix deprecation of QScopedPointer::take() by using std::unique_ptr
- Mark QScxmlStateMachinePlugin::registerTypes() as override
Task-number: QTBUG-89832
Change-Id: I8d18b87e56d2f1fe26822559172a6c4129faf97e
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/scxmlstatemachine/plugin.cpp | 2 | ||||
-rw-r--r-- | src/scxml/qscxmlcompiler.cpp | 8 | ||||
-rw-r--r-- | src/scxml/qscxmlcompiler_p.h | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/imports/scxmlstatemachine/plugin.cpp b/src/imports/scxmlstatemachine/plugin.cpp index 82fd6d8..4bca889 100644 --- a/src/imports/scxmlstatemachine/plugin.cpp +++ b/src/imports/scxmlstatemachine/plugin.cpp @@ -55,7 +55,7 @@ class QScxmlStateMachinePlugin : public QQmlExtensionPlugin public: QScxmlStateMachinePlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } - void registerTypes(const char *uri) + void registerTypes(const char *uri) override { // @uri QtScxml Q_ASSERT(uri == QStringLiteral("QtScxml")); diff --git a/src/scxml/qscxmlcompiler.cpp b/src/scxml/qscxmlcompiler.cpp index 687d255..a29a749 100644 --- a/src/scxml/qscxmlcompiler.cpp +++ b/src/scxml/qscxmlcompiler.cpp @@ -1333,7 +1333,7 @@ bool QScxmlCompilerPrivate::verifyDocument() this->addError(location, msg); }; - if (ScxmlVerifier(handler).verify(m_doc.data())) + if (ScxmlVerifier(handler).verify(m_doc.get())) return true; else return false; @@ -1341,7 +1341,7 @@ bool QScxmlCompilerPrivate::verifyDocument() DocumentModel::ScxmlDocument *QScxmlCompilerPrivate::scxmlDocument() const { - return m_doc && m_errors.isEmpty() ? m_doc.data() : nullptr; + return m_doc && m_errors.isEmpty() ? m_doc.get() : nullptr; } QString QScxmlCompilerPrivate::fileName() const @@ -1372,7 +1372,7 @@ void QScxmlCompilerPrivate::parseSubDocument(DocumentModel::Invoke *parentInvoke p.setFileName(fileName); p.setLoader(loader()); p.d->readDocument(); - parentInvoke->content.reset(p.d->m_doc.take()); + parentInvoke->content.reset(p.d->m_doc.release()); m_doc->allSubDocuments.append(parentInvoke->content.data()); m_errors.append(p.errors()); } @@ -1386,7 +1386,7 @@ bool QScxmlCompilerPrivate::parseSubElement(DocumentModel::Invoke *parentInvoke, p.setLoader(loader()); p.d->resetDocument(); bool ok = p.d->readElement(); - parentInvoke->content.reset(p.d->m_doc.take()); + parentInvoke->content.reset(p.d->m_doc.release()); m_doc->allSubDocuments.append(parentInvoke->content.data()); m_errors.append(p.errors()); return ok; diff --git a/src/scxml/qscxmlcompiler_p.h b/src/scxml/qscxmlcompiler_p.h index 703e410..0e596f0 100644 --- a/src/scxml/qscxmlcompiler_p.h +++ b/src/scxml/qscxmlcompiler_p.h @@ -61,6 +61,8 @@ #include <QtCore/qstring.h> #include <QtCore/qxmlstream.h> +#include <memory> + QT_BEGIN_NAMESPACE namespace DocumentModel { @@ -719,7 +721,7 @@ private: QString m_fileName; QSet<QString> m_allIds; - QScopedPointer<DocumentModel::ScxmlDocument> m_doc; + std::unique_ptr<DocumentModel::ScxmlDocument> m_doc; DocumentModel::StateContainer *m_currentState; DefaultLoader m_defaultLoader; QScxmlCompiler::Loader *m_loader; |