QCanBusFactoryV2 类

The QCanBusFactoryV2 class is a factory class used as the plugin interface for CAN bus plugins. 更多...

头: #include <QCanBusFactoryV2>
qmake: QT += serialbus
Since: Qt 5.9
继承: QCanBusFactory

公共函数

virtual QList<QCanBusDeviceInfo> availableDevices (QString * errorMessage ) const = 0

重实现公共函数

virtual QCanBusDevice * createDevice (const QString & interfaceName , QString * errorMessage ) const = 0

详细描述

The QCanBusFactoryV2 class is a factory class used as the plugin interface for CAN bus plugins.

所有插件必须实现此工厂类提供的函数。

成员函数文档编制

[pure virtual] QList < QCanBusDeviceInfo > QCanBusFactoryV2:: availableDevices ( QString * errorMessage ) const

Returns the list of available devices and their capabilities for the QCanBusDevice .

errorMessage contains an error description in case of failure.

[pure virtual] QCanBusDevice *QCanBusFactoryV2:: createDevice (const QString & interfaceName , QString * errorMessage ) const

重实现自 QCanBusFactory::createDevice ().

创建新的 QCanBusDevice . The caller must take ownership of the returned pointer.

interfaceName is the CAN interface name and errorMessage contains an error description in case of failure.

如果工厂不能创建插件,它返回 nullptr .