QOpcUaComplexNumber Class | Qt OPC UA 6.4.1

- Qt 6.4
- Qt OPC UA
- C++ Classes
- QOpcUaComplexNumber
- Qt 6.4.1 Reference Documentation

# QOpcUaComplexNumber Class

The OPC UA ComplexNumber type. More...

Header: | #include <QOpcUaComplexNumber>
CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: | QT += opcua

- List of all members, including inherited members

## Public Functions

| QOpcUaComplexNumber(float real, float imaginary)
QOpcUaComplexNumber & | operator=(const QOpcUaComplexNumber &rhs)
float | imaginary() const
float | real() const
void | setImaginary(float imaginary)
void | setReal(float real)
QVariant | operator QVariant() const
bool | operator==(const QOpcUaComplexNumber &rhs) const

## Detailed Description

The ComplexNumberType defined in OPC-UA part 8, 5.6.4. It stores a complex number with float precision.

## Member Function Documentation

### QOpcUaComplexNumber::QOpcUaComplexNumber(float real, float imaginary)

Constructs a complex number with real part real and imaginary part imaginary.

### QOpcUaComplexNumber &QOpcUaComplexNumber::operator=(const QOpcUaComplexNumber &rhs)

Sets the values from rhs in this complex number.

### float QOpcUaComplexNumber::imaginary() const

Returns the imaginary part of the complex number.

See also setImaginary().

### float QOpcUaComplexNumber::real() const

Returns the real part of the complex number.

See also setReal().

### void QOpcUaComplexNumber::setImaginary(float imaginary)

Sets the imaginary part of the complex number to imaginary.

See also imaginary().

### void QOpcUaComplexNumber::setReal(float real)

Sets the real part of the complex number to real.

See also real().

### QVariant QOpcUaComplexNumber::operator QVariant() const

Converts this complex number to QVariant.

### bool QOpcUaComplexNumber::operator==(const QOpcUaComplexNumber &rhs) const

Returns `true` if this complex number has the same value as rhs.