QInferenceDataPort Class
The QInferenceDataPort class represents an input or output of a QInferenceStep through which data flows. More...
| Header: | #include <QInferenceDataPort> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS EdgeAi)target_link_libraries(mytarget PRIVATE Qt6::EdgeAi) |
| qmake: | QT += edgeai |
| Inherits: | QObject |
| Status: | Technical Preview |
Public Types
Properties
- connected : bool
Public Functions
| QInferenceDataPort(QInferenceBackendDataPort *implementation, QObject *parent = nullptr) | |
| bool | connectTo(QInferenceDataPort *other) |
| QInferenceDataPort::Direction | direction() const |
| bool | isConnected() const |
| QString | name() const |
| QInferenceDataPort::Type | type() const |
Signals
| void | connectedChanged() |
| void | dataAvailable(const QVariant &data) |
Detailed Description
Ports have a name(), a type() such as Video or Json, and a direction() of In or Out. Use connectTo() to connect an output port to an input port of another step.
See also QInferenceStep, QInferenceDataPort::Type, QInferenceDataPort::Direction, and connected.
Member Type Documentation
enum class QInferenceDataPort::Direction
This enum describes the direction in which data flows through a port.
| Constant | Value | Description |
|---|---|---|
QInferenceDataPort::Direction::In | 0 | Input port. |
QInferenceDataPort::Direction::Out | 1 | Output port. |
enum class QInferenceDataPort::Type
flags QInferenceDataPort::Types
This enum describes the type of data carried by a port.
| Constant | Value | Description |
|---|---|---|
QInferenceDataPort::Type::Text | 0x00001 | The port carries text data. |
QInferenceDataPort::Type::Audio | 0x00002 | The port carries audio data. |
QInferenceDataPort::Type::Video | 0x00004 | The port carries video data. |
QInferenceDataPort::Type::Image | 0x00008 | The port carries image data. |
QInferenceDataPort::Type::Json | 0x0010 | The port carries JSON data. |
The Types type is a typedef for QFlags<Type>. It stores an OR combination of Type values.
Property Documentation
[read-only] connected : bool
This property holds whether this port is connected to another port.
The property turns true once connectTo() links this port to another one, on both the source and the target port.
Access functions:
| bool | isConnected() const |
Notifier signal:
| void | connectedChanged() |
See also connectTo().
Member Function Documentation
[explicit] QInferenceDataPort::QInferenceDataPort(QInferenceBackendDataPort *implementation, QObject *parent = nullptr)
Creates a QInferenceDataPort with the given implementation and parent. The implementation must have its direction set before construction. QInferenceStep creates ports through this constructor; applications typically access ports through QInferenceStep::inputPorts(), outputPorts(), or port().
bool QInferenceDataPort::connectTo(QInferenceDataPort *other)
Connects this port to other, typically an output port to an input port of another step. Returns true if the connection succeeds; otherwise returns false. On success, the connected property turns true on both ports.
See also connected.
[signal] void QInferenceDataPort::dataAvailable(const QVariant &data)
This signal is emitted when data reaches this port.
QInferenceDataPort::Direction QInferenceDataPort::direction() const
Returns the direction of this port, either In or Out.
QString QInferenceDataPort::name() const
Returns the name of this port.
QInferenceDataPort::Type QInferenceDataPort::type() const
Returns the data type of this port, such as Video or Json.
See also Type.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.