QInferenceStep Class
The QInferenceStep class is the base class for pipeline steps that produce or consume data. More...
| Header: | #include <QInferenceStep> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS EdgeAi)target_link_libraries(mytarget PRIVATE Qt6::EdgeAi) |
| qmake: | QT += edgeai |
| Inherits: | QObject |
| Inherited By: | QInferenceResultParser, QInferenceVideoSource, and QVisionInference |
| Status: | Technical Preview |
Properties
- category : QString
- inputPorts : QList<QInferenceDataPort*>
- outputPorts : QList<QInferenceDataPort*>
- ready : bool
Public Functions
| QInferenceStep(QObject *parent = nullptr) | |
| void | addConnection(QInferenceConnection *connection) |
| QString | category() const |
| int | connectTo(QInferenceStep *sink) |
| QList<QInferenceConnection *> | connections() const |
| QInferenceBackendStep * | implementation() const |
| QList<QInferenceDataPort *> | inputPorts() const |
| bool | isReady() const |
| QVariantMap | options() const |
| QList<QInferenceDataPort *> | outputPorts() const |
| QInferenceDataPort * | port(QInferenceDataPort::Direction direction, QInferenceDataPort::Type type) const |
| QInferenceDataPort * | port(QInferenceDataPort::Direction direction, const QString &name) const |
| void | setOption(const QString &key, const QVariant &value) |
| void | setOptions(const QVariantMap &options) |
Signals
| void | categoryChanged() |
| void | connectionsChanged() |
| void | dataAvailable(const QVariant &data, const QString &portName) |
| void | inputPortsChanged() |
| void | outputPortsChanged() |
| void | ready() |
Protected Functions
| void | setCategory(const QString &category) |
| void | setImplementation(QInferenceBackendStep *impl) |
Detailed Description
QInferenceStep provides input and output ports (QInferenceDataPort), connections to other steps, and a readiness state. Subclasses such as QInferenceVideoSource, QVisionInference, and QInferenceResultParser implement specific step types. The backend implementation is provided by a QInferenceBackendStep, created by a QInferenceBackendFactory.
See also QInferenceDataPort, QInferenceConnection, QInferenceFlow, inputPorts, and outputPorts.
Property Documentation
[read-only] category : QString
This property holds the category of this step, for example "vision", "videosource", or "parser".
QInferenceBackendFactory uses the category to dispatch to the correct provider.
Access functions:
| QString | category() const |
Notifier signal:
| void | categoryChanged() |
See also setCategory().
[read-only] inputPorts : QList<QInferenceDataPort*>
This property holds the list of input ports of this step.
Access functions:
| QList<QInferenceDataPort *> | inputPorts() const |
Notifier signal:
| void | inputPortsChanged() |
See also outputPorts and inputPortsChanged().
[read-only] outputPorts : QList<QInferenceDataPort*>
This property holds the list of output ports of this step.
Access functions:
| QList<QInferenceDataPort *> | outputPorts() const |
Notifier signal:
| void | outputPortsChanged() |
See also inputPorts and outputPortsChanged().
[read-only] ready : bool
This property holds whether the step's implementation is set and reports ready.
The property is false until the backend implementation finishes initializing, at which point the ready() signal is emitted and the property turns true.
Access functions:
| bool | isReady() const |
Notifier signal:
| void | ready() |
See also ready() and implementation().
Member Function Documentation
[explicit] QInferenceStep::QInferenceStep(QObject *parent = nullptr)
Constructs a QInferenceStep with the given parent.
The implementation is not set until a subclass assigns it, typically through QInferenceBackendFactory.
void QInferenceStep::addConnection(QInferenceConnection *connection)
Appends connection to this step's explicit connection list. The step takes ownership of connection.
See also connections().
int QInferenceStep::connectTo(QInferenceStep *sink)
Connects this step to sink by iterating over all output ports, finding a matching input port on sink for each port type (QInferenceDataPort::Type), and connecting the pairs.
Returns the number of output ports for which the connection succeeded on the corresponding input port. Returns 0 when either step has no implementation, when there are no output or input ports, or when no matching type pairs could be linked. If multiple outputs match, each successful link increments the count; a failed pair does not affect counts from other pairs.
For explicit wiring, use QInferenceConnection or QInferenceDataPort::connectTo().
See also QInferenceDataPort::connectTo() and QInferenceDataPort::Type.
QList<QInferenceConnection *> QInferenceStep::connections() const
Returns the list of explicit port connections for this step. Each connection names a source port, a target step, and a target port. QInferenceFlow uses this list when connecting steps.
See also QInferenceConnection, addConnection(), and connectionsChanged().
[signal] void QInferenceStep::connectionsChanged()
This signal is emitted when the list of connections changes.
See also connections().
[signal] void QInferenceStep::dataAvailable(const QVariant &data, const QString &portName)
This signal is emitted when new data is available on this step. data contains the payload; portName identifies the output port the data came from.
QInferenceBackendStep *QInferenceStep::implementation() const
Returns the backend implementation for this step, or nullptr if not set.
See also setImplementation().
[signal] void QInferenceStep::inputPortsChanged()
This signal is emitted when the list of input ports changes.
Note: Notifier signal for property inputPorts.
See also inputPorts.
QVariantMap QInferenceStep::options() const
Returns the free-form options map for this step. The options map carries extra configuration that providers may read when constructing a backend step, such as a variant name or model parameters, in addition to the typed properties exposed by step subclasses.
See also setOptions() and setOption().
[signal] void QInferenceStep::outputPortsChanged()
This signal is emitted when the list of output ports changes.
Note: Notifier signal for property outputPorts.
See also outputPorts.
QInferenceDataPort *QInferenceStep::port(QInferenceDataPort::Direction direction, QInferenceDataPort::Type type) const
Returns the port with the given direction and type, or nullptr if not found.
See also port(), inputPorts(), and outputPorts().
QInferenceDataPort *QInferenceStep::port(QInferenceDataPort::Direction direction, const QString &name) const
Returns the port with the given direction and name, or nullptr if not found.
See also port(), inputPorts(), and outputPorts().
[signal] void QInferenceStep::ready()
This signal is emitted when the step's implementation finishes initialization and the step can be added to the pipeline.
Note: Notifier signal for property ready.
See also isReady().
[protected] void QInferenceStep::setCategory(const QString &category)
Sets the category of this step to category. Subclasses typically call this in their constructor before invoking QInferenceBackendFactory::createBackendStep().
See also category.
[protected] void QInferenceStep::setImplementation(QInferenceBackendStep *impl)
Sets the backend implementation for this step to impl and wires the impl's signals to this step's signals (ready, dataAvailable, port-list changes). Subclasses call this after constructing the backend step via QInferenceBackendFactory.
See also implementation().
void QInferenceStep::setOption(const QString &key, const QVariant &value)
Inserts value into the options map under key, overwriting any previous value for that key.
See also options() and setOptions().
void QInferenceStep::setOptions(const QVariantMap &options)
Replaces the options map with options.
© 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.