diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-06-03 12:21:13 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-07-02 15:28:20 +0200 |
commit | 812e69f7b7064d7edc7097e0719e358c22acb519 (patch) | |
tree | 9e2bbf3ab85b623647c7d3273b9efd6ffd5af335 | |
parent | 943b455baa62a8f0f0e1344bf042e4f3bcdeceee (diff) |
Modernize QML module
Use declarative type registration, and create a proper backing library
for the QML-exposed types.
Change-Id: I56c6a3acd6e6c8ea2c1ac24435b8601f562dbaf6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/declarative_opcua/CMakeLists.txt | 45 | ||||
-rw-r--r-- | src/declarative_opcua/doc/snippets/basic/basic.pro (renamed from src/imports/doc/snippets/basic/basic.pro) | 0 | ||||
-rw-r--r-- | src/declarative_opcua/doc/snippets/basic/basic.qml (renamed from src/imports/doc/snippets/basic/basic.qml) | 0 | ||||
-rw-r--r-- | src/declarative_opcua/doc/snippets/basic/main.cpp (renamed from src/imports/doc/snippets/basic/main.cpp) | 0 | ||||
-rw-r--r-- | src/declarative_opcua/doc/snippets/basic/qml.qrc (renamed from src/imports/doc/snippets/basic/qml.qrc) | 0 | ||||
-rw-r--r-- | src/declarative_opcua/doc/snippets/snippets.pro (renamed from src/imports/doc/snippets/snippets.pro) | 0 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaattributecache.cpp (renamed from src/imports/opcua/opcuaattributecache.cpp) | 4 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaattributecache_p.h (renamed from src/imports/opcua/opcuaattributecache.h) | 12 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaattributeoperand.cpp (renamed from src/imports/opcua/opcuaattributeoperand.cpp) | 8 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaattributeoperand_p.h (renamed from src/imports/opcua/opcuaattributeoperand.h) | 26 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaattributevalue.cpp (renamed from src/imports/opcua/opcuaattributevalue.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaattributevalue_p.h (renamed from src/imports/opcua/opcuaattributevalue.h) | 11 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaconnection.cpp (renamed from src/imports/opcua/opcuaconnection.cpp) | 11 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaconnection_p.h (renamed from src/imports/opcua/opcuaconnection.h) | 20 | ||||
-rw-r--r-- | src/declarative_opcua/opcuadatachangefilter.cpp (renamed from src/imports/opcua/opcuadatachangefilter.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuadatachangefilter_p.h (renamed from src/imports/opcua/opcuadatachangefilter.h) | 21 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaelementoperand.cpp (renamed from src/imports/opcua/opcuaelementoperand.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaelementoperand_p.h (renamed from src/imports/opcua/opcuaelementoperand.h) | 22 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaendpointdiscovery.cpp (renamed from src/imports/opcua/opcuaendpointdiscovery.cpp) | 6 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaendpointdiscovery_p.h (renamed from src/imports/opcua/opcuaendpointdiscovery.h) | 26 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaeventfilter.cpp (renamed from src/imports/opcua/opcuaeventfilter.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaeventfilter_p.h (renamed from src/imports/opcua/opcuaeventfilter.h) | 26 | ||||
-rw-r--r-- | src/declarative_opcua/opcuafilterelement.cpp (renamed from src/imports/opcua/opcuafilterelement.cpp) | 5 | ||||
-rw-r--r-- | src/declarative_opcua/opcuafilterelement_p.h (renamed from src/imports/opcua/opcuafilterelement.h) | 23 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaforeign.cpp | 71 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaforeign_p.h | 89 | ||||
-rw-r--r-- | src/declarative_opcua/opcualiteraloperand.cpp (renamed from src/imports/opcua/opcualiteraloperand.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcualiteraloperand_p.h (renamed from src/imports/opcua/opcualiteraloperand.h) | 23 | ||||
-rw-r--r-- | src/declarative_opcua/opcuamethodargument.cpp (renamed from src/imports/opcua/opcuamethodargument.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuamethodargument_p.h (renamed from src/imports/opcua/opcuamethodargument.h) | 15 | ||||
-rw-r--r-- | src/declarative_opcua/opcuamethodnode.cpp (renamed from src/imports/opcua/opcuamethodnode.cpp) | 5 | ||||
-rw-r--r-- | src/declarative_opcua/opcuamethodnode_p.h (renamed from src/imports/opcua/opcuamethodnode.h) | 21 | ||||
-rw-r--r-- | src/declarative_opcua/opcuanode.cpp (renamed from src/imports/opcua/opcuanode.cpp) | 13 | ||||
-rw-r--r-- | src/declarative_opcua/opcuanode_p.h (renamed from src/imports/opcua/opcuanode.h) | 31 | ||||
-rw-r--r-- | src/declarative_opcua/opcuanodeid.cpp (renamed from src/imports/opcua/opcuanodeid.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuanodeid_p.h (renamed from src/imports/opcua/opcuanodeid.h) | 18 | ||||
-rw-r--r-- | src/declarative_opcua/opcuanodeidtype.cpp (renamed from src/imports/opcua/opcuanodeidtype.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuanodeidtype_p.h (renamed from src/imports/opcua/opcuanodeidtype.h) | 19 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaoperandbase.cpp (renamed from src/imports/opcua/opcuaoperandbase.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaoperandbase_p.h (renamed from src/imports/opcua/opcuaoperandbase.h) | 17 | ||||
-rw-r--r-- | src/declarative_opcua/opcuapathresolver.cpp (renamed from src/imports/opcua/opcuapathresolver.cpp) | 7 | ||||
-rw-r--r-- | src/declarative_opcua/opcuapathresolver_p.h (renamed from src/imports/opcua/opcuapathresolver.h) | 15 | ||||
-rw-r--r-- | src/declarative_opcua/opcuareaditem.cpp (renamed from src/imports/opcua/opcuareaditem.cpp) | 2 | ||||
-rw-r--r-- | src/declarative_opcua/opcuareaditem_p.h (renamed from src/imports/opcua/opcuareaditem.h) | 23 | ||||
-rw-r--r-- | src/declarative_opcua/opcuareadresult.cpp (renamed from src/imports/opcua/opcuareadresult.cpp) | 5 | ||||
-rw-r--r-- | src/declarative_opcua/opcuareadresult_p.h (renamed from src/imports/opcua/opcuareadresult.h) | 22 | ||||
-rw-r--r-- | src/declarative_opcua/opcuarelativenodeid.cpp (renamed from src/imports/opcua/opcuarelativenodeid.cpp) | 6 | ||||
-rw-r--r-- | src/declarative_opcua/opcuarelativenodeid_p.h (renamed from src/imports/opcua/opcuarelativenodeid.h) | 18 | ||||
-rw-r--r-- | src/declarative_opcua/opcuarelativenodepath.cpp (renamed from src/imports/opcua/opcuarelativenodepath.cpp) | 7 | ||||
-rw-r--r-- | src/declarative_opcua/opcuarelativenodepath_p.h (renamed from src/imports/opcua/opcuarelativenodepath.h) | 19 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaserverdiscovery.cpp (renamed from src/imports/opcua/opcuaserverdiscovery.cpp) | 4 | ||||
-rw-r--r-- | src/declarative_opcua/opcuaserverdiscovery_p.h (renamed from src/imports/opcua/opcuaserverdiscovery.h) | 25 | ||||
-rw-r--r-- | src/declarative_opcua/opcuasimpleattributeoperand.cpp (renamed from src/imports/opcua/opcuasimpleattributeoperand.cpp) | 7 | ||||
-rw-r--r-- | src/declarative_opcua/opcuasimpleattributeoperand_p.h (renamed from src/imports/opcua/opcuasimpleattributeoperand.h) | 24 | ||||
-rw-r--r-- | src/declarative_opcua/opcuastatus.cpp (renamed from src/imports/opcua/opcuastatus.cpp) | 4 | ||||
-rw-r--r-- | src/declarative_opcua/opcuastatus_p.h (renamed from src/imports/opcua/opcuastatus.h) | 32 | ||||
-rw-r--r-- | src/declarative_opcua/opcuavaluenode.cpp (renamed from src/imports/opcua/opcuavaluenode.cpp) | 9 | ||||
-rw-r--r-- | src/declarative_opcua/opcuavaluenode_p.h (renamed from src/imports/opcua/opcuavaluenode.h) | 19 | ||||
-rw-r--r-- | src/declarative_opcua/opcuawriteitem.cpp (renamed from src/imports/opcua/opcuawriteitem.cpp) | 5 | ||||
-rw-r--r-- | src/declarative_opcua/opcuawriteitem_p.h (renamed from src/imports/opcua/opcuawriteitem.h) | 29 | ||||
-rw-r--r-- | src/declarative_opcua/opcuawriteresult.cpp (renamed from src/imports/opcua/opcuawriteresult.cpp) | 5 | ||||
-rw-r--r-- | src/declarative_opcua/opcuawriteresult_p.h (renamed from src/imports/opcua/opcuawriteresult.h) | 22 | ||||
-rw-r--r-- | src/declarative_opcua/universalnode.cpp (renamed from src/imports/opcua/universalnode.cpp) | 7 | ||||
-rw-r--r-- | src/declarative_opcua/universalnode_p.h (renamed from src/imports/opcua/universalnode.h) | 11 | ||||
-rw-r--r-- | src/imports/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/imports/doc/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/imports/opcua/CMakeLists.txt | 51 | ||||
-rw-r--r-- | src/imports/opcua/opcua_plugin.cpp | 172 | ||||
-rw-r--r-- | src/imports/opcua/opcua_plugin.h | 52 | ||||
-rw-r--r-- | src/imports/opcua/plugins.qmltypes | 590 | ||||
-rw-r--r-- | src/opcua/client/qopcuatype.h | 1 | ||||
-rw-r--r-- | src/opcua/doc/qtopcua.qdocconf | 4 | ||||
-rw-r--r-- | sync.profile | 1 |
74 files changed, 792 insertions, 1027 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a591d66..ed8b148 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,5 @@ -# Generated from src.pro. - add_subdirectory(opcua) add_subdirectory(plugins) if(TARGET Qt::Quick) - add_subdirectory(imports) + add_subdirectory(declarative_opcua) endif() diff --git a/src/declarative_opcua/CMakeLists.txt b/src/declarative_opcua/CMakeLists.txt new file mode 100644 index 0000000..1fd00ba --- /dev/null +++ b/src/declarative_opcua/CMakeLists.txt @@ -0,0 +1,45 @@ +qt_internal_add_qml_module(DeclarativeOpcua + URI "QtOpcUa" + VERSION "${PROJECT_VERSION}" + PAST_MAJOR_VERSIONS 1 5 + DEPENDENCIES + QtQuick + SOURCES + opcuaattributecache.cpp opcuaattributecache_p.h + opcuaattributeoperand.cpp opcuaattributeoperand_p.h + opcuaattributevalue.cpp opcuaattributevalue_p.h + opcuaconnection.cpp opcuaconnection_p.h + opcuadatachangefilter.cpp opcuadatachangefilter_p.h + opcuaelementoperand.cpp opcuaelementoperand_p.h + opcuaendpointdiscovery.cpp opcuaendpointdiscovery_p.h + opcuaeventfilter.cpp opcuaeventfilter_p.h + opcuafilterelement.cpp opcuafilterelement_p.h + opcuaforeign.cpp opcuaforeign_p.h + opcualiteraloperand.cpp opcualiteraloperand_p.h + opcuamethodargument.cpp opcuamethodargument_p.h + opcuamethodnode.cpp opcuamethodnode_p.h + opcuanode.cpp opcuanode_p.h + opcuanodeid.cpp opcuanodeid_p.h + opcuanodeidtype.cpp opcuanodeidtype_p.h + opcuaoperandbase.cpp opcuaoperandbase_p.h + opcuapathresolver.cpp opcuapathresolver_p.h + opcuareaditem.cpp opcuareaditem_p.h + opcuareadresult.cpp opcuareadresult_p.h + opcuarelativenodeid.cpp opcuarelativenodeid_p.h + opcuarelativenodepath.cpp opcuarelativenodepath_p.h + opcuaserverdiscovery.cpp opcuaserverdiscovery_p.h + opcuasimpleattributeoperand.cpp opcuasimpleattributeoperand_p.h + opcuastatus.cpp opcuastatus_p.h + opcuavaluenode.cpp opcuavaluenode_p.h + opcuawriteitem.cpp opcuawriteitem_p.h + opcuawriteresult.cpp opcuawriteresult_p.h + universalnode.cpp universalnode_p.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::OpcUa + Qt::Quick +) + +# The file contains Q_OBJECT in a comment +set_property(SOURCE opcuaconnection.cpp PROPERTY SKIP_AUTOMOC ON) diff --git a/src/imports/doc/snippets/basic/basic.pro b/src/declarative_opcua/doc/snippets/basic/basic.pro index 20d4aa6..20d4aa6 100644 --- a/src/imports/doc/snippets/basic/basic.pro +++ b/src/declarative_opcua/doc/snippets/basic/basic.pro diff --git a/src/imports/doc/snippets/basic/basic.qml b/src/declarative_opcua/doc/snippets/basic/basic.qml index da3c59c..da3c59c 100644 --- a/src/imports/doc/snippets/basic/basic.qml +++ b/src/declarative_opcua/doc/snippets/basic/basic.qml diff --git a/src/imports/doc/snippets/basic/main.cpp b/src/declarative_opcua/doc/snippets/basic/main.cpp index ca94f96..ca94f96 100644 --- a/src/imports/doc/snippets/basic/main.cpp +++ b/src/declarative_opcua/doc/snippets/basic/main.cpp diff --git a/src/imports/doc/snippets/basic/qml.qrc b/src/declarative_opcua/doc/snippets/basic/qml.qrc index 8aa548d..8aa548d 100644 --- a/src/imports/doc/snippets/basic/qml.qrc +++ b/src/declarative_opcua/doc/snippets/basic/qml.qrc diff --git a/src/imports/doc/snippets/snippets.pro b/src/declarative_opcua/doc/snippets/snippets.pro index 34f621e..34f621e 100644 --- a/src/imports/doc/snippets/snippets.pro +++ b/src/declarative_opcua/doc/snippets/snippets.pro diff --git a/src/imports/opcua/opcuaattributecache.cpp b/src/declarative_opcua/opcuaattributecache.cpp index b57acc8..831283d 100644 --- a/src/imports/opcua/opcuaattributecache.cpp +++ b/src/declarative_opcua/opcuaattributecache.cpp @@ -34,8 +34,8 @@ ** ****************************************************************************/ -#include "opcuaattributecache.h" -#include "opcuaattributevalue.h" +#include <private/opcuaattributecache_p.h> +#include <private/opcuaattributevalue_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuaattributecache.h b/src/declarative_opcua/opcuaattributecache_p.h index f9a761b..67ec246 100644 --- a/src/imports/opcua/opcuaattributecache.h +++ b/src/declarative_opcua/opcuaattributecache_p.h @@ -39,6 +39,18 @@ #include "qopcuatype.h" #include <QObject> +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + + QT_BEGIN_NAMESPACE class OpcUaAttributeValue; diff --git a/src/imports/opcua/opcuaattributeoperand.cpp b/src/declarative_opcua/opcuaattributeoperand.cpp index 44768fe..1c767bb 100644 --- a/src/imports/opcua/opcuaattributeoperand.cpp +++ b/src/declarative_opcua/opcuaattributeoperand.cpp @@ -34,10 +34,10 @@ ** ****************************************************************************/ -#include "opcuaattributeoperand.h" -#include "opcuanodeid.h" -#include "universalnode.h" -#include "opcuarelativenodepath.h" +#include <private/opcuaattributeoperand_p.h> +#include <private/opcuanodeid_p.h> +#include <private/universalnode_p.h> +#include <private/opcuarelativenodepath_p.h> #include <QOpcUaRelativePathElement> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuaattributeoperand.h b/src/declarative_opcua/opcuaattributeoperand_p.h index 1fd16c6..3763ffe 100644 --- a/src/imports/opcua/opcuaattributeoperand.h +++ b/src/declarative_opcua/opcuaattributeoperand_p.h @@ -34,14 +34,27 @@ ** ****************************************************************************/ -#ifndef OPCUAATTRIBUTEOPERAND -#define OPCUAATTRIBUTEOPERAND +#ifndef OPCUAATTRIBUTEOPERAND_P_H +#define OPCUAATTRIBUTEOPERAND_P_H + +#include <private/opcuaoperandbase_p.h> +#include <private/opcuanodeid_p.h> -#include "opcuaoperandbase.h" #include <QOpcUaAttributeOperand> -#include "opcuanodeid.h" #include <QQmlListProperty> #include <QList> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -56,6 +69,9 @@ class OpcUaAttributeOperand : public OpcUaOperandBase, private QOpcUaAttributeOp Q_PROPERTY(OpcUaNodeId* typeId READ typeId WRITE setTypeId) Q_PROPERTY(QString alias READ alias WRITE setAlias) + QML_NAMED_ELEMENT(AttributeOperand) + QML_ADDED_IN_VERSION(5, 13) + public: explicit OpcUaAttributeOperand(QObject *parent = nullptr); ~OpcUaAttributeOperand(); @@ -94,4 +110,4 @@ private: QT_END_NAMESPACE -#endif // OPCUASIMPLEATTRIBUTEOPERAND +#endif // OPCUASIMPLEATTRIBUTEOPERAND_P_H diff --git a/src/imports/opcua/opcuaattributevalue.cpp b/src/declarative_opcua/opcuaattributevalue.cpp index c93f55e..a43e9ac 100644 --- a/src/imports/opcua/opcuaattributevalue.cpp +++ b/src/declarative_opcua/opcuaattributevalue.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuaattributevalue.h" +#include <private/opcuaattributevalue_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuaattributevalue.h b/src/declarative_opcua/opcuaattributevalue_p.h index a3c073c..6b4890c 100644 --- a/src/imports/opcua/opcuaattributevalue.h +++ b/src/declarative_opcua/opcuaattributevalue_p.h @@ -39,6 +39,17 @@ #include <QObject> #include <QVariant> +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + QT_BEGIN_NAMESPACE class OpcUaAttributeValue : public QObject diff --git a/src/imports/opcua/opcuaconnection.cpp b/src/declarative_opcua/opcuaconnection.cpp index e0f7a93..6f250bc 100644 --- a/src/imports/opcua/opcuaconnection.cpp +++ b/src/declarative_opcua/opcuaconnection.cpp @@ -34,11 +34,12 @@ ** ****************************************************************************/ -#include "opcuaconnection.h" -#include "opcuareadresult.h" -#include "opcuawriteitem.h" -#include "opcuawriteresult.h" -#include "universalnode.h" +#include <private/opcuaconnection_p.h> +#include <private/opcuareadresult_p.h> +#include <private/opcuawriteitem_p.h> +#include <private/opcuawriteresult_p.h> +#include <private/universalnode_p.h> + #include <QJSEngine> #include <QLoggingCategory> #include <QOpcUaProvider> diff --git a/src/imports/opcua/opcuaconnection.h b/src/declarative_opcua/opcuaconnection_p.h index db06594..ea1cfc0 100644 --- a/src/imports/opcua/opcuaconnection.h +++ b/src/declarative_opcua/opcuaconnection_p.h @@ -36,12 +36,26 @@ #pragma once -#include "opcuareaditem.h" +#include <private/opcuareaditem_p.h> +#include <private/opcuaserverdiscovery_p.h> + #include <QJSValue> #include <QObject> #include <QOpcUaClient> #include <QOpcUaAuthenticationInformation> -#include "opcuaserverdiscovery.h" + +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -62,6 +76,8 @@ class OpcUaConnection : public QObject Q_PROPERTY(QJSValue supportedUserTokenTypes READ supportedUserTokenTypes CONSTANT) Q_PROPERTY(QOpcUaEndpointDescription currentEndpoint READ currentEndpoint) Q_PROPERTY(QOpcUaClient* connection READ connection WRITE setConnection NOTIFY connectionChanged) + QML_NAMED_ELEMENT(Connection) + QML_ADDED_IN_VERSION(5, 12) public: OpcUaConnection(QObject *parent = nullptr); diff --git a/src/imports/opcua/opcuadatachangefilter.cpp b/src/declarative_opcua/opcuadatachangefilter.cpp index fb06839..11ca906 100644 --- a/src/imports/opcua/opcuadatachangefilter.cpp +++ b/src/declarative_opcua/opcuadatachangefilter.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuadatachangefilter.h" +#include <private/opcuadatachangefilter_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuadatachangefilter.h b/src/declarative_opcua/opcuadatachangefilter_p.h index 753c0f6..1595fd1 100644 --- a/src/imports/opcua/opcuadatachangefilter.h +++ b/src/declarative_opcua/opcuadatachangefilter_p.h @@ -34,10 +34,22 @@ ** ****************************************************************************/ -#ifndef OPCUADATACHANGEFILTER -#define OPCUADATACHANGEFILTER +#ifndef OPCUADATACHANGEFILTER_P_H +#define OPCUADATACHANGEFILTER_P_H #include <QOpcUaMonitoringParameters> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -47,6 +59,9 @@ class OpcUaDataChangeFilter : public QObject { Q_PROPERTY(DeadbandType deadbandType READ deadbandType WRITE setDeadbandType) Q_PROPERTY(double deadbandValue READ deadbandValue WRITE setDeadbandValue) + QML_NAMED_ELEMENT(DataChangeFilter) + QML_ADDED_IN_VERSION(5, 13) + public: // Same as in QOpcUaMonitoringParameters::DataChangeFilter::DataChangeTrigger enum class DataChangeTrigger { @@ -90,4 +105,4 @@ private: QT_END_NAMESPACE -#endif // OPCUADATACHANGEFILTER +#endif // OPCUADATACHANGEFILTER_P_H diff --git a/src/imports/opcua/opcuaelementoperand.cpp b/src/declarative_opcua/opcuaelementoperand.cpp index b499f62..1033bd9 100644 --- a/src/imports/opcua/opcuaelementoperand.cpp +++ b/src/declarative_opcua/opcuaelementoperand.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuaelementoperand.h" +#include <private/opcuaelementoperand_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuaelementoperand.h b/src/declarative_opcua/opcuaelementoperand_p.h index 33c442c..fdd7bac 100644 --- a/src/imports/opcua/opcuaelementoperand.h +++ b/src/declarative_opcua/opcuaelementoperand_p.h @@ -34,11 +34,23 @@ ** ****************************************************************************/ -#ifndef OPCUAELEMENTOPERAND -#define OPCUAELEMENTOPERAND +#ifndef OPCUAELEMENTOPERAND_P_H +#define OPCUAELEMENTOPERAND_P_H -#include "opcuaoperandbase.h" +#include <private/opcuaoperandbase_p.h> #include <QOpcUaElementOperand> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -47,6 +59,8 @@ class QOpcUaClient; class OpcUaElementOperand : public OpcUaOperandBase, private QOpcUaElementOperand { Q_OBJECT Q_PROPERTY(quint32 index READ index WRITE setIndex) + QML_NAMED_ELEMENT(ElementOperand) + QML_ADDED_IN_VERSION(5, 13) public: explicit OpcUaElementOperand(QObject *parent = nullptr); @@ -62,4 +76,4 @@ signals: QT_END_NAMESPACE -#endif // OPCUAELEMENTOPERAND +#endif // OPCUAELEMENTOPERAND_P_H diff --git a/src/imports/opcua/opcuaendpointdiscovery.cpp b/src/declarative_opcua/opcuaendpointdiscovery.cpp index 4270364..d639862 100644 --- a/src/imports/opcua/opcuaendpointdiscovery.cpp +++ b/src/declarative_opcua/opcuaendpointdiscovery.cpp @@ -34,8 +34,8 @@ ** ****************************************************************************/ -#include "opcuaendpointdiscovery.h" -#include "opcuaconnection.h" +#include <private/opcuaendpointdiscovery_p.h> +#include <private/opcuaconnection_p.h> QT_BEGIN_NAMESPACE @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE Allows to fetch and access information about available endpoints on a server. - \snippet ../../src/imports/doc/snippets/basic/basic.qml Basic discovery + \snippet ../../src/declarative_opcua/doc/snippets/basic/basic.qml Basic discovery */ /*! diff --git a/src/imports/opcua/opcuaendpointdiscovery.h b/src/declarative_opcua/opcuaendpointdiscovery_p.h index 9dcf336..d8cf718 100644 --- a/src/imports/opcua/opcuaendpointdiscovery.h +++ b/src/declarative_opcua/opcuaendpointdiscovery_p.h @@ -34,11 +34,11 @@ ** ****************************************************************************/ -#ifndef OPCUAENDPOINTDISCOVERY_H -#define OPCUAENDPOINTDISCOVERY_H +#ifndef OPCUAENDPOINTDISCOVERY_P_H +#define OPCUAENDPOINTDISCOVERY_P_H -#include "opcuaconnection.h" -#include "opcuastatus.h" +#include <private/opcuaconnection_p.h> +#include <private/opcuastatus_p.h> #include <QtOpcUa/qopcuatype.h> #include <QOpcUaEndpointDescription> @@ -47,6 +47,19 @@ #include <QObject> #include <QList> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + QT_BEGIN_NAMESPACE class OpcUaEndpointDiscovery : public QObject, public QQmlParserStatus @@ -58,6 +71,9 @@ class OpcUaEndpointDiscovery : public QObject, public QQmlParserStatus Q_PROPERTY(OpcUaConnection* connection READ connection WRITE setConnection NOTIFY connectionChanged) Q_INTERFACES(QQmlParserStatus) + QML_NAMED_ELEMENT(EndpointDiscovery) + QML_ADDED_IN_VERSION(5, 13) + public: OpcUaEndpointDiscovery(QObject *parent = nullptr); ~OpcUaEndpointDiscovery(); @@ -97,4 +113,4 @@ private: QT_END_NAMESPACE -#endif // OPCUAENDPOINTDISCOVERY_H +#endif // OPCUAENDPOINTDISCOVERY_P_H diff --git a/src/imports/opcua/opcuaeventfilter.cpp b/src/declarative_opcua/opcuaeventfilter.cpp index 982efd1..fb7e056 100644 --- a/src/imports/opcua/opcuaeventfilter.cpp +++ b/src/declarative_opcua/opcuaeventfilter.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuaeventfilter.h" +#include <private/opcuaeventfilter_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuaeventfilter.h b/src/declarative_opcua/opcuaeventfilter_p.h index 631647e..90506a7 100644 --- a/src/imports/opcua/opcuaeventfilter.h +++ b/src/declarative_opcua/opcuaeventfilter_p.h @@ -34,15 +34,28 @@ ** ****************************************************************************/ -#ifndef OPCUAEVENTFILTER -#define OPCUAEVENTFILTER +#ifndef OPCUAEVENTFILTER_P_H +#define OPCUAEVENTFILTER_P_H #include <QQmlListProperty> -#include "opcuasimpleattributeoperand.h" -#include "opcuafilterelement.h" +#include <private/opcuasimpleattributeoperand_p.h> +#include <private/opcuafilterelement_p.h> + #include <QOpcUaMonitoringParameters> #include <QList> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -54,6 +67,9 @@ class OpcUaEventFilter : public QObject { Q_PROPERTY(QQmlListProperty<OpcUaFilterElement> where READ filterElements) Q_PROPERTY(QQmlListProperty<OpcUaSimpleAttributeOperand> select READ selectors) + QML_NAMED_ELEMENT(EventFilter) + QML_ADDED_IN_VERSION(5, 13) + public: explicit OpcUaEventFilter(QObject *parent = nullptr); ~OpcUaEventFilter(); @@ -92,4 +108,4 @@ private: QT_END_NAMESPACE -#endif // OPCUAEVENTFILTER +#endif // OPCUAEVENTFILTER_P_H diff --git a/src/imports/opcua/opcuafilterelement.cpp b/src/declarative_opcua/opcuafilterelement.cpp index 827bd85..ec58cac 100644 --- a/src/imports/opcua/opcuafilterelement.cpp +++ b/src/declarative_opcua/opcuafilterelement.cpp @@ -34,9 +34,8 @@ ** ****************************************************************************/ -#include "opcuafilterelement.h" - -#include "opcuaoperandbase.h" +#include <private/opcuafilterelement_p.h> +#include <private/opcuaoperandbase_p.h> #include <QOpcUaContentFilterElement> #include <QLoggingCategory> diff --git a/src/imports/opcua/opcuafilterelement.h b/src/declarative_opcua/opcuafilterelement_p.h index 5fddcf2..8b431c4 100644 --- a/src/imports/opcua/opcuafilterelement.h +++ b/src/declarative_opcua/opcuafilterelement_p.h @@ -34,14 +34,26 @@ ** ****************************************************************************/ -#ifndef OPCUAFILTERELEMENT -#define OPCUAFILTERELEMENT +#ifndef OPCUAFILTERELEMENT_P_H +#define OPCUAFILTERELEMENT_P_H -#include "opcuaoperandbase.h" +#include <private/opcuaoperandbase_p.h> #include <QOpcUaContentFilterElement> #include <QObject> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -53,6 +65,9 @@ class OpcUaFilterElement : public QObject { Q_PROPERTY(OpcUaOperandBase* firstOperand READ firstOperand WRITE setFirstOperand) Q_PROPERTY(OpcUaOperandBase* secondOperand READ secondOperand WRITE setSecondOperand) + QML_NAMED_ELEMENT(FilterElement) + QML_ADDED_IN_VERSION(5, 13) + public: // Same as in qopcuacontentfilterelement.h // Specified in OPC-UA part 4, Tables 115 and 116 @@ -102,4 +117,4 @@ private: QT_END_NAMESPACE -#endif // OPCUAFILTERELEMENT +#endif // OPCUAFILTERELEMENT_P_H diff --git a/src/declarative_opcua/opcuaforeign.cpp b/src/declarative_opcua/opcuaforeign.cpp new file mode 100644 index 0000000..3043431 --- /dev/null +++ b/src/declarative_opcua/opcuaforeign.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt OPC UA module. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "opcuaforeign_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \qmlproperty enumeration Constants::NodeAttribute + + Attributes of a node + + \value Constants.NodeAttribute.NodeId + \value Constants.NodeAttribute.NodeClass + \value Constants.NodeAttribute.BrowseName + \value Constants.NodeAttribute.DisplayName + \value Constants.NodeAttribute.Description + \value Constants.NodeAttribute.WriteMask + \value Constants.NodeAttribute.UserWriteMask + \value Constants.NodeAttribute.IsAbstract + \value Constants.NodeAttribute.Symmetric + \value Constants.NodeAttribute.InverseName + \value Constants.NodeAttribute.ContainsNoLoops + \value Constants.NodeAttribute.EventNotifier + \value Constants.NodeAttribute.Value + \value Constants.NodeAttribute.DataType + \value Constants.NodeAttribute.ValueRank + \value Constants.NodeAttribute.ArrayDimensions + \value Constants.NodeAttribute.AccessLevel + \value Constants.NodeAttribute.UserAccessLevel + \value Constants.NodeAttribute.MinimumSamplingInterval + \value Constants.NodeAttribute.Historizing + \value Constants.NodeAttribute.Executable + \value Constants.NodeAttribute.UserExecutable +*/ + +QT_END_NAMESPACE diff --git a/src/declarative_opcua/opcuaforeign_p.h b/src/declarative_opcua/opcuaforeign_p.h new file mode 100644 index 0000000..b04b4cf --- /dev/null +++ b/src/declarative_opcua/opcuaforeign_p.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt OPC UA module. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OPCUAFOREIGN_P_H +#define OPCUAFOREIGN_P_H + +#include <QLoggingCategory> +#include <qqml.h> +#include <QtOpcUa/qopcuatype.h> +#include <QtOpcUa/qopcuausertokenpolicy.h> +#include <QtOpcUa/qopcuaapplicationdescription.h> +#include <QtOpcUa/qopcuausertokenpolicy.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE + +namespace Constants +{ + Q_NAMESPACE + QML_FOREIGN_NAMESPACE(QOpcUa) + QML_NAMESPACE_EXTENDED(QOpcUaUserTokenPolicy) + QML_ELEMENT + QML_ADDED_IN_VERSION(5, 12) +}; + +namespace QOpcUaApplicationDescriptionForeign +{ + Q_NAMESPACE + QML_FOREIGN_NAMESPACE(QOpcUaApplicationDescription) + QML_NAMED_ELEMENT(ApplicationDescription) + QML_UNCREATABLE("This type can not be created.") + QML_ADDED_IN_VERSION(5, 13) +}; + +namespace QOpcUaUserTokenPolicyForeign +{ + Q_NAMESPACE + QML_FOREIGN_NAMESPACE(QOpcUaUserTokenPolicy) + QML_NAMED_ELEMENT(UserTokenPolicy) + QML_UNCREATABLE("This type can not be created.") + QML_ADDED_IN_VERSION(5, 13) +}; + +QT_END_NAMESPACE + +#endif // OPCUAFOREIGN_P_H diff --git a/src/imports/opcua/opcualiteraloperand.cpp b/src/declarative_opcua/opcualiteraloperand.cpp index eb79a53..3816b40 100644 --- a/src/imports/opcua/opcualiteraloperand.cpp +++ b/src/declarative_opcua/opcualiteraloperand.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcualiteraloperand.h" +#include <private/opcualiteraloperand_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcualiteraloperand.h b/src/declarative_opcua/opcualiteraloperand_p.h index b08dfd7..85a6106 100644 --- a/src/imports/opcua/opcualiteraloperand.h +++ b/src/declarative_opcua/opcualiteraloperand_p.h @@ -34,12 +34,25 @@ ** ****************************************************************************/ -#ifndef OPCUALITERALOPERAND -#define OPCUALITERALOPERAND +#ifndef OPCUALITERALOPERAND_P_H +#define OPCUALITERALOPERAND_P_H + +#include <private/opcuaoperandbase_p.h> -#include "opcuaoperandbase.h" #include <QOpcUaLiteralOperand> #include <qopcuatype.h> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -47,6 +60,8 @@ class OpcUaLiteralOperand : public OpcUaOperandBase { Q_OBJECT Q_PROPERTY(QVariant value READ value WRITE setValue) Q_PROPERTY(QOpcUa::Types type READ type WRITE setType) + QML_NAMED_ELEMENT(LiteralOperand) + QML_ADDED_IN_VERSION(5, 13) public: explicit OpcUaLiteralOperand(QObject *parent = nullptr); @@ -69,4 +84,4 @@ private: QT_END_NAMESPACE -#endif // OPCUALITERALOPERAND +#endif // OPCUALITERALOPERAND_P_H diff --git a/src/imports/opcua/opcuamethodargument.cpp b/src/declarative_opcua/opcuamethodargument.cpp index 233a771..7a45fcc 100644 --- a/src/imports/opcua/opcuamethodargument.cpp +++ b/src/declarative_opcua/opcuamethodargument.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuamethodargument.h" +#include <private/opcuamethodargument_p.h> /*! \qmltype MethodArgument diff --git a/src/imports/opcua/opcuamethodargument.h b/src/declarative_opcua/opcuamethodargument_p.h index 9d931bf..364cacf 100644 --- a/src/imports/opcua/opcuamethodargument.h +++ b/src/declarative_opcua/opcuamethodargument_p.h @@ -38,6 +38,18 @@ #include "qopcuatype.h" #include <QObject> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -47,6 +59,9 @@ class OpcUaMethodArgument : public QObject Q_PROPERTY(QVariant value READ value WRITE setValue) Q_PROPERTY(QOpcUa::Types type READ type WRITE setType) + QML_NAMED_ELEMENT(MethodArgument) + QML_ADDED_IN_VERSION(5, 13) + public: explicit OpcUaMethodArgument(QObject *parent = nullptr); QVariant value() const; diff --git a/src/imports/opcua/opcuamethodnode.cpp b/src/declarative_opcua/opcuamethodnode.cpp index 61a320e..e03d6ce 100644 --- a/src/imports/opcua/opcuamethodnode.cpp +++ b/src/declarative_opcua/opcuamethodnode.cpp @@ -34,8 +34,9 @@ ** ****************************************************************************/ -#include "opcuamethodnode.h" -#include "opcuanodeidtype.h" +#include <private/opcuamethodnode_p.h> +#include <private/opcuanodeidtype_p.h> + #include <QOpcUaNode> #include <QLoggingCategory> diff --git a/src/imports/opcua/opcuamethodnode.h b/src/declarative_opcua/opcuamethodnode_p.h index faffb53..36f8174 100644 --- a/src/imports/opcua/opcuamethodnode.h +++ b/src/declarative_opcua/opcuamethodnode_p.h @@ -36,12 +36,24 @@ #pragma once -#include "opcuanode.h" -#include "opcuamethodargument.h" -#include "opcuastatus.h" +#include <private/opcuanode_p.h> +#include <private/opcuamethodargument_p.h> +#include <private/opcuastatus_p.h> + #include <QQmlListProperty> #include <QList> +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + QT_BEGIN_NAMESPACE class OpcUaNodeIdType; @@ -54,6 +66,9 @@ class OpcUaMethodNode : public OpcUaNode Q_PROPERTY(QVariantList outputArguments READ outputArguments NOTIFY outputArgumentsChanged) Q_PROPERTY(OpcUaStatus resultStatus READ resultStatus NOTIFY resultStatusChanged) + QML_NAMED_ELEMENT(MethodNode) + QML_ADDED_IN_VERSION(5, 12) + public: OpcUaMethodNode(QObject *parent = nullptr); OpcUaNodeIdType *objectNodeId() const; diff --git a/src/imports/opcua/opcuanode.cpp b/src/declarative_opcua/opcuanode.cpp index 73cdc7c..b79cbb8 100644 --- a/src/imports/opcua/opcuanode.cpp +++ b/src/declarative_opcua/opcuanode.cpp @@ -34,11 +34,12 @@ ** ****************************************************************************/ -#include "opcuanode.h" -#include "opcuarelativenodepath.h" -#include "opcuarelativenodeid.h" -#include "opcuapathresolver.h" -#include "opcuaattributevalue.h" +#include <private/opcuanode_p.h> +#include <private/opcuarelativenodepath_p.h> +#include <private/opcuarelativenodeid_p.h> +#include <private/opcuapathresolver_p.h> +#include <private/opcuaattributevalue_p.h> + #include <qopcuatype.h> #include <QOpcUaNode> #include <QOpcUaClient> @@ -177,7 +178,7 @@ QT_BEGIN_NAMESPACE \sa EventFilter */ -Q_DECLARE_LOGGING_CATEGORY(QT_OPCUA_PLUGINS_QML) +Q_LOGGING_CATEGORY(QT_OPCUA_PLUGINS_QML, "qt.opcua.plugins.qml") OpcUaNode::OpcUaNode(QObject *parent): QObject(parent), diff --git a/src/imports/opcua/opcuanode.h b/src/declarative_opcua/opcuanode_p.h index 4f03109..d858ffa 100644 --- a/src/imports/opcua/opcuanode.h +++ b/src/declarative_opcua/opcuanode_p.h @@ -36,17 +36,31 @@ #pragma once -#include "opcuaconnection.h" -#include "opcuanodeid.h" -#include "universalnode.h" -#include "opcuaattributecache.h" -#include "qopcualocalizedtext.h" -#include "opcuaeventfilter.h" -#include "opcuanodeidtype.h" +#include <private/opcuaconnection_p.h> +#include <private/opcuanodeid_p.h> +#include <private/universalnode_p.h> +#include <private/opcuaattributecache_p.h> +#include <private/opcuaeventfilter_p.h> +#include <private/opcuanodeidtype_p.h> + +#include <QtOpcUa/qopcualocalizedtext.h> #include <QDateTime> #include <QObject> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + QT_BEGIN_NAMESPACE class OpcUaNode : public QObject @@ -70,6 +84,9 @@ class OpcUaNode : public QObject Q_ENUM(QOpcUa::NodeClass); + QML_NAMED_ELEMENT(Node) + QML_ADDED_IN_VERSION(5, 12) + public: enum class Status { Valid, diff --git a/src/imports/opcua/opcuanodeid.cpp b/src/declarative_opcua/opcuanodeid.cpp index b34f4c8..93a2c3b 100644 --- a/src/imports/opcua/opcuanodeid.cpp +++ b/src/declarative_opcua/opcuanodeid.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuanodeid.h" +#include <private/opcuanodeid_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuanodeid.h b/src/declarative_opcua/opcuanodeid_p.h index 63078f9..3b60069 100644 --- a/src/imports/opcua/opcuanodeid.h +++ b/src/declarative_opcua/opcuanodeid_p.h @@ -36,7 +36,20 @@ #pragma once -#include "opcuanodeidtype.h" +#include <private/opcuanodeidtype_p.h> + +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -46,6 +59,9 @@ class OpcUaNodeId : public OpcUaNodeIdType Q_PROPERTY(QString ns READ nodeNamespace WRITE setNodeNamespace NOTIFY nodeNamespaceChanged) Q_PROPERTY(QString identifier READ identifier WRITE setIdentifier NOTIFY identifierChanged) + QML_NAMED_ELEMENT(NodeId) + QML_ADDED_IN_VERSION(5, 12) + public: OpcUaNodeId(QObject *parent = nullptr); diff --git a/src/imports/opcua/opcuanodeidtype.cpp b/src/declarative_opcua/opcuanodeidtype.cpp index 5511581..7652433 100644 --- a/src/imports/opcua/opcuanodeidtype.cpp +++ b/src/declarative_opcua/opcuanodeidtype.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuanodeidtype.h" +#include <private/opcuanodeidtype_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuanodeidtype.h b/src/declarative_opcua/opcuanodeidtype_p.h index 883edf2..9006856 100644 --- a/src/imports/opcua/opcuanodeidtype.h +++ b/src/declarative_opcua/opcuanodeidtype_p.h @@ -36,8 +36,21 @@ #pragma once +#include <private/universalnode_p.h> + #include <QObject> -#include "universalnode.h" +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -45,6 +58,10 @@ class OpcUaNodeIdType : public QObject { Q_OBJECT + QML_NAMED_ELEMENT(NodeIdType) + QML_ADDED_IN_VERSION(5, 12) + QML_UNCREATABLE("The type 'NodeIdType' is not creatable. " + "Use 'NodeId' or 'RelativeNodeId' instead.") public: /* These functions are not exposed to QML intentionally. The reason is that some derived QML types have to prohibit access to some of these functions. diff --git a/src/imports/opcua/opcuaoperandbase.cpp b/src/declarative_opcua/opcuaoperandbase.cpp index 967610e..42d9bfe 100644 --- a/src/imports/opcua/opcuaoperandbase.cpp +++ b/src/declarative_opcua/opcuaoperandbase.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuaoperandbase.h" +#include <private/opcuaoperandbase_p.h> #include <QLoggingCategory> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuaoperandbase.h b/src/declarative_opcua/opcuaoperandbase_p.h index 5e6bd38..181c5c3 100644 --- a/src/imports/opcua/opcuaoperandbase.h +++ b/src/declarative_opcua/opcuaoperandbase_p.h @@ -34,12 +34,23 @@ ** ****************************************************************************/ -#ifndef OPCUAOPERANDBASE -#define OPCUAOPERANDBASE +#ifndef OPCUAOPERANDBASE_P_H +#define OPCUAOPERANDBASE_P_H #include <QObject> #include <QVariant> +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + QT_BEGIN_NAMESPACE class QOpcUaClient; @@ -56,4 +67,4 @@ public: QT_END_NAMESPACE -#endif // OPCUAOPERANDBASE +#endif // OPCUAOPERANDBASE_P_H diff --git a/src/imports/opcua/opcuapathresolver.cpp b/src/declarative_opcua/opcuapathresolver.cpp index 068df80..b613e79 100644 --- a/src/imports/opcua/opcuapathresolver.cpp +++ b/src/declarative_opcua/opcuapathresolver.cpp @@ -34,9 +34,10 @@ ** ****************************************************************************/ -#include "opcuapathresolver.h" -#include "opcuarelativenodeid.h" -#include "opcuarelativenodepath.h" +#include <private/opcuapathresolver_p.h> +#include <private/opcuarelativenodeid_p.h> +#include <private/opcuarelativenodepath_p.h> + #include <QOpcUaClient> #include <QMetaEnum> #include <QLoggingCategory> diff --git a/src/imports/opcua/opcuapathresolver.h b/src/declarative_opcua/opcuapathresolver_p.h index 67039e5..b41692f 100644 --- a/src/imports/opcua/opcuapathresolver.h +++ b/src/declarative_opcua/opcuapathresolver_p.h @@ -36,13 +36,26 @@ #pragma once +#include <private/universalnode_p.h> + #include <QObject> #include <QPointer> + #include "qopcuatype.h" -#include "universalnode.h" #include "qopcuabrowsepathtarget.h" #include "qopcuarelativepathelement.h" +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + QT_BEGIN_NAMESPACE class QOpcUaNode; diff --git a/src/imports/opcua/opcuareaditem.cpp b/src/declarative_opcua/opcuareaditem.cpp index fc1b2b8..c76bcf8 100644 --- a/src/imports/opcua/opcuareaditem.cpp +++ b/src/declarative_opcua/opcuareaditem.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuareaditem.h" +#include <opcuareaditem_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuareaditem.h b/src/declarative_opcua/opcuareaditem_p.h index 48c399b..2475993 100644 --- a/src/imports/opcua/opcuareaditem.h +++ b/src/declarative_opcua/opcuareaditem_p.h @@ -34,13 +34,26 @@ ** ****************************************************************************/ -#ifndef OPCUAREADITEM_H -#define OPCUAREADITEM_H +#ifndef OPCUAREADITEM_P_H +#define OPCUAREADITEM_P_H #include <QObject> #include <QtCore/qshareddata.h> #include "qopcuatype.h" +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + QT_BEGIN_NAMESPACE class OpcUaReadItemData; @@ -77,10 +90,14 @@ private: class OpcUaReadItemFactory : public QObject { Q_OBJECT + QML_NAMED_ELEMENT(ReadItem) + QML_SINGLETON + QML_ADDED_IN_VERSION(5, 13) + public: Q_INVOKABLE OpcUaReadItem create(); }; QT_END_NAMESPACE -#endif // OPCUAREADITEM_H +#endif // OPCUAREADITEM_P_H diff --git a/src/imports/opcua/opcuareadresult.cpp b/src/declarative_opcua/opcuareadresult.cpp index 540be56..d2b5455 100644 --- a/src/imports/opcua/opcuareadresult.cpp +++ b/src/declarative_opcua/opcuareadresult.cpp @@ -34,8 +34,9 @@ ** ****************************************************************************/ -#include "opcuareadresult.h" -#include "universalnode.h" +#include <private/opcuareadresult_p.h> +#include <private/universalnode_p.h> + #include <QOpcUaReadResult> #include <QOpcUaClient> #include <qopcuatype.h> diff --git a/src/imports/opcua/opcuareadresult.h b/src/declarative_opcua/opcuareadresult_p.h index d4b40c5..6f1be4e 100644 --- a/src/imports/opcua/opcuareadresult.h +++ b/src/declarative_opcua/opcuareadresult_p.h @@ -34,13 +34,25 @@ ** ****************************************************************************/ -#ifndef OPCUAREADRESULT_H -#define OPCUAREADRESULT_H +#ifndef OPCUAREADRESULT_P_H +#define OPCUAREADRESULT_P_H +#include <private/opcuastatus_p.h> + +#include <QtOpcUa/qopcuatype.h> #include <QObject> #include <QDateTime> -#include "qopcuatype.h" -#include "opcuastatus.h" + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -85,4 +97,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(OpcUaReadResult) -#endif // OPCUAREADRESULT_H +#endif // OPCUAREADRESULT_P_H diff --git a/src/imports/opcua/opcuarelativenodeid.cpp b/src/declarative_opcua/opcuarelativenodeid.cpp index 3963361..54831de 100644 --- a/src/imports/opcua/opcuarelativenodeid.cpp +++ b/src/declarative_opcua/opcuarelativenodeid.cpp @@ -34,9 +34,9 @@ ** ****************************************************************************/ -#include "opcuarelativenodeid.h" -#include "opcuanodeid.h" -#include "opcuarelativenodepath.h" +#include <private/opcuarelativenodeid_p.h> +#include <private/opcuanodeid_p.h> +#include <private/opcuarelativenodepath_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuarelativenodeid.h b/src/declarative_opcua/opcuarelativenodeid_p.h index 9b9eab8..38aafb2 100644 --- a/src/imports/opcua/opcuarelativenodeid.h +++ b/src/declarative_opcua/opcuarelativenodeid_p.h @@ -36,9 +36,22 @@ #pragma once -#include "opcuanodeidtype.h" +#include <private/opcuanodeidtype_p.h> + #include <QList> #include <QQmlListProperty> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -52,6 +65,9 @@ class OpcUaRelativeNodeId : public OpcUaNodeIdType Q_PROPERTY(OpcUaNodeIdType* startNode READ startNode WRITE setStartNode NOTIFY startNodeChanged) Q_PROPERTY(QQmlListProperty<OpcUaRelativeNodePath> path READ paths) + QML_NAMED_ELEMENT(RelativeNodeId) + QML_ADDED_IN_VERSION(5, 12) + public: explicit OpcUaRelativeNodeId(QObject *parent = nullptr); diff --git a/src/imports/opcua/opcuarelativenodepath.cpp b/src/declarative_opcua/opcuarelativenodepath.cpp index afb271c..da312f2 100644 --- a/src/imports/opcua/opcuarelativenodepath.cpp +++ b/src/declarative_opcua/opcuarelativenodepath.cpp @@ -34,9 +34,10 @@ ** ****************************************************************************/ -#include "opcuarelativenodepath.h" -#include "opcuanodeid.h" -#include "qopcuaclient.h" +#include <private/opcuarelativenodepath_p.h> +#include <private/opcuanodeid_p.h> + +#include <QtOpcUa/qopcuaclient.h> #include <QLoggingCategory> #include <QMetaEnum> diff --git a/src/imports/opcua/opcuarelativenodepath.h b/src/declarative_opcua/opcuarelativenodepath_p.h index ecad1e9..d8b22c0 100644 --- a/src/imports/opcua/opcuarelativenodepath.h +++ b/src/declarative_opcua/opcuarelativenodepath_p.h @@ -38,7 +38,21 @@ #include <QObject> #include <qopcuatype.h> -#include "universalnode.h" + +#include <private/universalnode_p.h> + +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -54,6 +68,9 @@ class OpcUaRelativeNodePath : public QObject Q_PROPERTY(bool includeSubtypes READ includeSubtypes WRITE setIncludeSubtypes NOTIFY includeSubtypesChanged) Q_PROPERTY(bool isInverse READ isInverse WRITE setIsInverse NOTIFY isInverseChanged) + QML_NAMED_ELEMENT(RelativeNodePath) + QML_ADDED_IN_VERSION(5, 12) + public: explicit OpcUaRelativeNodePath(QObject *parent = nullptr); const QString &nodeNamespace() const; diff --git a/src/imports/opcua/opcuaserverdiscovery.cpp b/src/declarative_opcua/opcuaserverdiscovery.cpp index 884f4b1..20a4bb1 100644 --- a/src/imports/opcua/opcuaserverdiscovery.cpp +++ b/src/declarative_opcua/opcuaserverdiscovery.cpp @@ -34,7 +34,7 @@ ** ****************************************************************************/ -#include "opcuaserverdiscovery.h" +#include <private/opcuaserverdiscovery_p.h> QT_BEGIN_NAMESPACE @@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE Allows to fetch and access information about servers known to a server or discovery server. - \snippet ../../src/imports/doc/snippets/basic/basic.qml Basic discovery + \snippet ../../src/declarative_opcua/doc/snippets/basic/basic.qml Basic discovery */ /*! diff --git a/src/imports/opcua/opcuaserverdiscovery.h b/src/declarative_opcua/opcuaserverdiscovery_p.h index 013b8ee..7ba8314 100644 --- a/src/imports/opcua/opcuaserverdiscovery.h +++ b/src/declarative_opcua/opcuaserverdiscovery_p.h @@ -34,15 +34,27 @@ ** ****************************************************************************/ -#ifndef OPCUASERVERDISCOVERY_H -#define OPCUASERVERDISCOVERY_H +#ifndef OPCUASERVERDISCOVERY_P_H +#define OPCUASERVERDISCOVERY_P_H -#include "opcuastatus.h" -#include "opcuaconnection.h" +#include <private/opcuastatus_p.h> +#include <private/opcuaconnection_p.h> #include <QtOpcUa/qopcuatype.h> #include <QOpcUaApplicationDescription> #include <QStandardItemModel> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -54,6 +66,9 @@ class OpcUaServerDiscovery : public QStandardItemModel Q_PROPERTY(OpcUaStatus status READ status NOTIFY statusChanged) Q_PROPERTY(OpcUaConnection* connection READ connection WRITE setConnection NOTIFY connectionChanged) + QML_NAMED_ELEMENT(ServerDiscovery) + QML_ADDED_IN_VERSION(5, 13) + public: OpcUaServerDiscovery(QObject *parent = nullptr); ~OpcUaServerDiscovery(); @@ -89,4 +104,4 @@ private: QT_END_NAMESPACE -#endif // OPCUASERVERDISCOVERY_H +#endif // OPCUASERVERDISCOVERY_P_H diff --git a/src/imports/opcua/opcuasimpleattributeoperand.cpp b/src/declarative_opcua/opcuasimpleattributeoperand.cpp index 1497192..8e3f740 100644 --- a/src/imports/opcua/opcuasimpleattributeoperand.cpp +++ b/src/declarative_opcua/opcuasimpleattributeoperand.cpp @@ -34,9 +34,10 @@ ** ****************************************************************************/ -#include "opcuasimpleattributeoperand.h" -#include "opcuanodeid.h" -#include "universalnode.h" +#include <private/opcuasimpleattributeoperand_p.h> +#include <private/opcuanodeid_p.h> +#include <private/universalnode_p.h> + #include <QOpcUaQualifiedName> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuasimpleattributeoperand.h b/src/declarative_opcua/opcuasimpleattributeoperand_p.h index 1aa910b..b3877a1 100644 --- a/src/imports/opcua/opcuasimpleattributeoperand.h +++ b/src/declarative_opcua/opcuasimpleattributeoperand_p.h @@ -34,13 +34,26 @@ ** ****************************************************************************/ -#ifndef OPCUASIMPLEATTRIBUTEOPERAND -#define OPCUASIMPLEATTRIBUTEOPERAND +#ifndef OPCUASIMPLEATTRIBUTEOPERAND_P_H +#define OPCUASIMPLEATTRIBUTEOPERAND_P_H + +#include <private/opcuaoperandbase_p.h> -#include "opcuaoperandbase.h" #include <QOpcUaSimpleAttributeOperand> #include <QQmlListProperty> #include <QList> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -54,6 +67,9 @@ class OpcUaSimpleAttributeOperand : public OpcUaOperandBase, private QOpcUaSimpl Q_PROPERTY(QOpcUa::NodeAttribute nodeAttribute READ nodeAttribute WRITE setNodeAttribute) Q_PROPERTY(QString typeId READ typeId WRITE setTypeId) + QML_NAMED_ELEMENT(SimpleAttributeOperand) + QML_ADDED_IN_VERSION(5, 13) + public: explicit OpcUaSimpleAttributeOperand(QObject *parent = nullptr); ~OpcUaSimpleAttributeOperand(); @@ -89,4 +105,4 @@ private: QT_END_NAMESPACE -#endif // OPCUASIMPLEATTRIBUTEOPERAND +#endif // OPCUASIMPLEATTRIBUTEOPERAND_P_H diff --git a/src/imports/opcua/opcuastatus.cpp b/src/declarative_opcua/opcuastatus.cpp index 9994b9b..e097dec 100644 --- a/src/imports/opcua/opcuastatus.cpp +++ b/src/declarative_opcua/opcuastatus.cpp @@ -34,8 +34,8 @@ ** ****************************************************************************/ -#include "opcuastatus.h" -#include "opcuaconnection.h" +#include <private/opcuastatus_p.h> +#include <private/opcuaconnection_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuastatus.h b/src/declarative_opcua/opcuastatus_p.h index 1f23292..e794d8b 100644 --- a/src/imports/opcua/opcuastatus.h +++ b/src/declarative_opcua/opcuastatus_p.h @@ -34,12 +34,24 @@ ** ****************************************************************************/ -#ifndef OPCUASTATUS_H -#define OPCUASTATUS_H +#ifndef OPCUASTATUS_P_H +#define OPCUASTATUS_P_H #include <QStandardItemModel> #include <QtOpcUa/qopcuatype.h> #include <QOpcUaApplicationDescription> +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -52,6 +64,10 @@ class OpcUaStatus Q_PROPERTY(bool isBad READ isBad) Q_PROPERTY(Status status READ status) + // This is a value type. Thus lowercase. The enums are taken care of below + QML_VALUE_TYPE(status) + QML_ADDED_IN_VERSION(5, 13) + public: enum class Status { Good = 0x0000, @@ -298,6 +314,16 @@ private: quint32 m_statusCode{QOpcUa::Good}; }; +// Expose only the enums with the uppercase "Status" name +namespace OpcuaStatusForeign +{ + Q_NAMESPACE + QML_FOREIGN_NAMESPACE(OpcUaStatus) + QML_NAMED_ELEMENT(Status) + QML_ADDED_IN_VERSION(5, 13) + QML_UNCREATABLE("This type can not be created.") +}; + QT_END_NAMESPACE -#endif // OPCUASTATUS_H +#endif // OPCUASTATUS_P_H diff --git a/src/imports/opcua/opcuavaluenode.cpp b/src/declarative_opcua/opcuavaluenode.cpp index 0b375de..b2ed57e 100644 --- a/src/imports/opcua/opcuavaluenode.cpp +++ b/src/declarative_opcua/opcuavaluenode.cpp @@ -34,10 +34,11 @@ ** ****************************************************************************/ -#include "opcuavaluenode.h" -#include "opcuaconnection.h" -#include "opcuanodeid.h" -#include "opcuaattributevalue.h" +#include <private/opcuavaluenode_p.h> +#include <private/opcuaconnection_p.h> +#include <private/opcuanodeid_p.h> +#include <private/opcuaattributevalue_p.h> + #include <QLoggingCategory> #include <QMetaEnum> diff --git a/src/imports/opcua/opcuavaluenode.h b/src/declarative_opcua/opcuavaluenode_p.h index ff0a929..47ed3d5 100644 --- a/src/imports/opcua/opcuavaluenode.h +++ b/src/declarative_opcua/opcuavaluenode_p.h @@ -36,9 +36,21 @@ #pragma once -#include "opcuanode.h" +#include <private/opcuanode_p.h> +#include <private/opcuadatachangefilter_p.h> + #include <QDateTime> -#include "opcuadatachangefilter.h" + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -54,6 +66,9 @@ class OpcUaValueNode : public OpcUaNode Q_PROPERTY(double publishingInterval READ publishingInterval WRITE setPublishingInterval NOTIFY publishingIntervalChanged) Q_PROPERTY(OpcUaDataChangeFilter *filter READ filter WRITE setFilter NOTIFY filterChanged) + QML_NAMED_ELEMENT(ValueNode) + QML_ADDED_IN_VERSION(5, 12) + public: OpcUaValueNode(QObject *parent = nullptr); ~OpcUaValueNode(); diff --git a/src/imports/opcua/opcuawriteitem.cpp b/src/declarative_opcua/opcuawriteitem.cpp index b86e0f9..0f34bac 100644 --- a/src/imports/opcua/opcuawriteitem.cpp +++ b/src/declarative_opcua/opcuawriteitem.cpp @@ -34,8 +34,9 @@ ** ****************************************************************************/ -#include "opcuawriteitem.h" -#include "opcuawriteresult.h" +#include <private/opcuawriteitem_p.h> +#include <private/opcuawriteresult_p.h> + #include <QJSValue> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/opcuawriteitem.h b/src/declarative_opcua/opcuawriteitem_p.h index d238c61..f1d29a9 100644 --- a/src/imports/opcua/opcuawriteitem.h +++ b/src/declarative_opcua/opcuawriteitem_p.h @@ -34,14 +34,29 @@ ** ****************************************************************************/ -#ifndef OPCUAWRITEITEM_H -#define OPCUAWRITEITEM_H +#ifndef OPCUAWRITEITEM_P_H +#define OPCUAWRITEITEM_P_H + +#include <private/opcuastatus_p.h> #include <QObject> #include <QDateTime> #include <QtCore/qshareddata.h> -#include "opcuastatus.h" -#include "qopcuatype.h" + +#include <QtOpcUa/qopcuatype.h> + +#include <QtQml/qqml.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -100,10 +115,14 @@ private: class OpcUaWriteItemFactory : public QObject { Q_OBJECT + QML_NAMED_ELEMENT(WriteItem) + QML_SINGLETON + QML_ADDED_IN_VERSION(5, 13) + public: Q_INVOKABLE OpcUaWriteItem create(); }; QT_END_NAMESPACE -#endif // OPCUAWRITEITEM_H +#endif // OPCUAWRITEITEM_P_H diff --git a/src/imports/opcua/opcuawriteresult.cpp b/src/declarative_opcua/opcuawriteresult.cpp index f7729e4..082c94b 100644 --- a/src/imports/opcua/opcuawriteresult.cpp +++ b/src/declarative_opcua/opcuawriteresult.cpp @@ -34,8 +34,9 @@ ** ****************************************************************************/ -#include "opcuawriteresult.h" -#include "universalnode.h" +#include <private/opcuawriteresult_p.h> +#include <private/universalnode_p.h> + #include <QOpcUaWriteResult> #include <QOpcUaClient> #include <qopcuatype.h> diff --git a/src/imports/opcua/opcuawriteresult.h b/src/declarative_opcua/opcuawriteresult_p.h index d34e95b..ecbe622 100644 --- a/src/imports/opcua/opcuawriteresult.h +++ b/src/declarative_opcua/opcuawriteresult_p.h @@ -34,13 +34,25 @@ ** ****************************************************************************/ -#ifndef OPCUAWRITERESULT_H -#define OPCUAWRITERESULT_H +#ifndef OPCUAWRITERESULT_P_H +#define OPCUAWRITERESULT_P_H + +#include <private/opcuastatus_p.h> #include <QObject> #include <QDateTime> -#include "qopcuatype.h" -#include "opcuastatus.h" +#include <QtOpcUa/qopcuatype.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// QT_BEGIN_NAMESPACE @@ -79,4 +91,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(OpcUaWriteResult) -#endif // OPCUAWRITERESULT_H +#endif // OPCUAWRITERESULT_P_H diff --git a/src/imports/opcua/universalnode.cpp b/src/declarative_opcua/universalnode.cpp index 2b96381..62d0802 100644 --- a/src/imports/opcua/universalnode.cpp +++ b/src/declarative_opcua/universalnode.cpp @@ -34,9 +34,10 @@ ** ****************************************************************************/ -#include "universalnode.h" -#include "qopcuaclient.h" -#include "opcuanodeidtype.h" +#include <private/universalnode_p.h> +#include <private/opcuanodeidtype_p.h> + +#include <QtOpcUa/qopcuaclient.h> #include <QLoggingCategory> QT_BEGIN_NAMESPACE diff --git a/src/imports/opcua/universalnode.h b/src/declarative_opcua/universalnode_p.h index bf12ed4..9bf0118 100644 --- a/src/imports/opcua/universalnode.h +++ b/src/declarative_opcua/universalnode_p.h @@ -38,6 +38,17 @@ #include <QObject> +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + QT_BEGIN_NAMESPACE class QOpcUaClient; diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt deleted file mode 100644 index 37448ef..0000000 --- a/src/imports/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Generated from imports.pro. - -add_subdirectory(doc) -if(TARGET Qt::OpcUa) - add_subdirectory(opcua) -endif() diff --git a/src/imports/doc/CMakeLists.txt b/src/imports/doc/CMakeLists.txt deleted file mode 100644 index 69c502e..0000000 --- a/src/imports/doc/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Generated from doc.pro. - -# special case begin -# add_subdirectory(snippets) -# special case end diff --git a/src/imports/opcua/CMakeLists.txt b/src/imports/opcua/CMakeLists.txt deleted file mode 100644 index faa7b91..0000000 --- a/src/imports/opcua/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -qt_internal_add_qml_module(declarative_opcua - URI "QtOpcUa" - VERSION "${PROJECT_VERSION}" - PAST_MAJOR_VERSIONS 1 5 - CLASS_NAME "OpcUaPlugin" - PLUGIN_TARGET declarative_opcua - NO_PLUGIN_OPTIONAL - NO_GENERATE_PLUGIN_SOURCE - NO_GENERATE_QMLTYPES - INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" - DEPENDENCIES - QtQuick - SOURCES - opcua_plugin.cpp opcua_plugin.h - opcuaattributecache.cpp opcuaattributecache.h - opcuaattributeoperand.cpp opcuaattributeoperand.h - opcuaattributevalue.cpp opcuaattributevalue.h - opcuaconnection.cpp opcuaconnection.h - opcuadatachangefilter.cpp opcuadatachangefilter.h - opcuaelementoperand.cpp opcuaelementoperand.h - opcuaendpointdiscovery.cpp opcuaendpointdiscovery.h - opcuaeventfilter.cpp opcuaeventfilter.h - opcuafilterelement.cpp opcuafilterelement.h - opcualiteraloperand.cpp opcualiteraloperand.h - opcuamethodargument.cpp opcuamethodargument.h - opcuamethodnode.cpp opcuamethodnode.h - opcuanode.cpp opcuanode.h - opcuanodeid.cpp opcuanodeid.h - opcuanodeidtype.cpp opcuanodeidtype.h - opcuaoperandbase.cpp opcuaoperandbase.h - opcuapathresolver.cpp opcuapathresolver.h - opcuareaditem.cpp opcuareaditem.h - opcuareadresult.cpp opcuareadresult.h - opcuarelativenodeid.cpp opcuarelativenodeid.h - opcuarelativenodepath.cpp opcuarelativenodepath.h - opcuaserverdiscovery.cpp opcuaserverdiscovery.h - opcuasimpleattributeoperand.cpp opcuasimpleattributeoperand.h - opcuastatus.cpp opcuastatus.h - opcuavaluenode.cpp opcuavaluenode.h - opcuawriteitem.cpp opcuawriteitem.h - opcuawriteresult.cpp opcuawriteresult.h - universalnode.cpp universalnode.h - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::OpcUa - Qt::Quick -) - -# The file contains Q_OBJECT in a comment -set_property(SOURCE opcuaconnection.cpp PROPERTY SKIP_AUTOMOC ON) diff --git a/src/imports/opcua/opcua_plugin.cpp b/src/imports/opcua/opcua_plugin.cpp deleted file mode 100644 index c46be14..0000000 --- a/src/imports/opcua/opcua_plugin.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt OPC UA module. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "opcua_plugin.h" -#include "opcuaendpointdiscovery.h" -#include "opcuavaluenode.h" -#include "opcuamethodnode.h" -#include "opcuanodeid.h" -#include "opcuanodeidtype.h" -#include "opcuaconnection.h" -#include "opcuadatachangefilter.h" -#include "opcuarelativenodepath.h" -#include "opcuarelativenodeid.h" -#include "qopcuatype.h" -#include "opcuastatus.h" -#include "opcuareaditem.h" -#include "opcuareadresult.h" -#include "opcuaserverdiscovery.h" -#include "opcuawriteitem.h" -#include "opcuawriteresult.h" -#include "opcuaelementoperand.h" -#include "opcualiteraloperand.h" -#include "opcuasimpleattributeoperand.h" -#include "opcuaattributeoperand.h" -#include "opcuafilterelement.h" -#include "opcuaeventfilter.h" -#include <QLoggingCategory> -#include <QOpcUaUserTokenPolicy> - -#include <qqml.h> - -QT_BEGIN_NAMESPACE - -Q_LOGGING_CATEGORY(QT_OPCUA_PLUGINS_QML, "qt.opcua.plugins.qml") - -/*! - \qmlproperty enumeration Constants::NodeAttribute - - Attributes of a node - - \value Constants.NodeAttribute.NodeId - \value Constants.NodeAttribute.NodeClass - \value Constants.NodeAttribute.BrowseName - \value Constants.NodeAttribute.DisplayName - \value Constants.NodeAttribute.Description - \value Constants.NodeAttribute.WriteMask - \value Constants.NodeAttribute.UserWriteMask - \value Constants.NodeAttribute.IsAbstract - \value Constants.NodeAttribute.Symmetric - \value Constants.NodeAttribute.InverseName - \value Constants.NodeAttribute.ContainsNoLoops - \value Constants.NodeAttribute.EventNotifier - \value Constants.NodeAttribute.Value - \value Constants.NodeAttribute.DataType - \value Constants.NodeAttribute.ValueRank - \value Constants.NodeAttribute.ArrayDimensions - \value Constants.NodeAttribute.AccessLevel - \value Constants.NodeAttribute.UserAccessLevel - \value Constants.NodeAttribute.MinimumSamplingInterval - \value Constants.NodeAttribute.Historizing - \value Constants.NodeAttribute.Executable - \value Constants.NodeAttribute.UserExecutable -*/ -namespace Constants { - Q_NAMESPACE - Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") - Q_ENUM_NS(QOpcUa::ReferenceTypeId) - Q_ENUM_NS(QOpcUa::Types) - Q_ENUM_NS(QOpcUaUserTokenPolicy::TokenType) - // Only one type declaration is needed because all other - // types of the same meta object will be added automatically. -} - -void OpcUaPlugin::registerTypes(const char *uri) -{ - Q_ASSERT(uri == QStringLiteral("QtOpcUa")); - - // @uri QtOpcUa - int major = 5; - int minor = 12; - - // Register the 5.12 types - - qmlRegisterType<OpcUaConnection>(uri, major, minor, "Connection"); - qmlRegisterType<OpcUaValueNode>(uri, major, minor, "ValueNode"); - qmlRegisterType<OpcUaMethodNode>(uri, major, minor, "MethodNode"); - qmlRegisterType<OpcUaNode>(uri, major, minor, "Node"); - qmlRegisterType<OpcUaNodeId>(uri, major, minor, "NodeId"); - qmlRegisterUncreatableType<OpcUaNodeIdType>(uri, major, minor, "NodeIdType", - "The type 'NodeIdType' is not creatable. Use 'NodeId' or 'RelativeNodeId' instead."); - qmlRegisterType<OpcUaRelativeNodePath>(uri, major, minor, "RelativeNodePath"); - qmlRegisterType<OpcUaRelativeNodeId>(uri, major, minor, "RelativeNodeId"); - qmlRegisterUncreatableMetaObject(Constants::staticMetaObject, uri, major, minor, "Constants", "This type can not be created."); - - // Register the 5.13 types - - major = 5; - minor = 13; - - qmlRegisterType<OpcUaMethodArgument>(uri, major, minor, "MethodArgument"); - qmlRegisterUncreatableType<QOpcUaApplicationDescription>(uri, major, minor, "ApplicationDescription", "This type can not be created."); - qRegisterMetaType<OpcUaStatus>(); - qmlRegisterUncreatableType<OpcUaStatus>(uri, major, minor, "Status", "This type can not be created."); - qmlRegisterSingletonType<OpcUaReadItemFactory>(uri, major, minor, "ReadItem", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { - Q_UNUSED(engine) - Q_UNUSED(scriptEngine) - - return new OpcUaReadItemFactory(); - }); - qmlRegisterSingletonType<OpcUaWriteItemFactory>(uri, major, minor, "WriteItem", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* { - Q_UNUSED(engine) - Q_UNUSED(scriptEngine) - return new OpcUaWriteItemFactory(); - }); - qRegisterMetaType<OpcUaReadItem>(); - qRegisterMetaType<OpcUaReadResult>(); - qRegisterMetaType<OpcUaWriteItem>(); - qRegisterMetaType<OpcUaWriteResult>(); - qmlRegisterType<OpcUaEndpointDiscovery>(uri, major, minor, "EndpointDiscovery"); - qmlRegisterType<OpcUaServerDiscovery>(uri, major, minor, "ServerDiscovery"); - qmlRegisterUncreatableType<QOpcUaUserTokenPolicy>(uri, major, minor, "UserTokenPolicy", "This type can not be created."); - qmlRegisterType<OpcUaDataChangeFilter>(uri, major, minor, "DataChangeFilter"); - qmlRegisterType<OpcUaElementOperand>(uri, major, minor, "ElementOperand"); - qmlRegisterType<OpcUaLiteralOperand>(uri, major, minor, "LiteralOperand"); - qmlRegisterType<OpcUaSimpleAttributeOperand>(uri, major, minor, "SimpleAttributeOperand"); - qmlRegisterType<OpcUaAttributeOperand>(uri, major, minor, "AttributeOperand"); - qmlRegisterType<OpcUaFilterElement>(uri, major, minor, "FilterElement"); - qmlRegisterType<OpcUaEventFilter>(uri, major, minor, "EventFilter"); - - // insert new versions here - - // Register the latest Qt version as QML type version - qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR); -} - -QT_END_NAMESPACE - -#include "opcua_plugin.moc" - diff --git a/src/imports/opcua/opcua_plugin.h b/src/imports/opcua/opcua_plugin.h deleted file mode 100644 index 4806e8c..0000000 --- a/src/imports/opcua/opcua_plugin.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt OPC UA module. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#pragma once - -#include <QQmlExtensionPlugin> - -QT_BEGIN_NAMESPACE - -class OpcUaPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - void registerTypes(const char *uri) override; -}; - -QT_END_NAMESPACE diff --git a/src/imports/opcua/plugins.qmltypes b/src/imports/opcua/plugins.qmltypes deleted file mode 100644 index 5f27feb..0000000 --- a/src/imports/opcua/plugins.qmltypes +++ /dev/null @@ -1,590 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtOpcUa 5.13' - -Module { - dependencies: ["QtQuick 2.12"] - Component { - name: "Constants" - exports: ["QtOpcUa/Constants 5.12"] - isCreatable: false - exportMetaObjectRevisions: [0] - } - Component { - name: "OpcUaConnection" - prototype: "QObject" - exports: ["QtOpcUa/Connection 5.12"] - exportMetaObjectRevisions: [0] - Property { name: "availableBackends"; type: "QStringList"; isReadonly: true } - Property { name: "connected"; type: "bool"; isReadonly: true } - Property { name: "backend"; type: "string" } - Property { name: "defaultConnection"; type: "bool" } - Property { name: "namespaces"; type: "QStringList"; isReadonly: true } - Property { name: "authenticationInformation"; type: "QOpcUaAuthenticationInformation" } - Signal { - name: "readNodeAttributesFinished" - Parameter { name: "value"; type: "QVariant" } - } - Method { - name: "connectToEndpoint" - Parameter { name: "endpointDescription"; type: "QOpcUaEndpointDescription" } - } - Method { name: "disconnectFromEndpoint" } - Method { - name: "setDefaultConnection" - Parameter { name: "defaultConnection"; type: "bool" } - } - Method { name: "setDefaultConnection" } - Method { - name: "setAuthenticationInformation" - Parameter { name: "authenticationInformation"; type: "QOpcUaAuthenticationInformation" } - } - Method { - name: "readNodeAttributes" - type: "bool" - Parameter { name: "value"; type: "QJSValue" } - } - } - Component { - name: "OpcUaEndpointDiscovery" - prototype: "QObject" - exports: ["QtOpcUa/EndpointDiscovery 5.13"] - exportMetaObjectRevisions: [0] - Property { name: "serverUrl"; type: "string" } - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "status"; type: "OpcUaStatus"; isReadonly: true } - Property { name: "connection"; type: "OpcUaConnection"; isPointer: true } - Signal { - name: "serverUrlChanged" - Parameter { name: "serverUrl"; type: "string" } - } - Signal { name: "endpointsChanged" } - Signal { - name: "connectionChanged" - Parameter { type: "OpcUaConnection"; isPointer: true } - } - Method { - name: "at" - type: "QOpcUaEndpointDescription" - Parameter { name: "row"; type: "int" } - } - } - Component { - name: "OpcUaMethodArgument" - prototype: "QObject" - exports: ["QtOpcUa/MethodArgument 5.13"] - exportMetaObjectRevisions: [0] - Property { name: "value"; type: "QVariant" } - Property { name: "type"; type: "QOpcUa::Types" } - Method { - name: "setValue" - Parameter { name: "value"; type: "QVariant" } - } - Method { - name: "setType" - Parameter { name: "type"; type: "QOpcUa::Types" } - } - } - Component { - name: "OpcUaMethodNode" - prototype: "OpcUaNode" - exports: ["QtOpcUa/MethodNode 5.12"] - exportMetaObjectRevisions: [0] - Property { name: "objectNodeId"; type: "OpcUaNodeIdType"; isPointer: true } - Property { name: "inputArguments"; type: "OpcUaMethodArgument"; isList: true; isReadonly: true } - Property { name: "outputArguments"; type: "QVariantList"; isReadonly: true } - Property { name: "resultStatus"; type: "OpcUaStatus"; isReadonly: true } - Signal { - name: "resultStatusChanged" - Parameter { name: "status"; type: "OpcUaStatus" } - } - Method { - name: "setObjectNodeId" - Parameter { name: "nodeId"; type: "OpcUaNodeIdType"; isPointer: true } - } - Method { name: "callMethod" } - } - Component { - name: "OpcUaNode" - prototype: "QObject" - exports: ["QtOpcUa/Node 5.12"] - exportMetaObjectRevisions: [0] - Enum { - name: "Status" - values: { - "Valid": 0, - "InvalidNodeId": 1, - "NoConnection": 2, - "InvalidNodeType": 3, - "InvalidClient": 4, - "FailedToResolveNode": 5, - "InvalidObjectNode": 6, - "FailedToReadAttributes": 7, - "FailedToSetupMonitoring": 8 - } - } - Property { name: "nodeId"; type: "OpcUaNodeIdType"; isPointer: true } - Property { name: "connection"; type: "OpcUaConnection"; isPointer: true } - Property { name: "readyToUse"; type: "bool"; isReadonly: true } - Property { name: "status"; type: "OpcUaNode::Status"; isReadonly: true } - Property { name: "errorMessage"; type: "string"; isReadonly: true } - Property { name: "browseName"; type: "string" } - Property { name: "nodeClass"; type: "QOpcUa::NodeClass"; isReadonly: true } - Property { name: "displayName"; type: "QOpcUaLocalizedText" } - Property { name: "description"; type: "QOpcUaLocalizedText" } - Signal { - name: "nodeIdChanged" - Parameter { name: "nodeId"; type: "const OpcUaNodeIdType"; isPointer: true } - } - Signal { - name: "connectionChanged" - Parameter { type: "OpcUaConnection"; isPointer: true } - } - Signal { name: "nodeChanged" } - Method { - name: "setNodeId" - Parameter { name: "nodeId"; type: "OpcUaNodeIdType"; isPointer: true } - } - Method { - name: "setConnection" - Parameter { type: "OpcUaConnection"; isPointer: true } - } - Method { - name: "getSourceTimestamp" - type: "QDateTime" - Parameter { type: "QOpcUa::NodeAttribute" } - } - Method { - name: "getServerTimestamp" - type: "QDateTime" - Parameter { type: "QOpcUa::NodeAttribute" } - } - } - Component { - name: "OpcUaNodeId" - prototype: "OpcUaNodeIdType" - exports: ["QtOpcUa/NodeId 5.12"] - exportMetaObjectRevisions: [0] - Property { name: "ns"; type: "string" } - Property { name: "identifier"; type: "string" } - Signal { - name: "nodeNamespaceChanged" - Parameter { type: "string" } - } - Signal { - name: "identifierChanged" - Parameter { type: "string" } - } - Signal { name: "nodeChanged" } - } - Component { - name: "OpcUaNodeIdType" - prototype: "QObject" - exports: ["QtOpcUa/NodeIdType 5.12"] - isCreatable: false - exportMetaObjectRevisions: [0] - Signal { - name: "nodeNamespaceChanged" - Parameter { type: "string" } - } - Signal { - name: "identifierChanged" - Parameter { type: "string" } - } - Signal { name: "nodeChanged" } - } - Component { - name: "OpcUaReadItemFactory" - prototype: "QObject" - exports: ["QtOpcUa/ReadItem 5.13"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Method { name: "create"; type: "OpcUaReadItem" } - } - Component { - name: "OpcUaRelativeNodeId" - prototype: "OpcUaNodeIdType" - exports: ["QtOpcUa/RelativeNodeId 5.12"] - exportMetaObjectRevisions: [0] - Property { name: "startNode"; type: "OpcUaNodeIdType"; isPointer: true } - Property { name: "path"; type: "OpcUaRelativeNodePath"; isList: true; isReadonly: true } - Signal { - name: "startNodeChanged" - Parameter { name: "startNode"; type: "OpcUaNodeIdType"; isPointer: true } - } - Method { - name: "setStartNode" - Parameter { name: "startNode"; type: "OpcUaNodeIdType"; isPointer: true } - } - } - Component { - name: "OpcUaRelativeNodePath" - prototype: "QObject" - exports: ["QtOpcUa/RelativeNodePath 5.12"] - exportMetaObjectRevisions: [0] - Property { name: "ns"; type: "string" } - Property { name: "browseName"; type: "string" } - Property { name: "referenceType"; type: "QOpcUa::ReferenceTypeId" } - Property { name: "includeSubtypes"; type: "bool" } - Property { name: "isInverse"; type: "bool" } - Signal { - name: "nodeNamespaceChanged" - Parameter { name: "ns"; type: "string" } - } - Signal { - name: "browseNameChanged" - Parameter { name: "browseName"; type: "string" } - } - Signal { - name: "referenceTypeChanged" - Parameter { name: "referenceType"; type: "QOpcUa::ReferenceTypeId" } - } - Signal { - name: "includeSubtypesChanged" - Parameter { name: "includeSubtypes"; type: "bool" } - } - Signal { - name: "isInverseChanged" - Parameter { name: "isInverse"; type: "bool" } - } - Method { - name: "setNodeNamespace" - Parameter { name: "ns"; type: "string" } - } - Method { - name: "setBrowseName" - Parameter { name: "browseName"; type: "string" } - } - Method { - name: "setReferenceType" - Parameter { name: "referenceType"; type: "QOpcUa::ReferenceTypeId" } - } - Method { - name: "setIncludeSubtypes" - Parameter { name: "includeSubtypes"; type: "bool" } - } - Method { - name: "setIsInverse" - Parameter { name: "isInverse"; type: "bool" } - } - } - Component { - name: "OpcUaServerDiscovery" - prototype: "QStandardItemModel" - exports: ["QtOpcUa/ServerDiscovery 5.13"] - exportMetaObjectRevisions: [0] - Property { name: "discoveryUrl"; type: "string" } - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "status"; type: "OpcUaStatus"; isReadonly: true } - Property { name: "connection"; type: "OpcUaConnection"; isPointer: true } - Signal { name: "serversChanged" } - Signal { - name: "connectionChanged" - Parameter { type: "OpcUaConnection"; isPointer: true } - } - Method { - name: "at" - type: "QOpcUaApplicationDescription" - Parameter { name: "row"; type: "int" } - } - } - Component { - name: "OpcUaStatus" - exports: ["QtOpcUa/Status 5.13"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "Status" - values: { - "Good": 0, - "BadUnexpectedError": 32769, - "BadInternalError": 32770, - "BadOutOfMemory": 32771, - "BadResourceUnavailable": 32772, - "BadCommunicationError": 32773, - "BadEncodingError": 32774, - "BadDecodingError": 32775, - "BadEncodingLimitsExceeded": 32776, - "BadRequestTooLarge": 32952, - "BadResponseTooLarge": 32953, - "BadUnknownResponse": 32777, - "BadTimeout": 32778, - "BadServiceUnsupported": 32779, - "BadShutdown": 32780, - "BadServerNotConnected": 32781, - "BadServerHalted": 32782, - "BadNothingToDo": 32783, - "BadTooManyOperations": 32784, - "BadTooManyMonitoredItems": 32987, - "BadDataTypeIdUnknown": 32785, - "BadCertificateInvalid": 32786, - "BadSecurityChecksFailed": 32787, - "BadCertificateTimeInvalid": 32788, - "BadCertificateIssuerTimeInvalid": 32789, - "BadCertificateHostNameInvalid": 32790, - "BadCertificateUriInvalid": 32791, - "BadCertificateUseNotAllowed": 32792, - "BadCertificateIssuerUseNotAllowed": 32793, - "BadCertificateUntrusted": 32794, - "BadCertificateRevocationUnknown": 32795, - "BadCertificateIssuerRevocationUnknown": 32796, - "BadCertificateRevoked": 32797, - "BadCertificateIssuerRevoked": 32798, - "BadCertificateChainIncomplete": 33037, - "BadUserAccessDenied": 32799, - "BadIdentityTokenInvalid": 32800, - "BadIdentityTokenRejected": 32801, - "BadSecureChannelIdInvalid": 32802, - "BadInvalidTimestamp": 32803, - "BadNonceInvalid": 32804, - "BadSessionIdInvalid": 32805, - "BadSessionClosed": 32806, - "BadSessionNotActivated": 32807, - "BadSubscriptionIdInvalid": 32808, - "BadRequestHeaderInvalid": 32810, - "BadTimestampsToReturnInvalid": 32811, - "BadRequestCancelledByClient": 32812, - "BadTooManyArguments": 32997, - "GoodSubscriptionTransferred": 45, - "GoodCompletesAsynchronously": 46, - "GoodOverload": 47, - "GoodClamped": 48, - "BadNoCommunication": 32817, - "BadWaitingForInitialData": 32818, - "BadNodeIdInvalid": 32819, - "BadNodeIdUnknown": 32820, - "BadAttributeIdInvalid": 32821, - "BadIndexRangeInvalid": 32822, - "BadIndexRangeNoData": 32823, - "BadDataEncodingInvalid": 32824, - "BadDataEncodingUnsupported": 32825, - "BadNotReadable": 32826, - "BadNotWritable": 32827, - "BadOutOfRange": 32828, - "BadNotSupported": 32829, - "BadNotFound": 32830, - "BadObjectDeleted": 32831, - "BadNotImplemented": 32832, - "BadMonitoringModeInvalid": 32833, - "BadMonitoredItemIdInvalid": 32834, - "BadMonitoredItemFilterInvalid": 32835, - "BadMonitoredItemFilterUnsupported": 32836, - "BadFilterNotAllowed": 32837, - "BadStructureMissing": 32838, - "BadEventFilterInvalid": 32839, - "BadContentFilterInvalid": 32840, - "BadFilterOperatorInvalid": 32961, - "BadFilterOperatorUnsupported": 32962, - "BadFilterOperandCountMismatch": 32963, - "BadFilterOperandInvalid": 32841, - "BadFilterElementInvalid": 32964, - "BadFilterLiteralInvalid": 32965, - "BadContinuationPointInvalid": 32842, - "BadNoContinuationPoints": 32843, - "BadReferenceTypeIdInvalid": 32844, - "BadBrowseDirectionInvalid": 32845, - "BadNodeNotInView": 32846, - "BadServerUriInvalid": 32847, - "BadServerNameMissing": 32848, - "BadDiscoveryUrlMissing": 32849, - "BadSempahoreFileMissing": 32850, - "BadRequestTypeInvalid": 32851, - "BadSecurityModeRejected": 32852, - "BadSecurityPolicyRejected": 32853, - "BadTooManySessions": 32854, - "BadUserSignatureInvalid": 32855, - "BadApplicationSignatureInvalid": 32856, - "BadNoValidCertificates": 32857, - "BadIdentityChangeNotSupported": 32966, - "BadRequestCancelledByRequest": 32858, - "BadParentNodeIdInvalid": 32859, - "BadReferenceNotAllowed": 32860, - "BadNodeIdRejected": 32861, - "BadNodeIdExists": 32862, - "BadNodeClassInvalid": 32863, - "BadBrowseNameInvalid": 32864, - "BadBrowseNameDuplicated": 32865, - "BadNodeAttributesInvalid": 32866, - "BadTypeDefinitionInvalid": 32867, - "BadSourceNodeIdInvalid": 32868, - "BadTargetNodeIdInvalid": 32869, - "BadDuplicateReferenceNotAllowed": 32870, - "BadInvalidSelfReference": 32871, - "BadReferenceLocalOnly": 32872, - "BadNoDeleteRights": 32873, - "UncertainReferenceNotDeleted": 16572, - "BadServerIndexInvalid": 32874, - "BadViewIdUnknown": 32875, - "BadViewTimestampInvalid": 32969, - "BadViewParameterMismatch": 32970, - "BadViewVersionInvalid": 32971, - "UncertainNotAllNodesAvailable": 16576, - "GoodResultsMayBeIncomplete": 186, - "BadNotTypeDefinition": 32968, - "UncertainReferenceOutOfServer": 16492, - "BadTooManyMatches": 32877, - "BadQueryTooComplex": 32878, - "BadNoMatch": 32879, - "BadMaxAgeInvalid": 32880, - "BadSecurityModeInsufficient": 32998, - "BadHistoryOperationInvalid": 32881, - "BadHistoryOperationUnsupported": 32882, - "BadInvalidTimestampArgument": 32957, - "BadWriteNotSupported": 32883, - "BadTypeMismatch": 32884, - "BadMethodInvalid": 32885, - "BadArgumentsMissing": 32886, - "BadTooManySubscriptions": 32887, - "BadTooManyPublishRequests": 32888, - "BadNoSubscription": 32889, - "BadSequenceNumberUnknown": 32890, - "BadMessageNotAvailable": 32891, - "BadInsufficientClientProfile": 32892, - "BadStateNotActive": 32959, - "BadTcpServerTooBusy": 32893, - "BadTcpMessageTypeInvalid": 32894, - "BadTcpSecureChannelUnknown": 32895, - "BadTcpMessageTooLarge": 32896, - "BadTcpNotEnoughResources": 32897, - "BadTcpInternalError": 32898, - "BadTcpEndpointUrlInvalid": 32899, - "BadRequestInterrupted": 32900, - "BadRequestTimeout": 32901, - "BadSecureChannelClosed": 32902, - "BadSecureChannelTokenUnknown": 32903, - "BadSequenceNumberInvalid": 32904, - "BadProtocolVersionUnsupported": 32958, - "BadConfigurationError": 32905, - "BadNotConnected": 32906, - "BadDeviceFailure": 32907, - "BadSensorFailure": 32908, - "BadOutOfService": 32909, - "BadDeadbandFilterInvalid": 32910, - "UncertainNoCommunicationLastUsableValue": 16527, - "UncertainLastUsableValue": 16528, - "UncertainSubstituteValue": 16529, - "UncertainInitialValue": 16530, - "UncertainSensorNotAccurate": 16531, - "UncertainEngineeringUnitsExceeded": 16532, - "UncertainSubNormal": 16533, - "GoodLocalOverride": 150, - "BadRefreshInProgress": 32919, - "BadConditionAlreadyDisabled": 32920, - "BadConditionAlreadyEnabled": 32972, - "BadConditionDisabled": 32921, - "BadEventIdUnknown": 32922, - "BadEventNotAcknowledgeable": 32955, - "BadDialogNotActive": 32973, - "BadDialogResponseInvalid": 32974, - "BadConditionBranchAlreadyAcked": 32975, - "BadConditionBranchAlreadyConfirmed": 32976, - "BadConditionAlreadyShelved": 32977, - "BadConditionNotShelved": 32978, - "BadShelvingTimeOutOfRange": 32979, - "BadNoData": 32923, - "BadBoundNotFound": 32983, - "BadBoundNotSupported": 32984, - "BadDataLost": 32925, - "BadDataUnavailable": 32926, - "BadEntryExists": 32927, - "BadNoEntryExists": 32928, - "BadTimestampNotSupported": 32929, - "GoodEntryInserted": 162, - "GoodEntryReplaced": 163, - "UncertainDataSubNormal": 16548, - "GoodNoData": 165, - "GoodMoreData": 166, - "BadAggregateListMismatch": 32980, - "BadAggregateNotSupported": 32981, - "BadAggregateInvalidInputs": 32982, - "BadAggregateConfigurationRejected": 32986, - "GoodDataIgnored": 217, - "BadRequestNotAllowed": 32996, - "GoodEdited": 220, - "GoodPostActionFailed": 221, - "UncertainDominantValueChanged": 16606, - "GoodDependentValueChanged": 224, - "BadDominantValueChanged": 32993, - "UncertainDependentValueChanged": 16610, - "BadDependentValueChanged": 32995, - "GoodCommunicationEvent": 167, - "GoodShutdownEvent": 168, - "GoodCallAgain": 169, - "GoodNonCriticalTimeout": 170, - "BadInvalidArgument": 32939, - "BadConnectionRejected": 32940, - "BadDisconnect": 32941, - "BadConnectionClosed": 32942, - "BadInvalidState": 32943, - "BadEndOfStream": 32944, - "BadNoDataAvailable": 32945, - "BadWaitingForResponse": 32946, - "BadOperationAbandoned": 32947, - "BadExpectedStreamToBlock": 32948, - "BadWouldBlock": 32949, - "BadSyntaxError": 32950, - "BadMaxConnectionsReached": 32951 - } - } - Property { name: "isGood"; type: "bool"; isReadonly: true } - Property { name: "isBad"; type: "bool"; isReadonly: true } - Property { name: "status"; type: "Status"; isReadonly: true } - } - Component { - name: "OpcUaValueNode" - prototype: "OpcUaNode" - exports: ["QtOpcUa/ValueNode 5.12"] - exportMetaObjectRevisions: [0] - Property { name: "value"; type: "QVariant" } - Property { name: "serverTimestamp"; type: "QDateTime"; isReadonly: true } - Property { name: "sourceTimestamp"; type: "QDateTime"; isReadonly: true } - Signal { - name: "valueChanged" - Parameter { name: "value"; type: "QVariant" } - } - Method { - name: "setValue" - Parameter { type: "QVariant" } - } - } - Component { - name: "QOpcUaApplicationDescription" - exports: ["QtOpcUa/ApplicationDescription 5.13"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "ApplicationType" - values: { - "Server": 0, - "Client": 1, - "ClientAndServer": 2, - "DiscoveryServer": 3 - } - } - Property { name: "applicationUri"; type: "string"; isReadonly: true } - Property { name: "productUri"; type: "string"; isReadonly: true } - Property { name: "applicationName"; type: "QOpcUaLocalizedText"; isReadonly: true } - Property { - name: "applicationType" - type: "QOpcUaApplicationDescription::ApplicationType" - isReadonly: true - } - Property { name: "gatewayServerUri"; type: "string"; isReadonly: true } - Property { name: "discoveryProfileUri"; type: "string"; isReadonly: true } - Property { name: "discoveryUrls"; type: "QList<QString>"; isReadonly: true } - } - Component { - name: "QStandardItemModel" - prototype: "QAbstractItemModel" - Property { name: "sortRole"; type: "int" } - Signal { - name: "itemChanged" - Parameter { name: "item"; type: "QStandardItem"; isPointer: true } - } - } -} diff --git a/src/opcua/client/qopcuatype.h b/src/opcua/client/qopcuatype.h index ca4619b..66c699e 100644 --- a/src/opcua/client/qopcuatype.h +++ b/src/opcua/client/qopcuatype.h @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE namespace QOpcUa { Q_OPCUA_EXPORT Q_NAMESPACE +Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") // see OPC-UA Part 3, 5.2.3 & 8.30 enum class NodeClass { diff --git a/src/opcua/doc/qtopcua.qdocconf b/src/opcua/doc/qtopcua.qdocconf index a7ee03b..41d9bf1 100644 --- a/src/opcua/doc/qtopcua.qdocconf +++ b/src/opcua/doc/qtopcua.qdocconf @@ -5,9 +5,9 @@ description = An OPC UA module for Qt version = $QT_VERSION sourcedirs += .. \ - ../../imports + ../../declarative_opcua headerdirs += .. \ - ../../imports + ../../declarative_opcua exampledirs += ../../../examples/opcua imagedirs += images diff --git a/sync.profile b/sync.profile index f09d676..4e8f6a3 100644 --- a/sync.profile +++ b/sync.profile @@ -1,5 +1,6 @@ %modules = ( # path to module name map "QtOpcUa" => "$basedir/src/opcua", + "QtDeclarativeOpcua" => "$basedir/src/declarative_opcua", ); %moduleheaders = ( # restrict the module headers to those found in relative path ); |