1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <private/opcuamethodargument_p.h>
5
6/*!
7 \qmltype MethodArgument
8 \inqmlmodule QtOpcUa
9 \brief Arguments for OpcUa method calls.
10 \since QtOpcUa 5.13
11 \deprecated [6.9]
12
13 When calling methods which require arguments, this type is used.
14
15 This example shows how to call a method with two double arguments.
16 \code
17 QtOpcUa.MethodNode {
18 ...
19 inputArguments: [
20 QtOpcUa.MethodArgument {
21 value: 3
22 type: QtOpcUa.Constants.Double
23 },
24 QtOpcUa.MethodArgument {
25 value: 4
26 type: QtOpcUa.Constants.Double
27 }
28 ]
29 }
30 \endcode
31*/
32
33/*!
34 \qmlproperty variant MethodArgument::value
35
36 The value of the argument.
37*/
38
39/*!
40 \qmlproperty QOpcUa::Types MethodNode::type
41
42 Sets the type of the argument that is expected by the server.
43 The value variant is converted to that type when calling the method.
44 The type has to match the method on the server exactly, otherwise
45 the method call will fail.
46
47 \sa MethodNode::callMethod
48*/
49
50OpcUaMethodArgument::OpcUaMethodArgument(QObject *parent) : QObject(parent)
51{
52}
53
54QVariant OpcUaMethodArgument::value() const
55{
56 return m_value;
57}
58
59QOpcUa::Types OpcUaMethodArgument::type() const
60{
61 return m_type;
62}
63
64void OpcUaMethodArgument::setValue(QVariant value)
65{
66 m_value = value;
67}
68
69void OpcUaMethodArgument::setType(QOpcUa::Types type)
70{
71 m_type = type;
72}
73

source code of qtopcua/src/declarative_opcua/opcuamethodargument.cpp