QCanBusFactory 类

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

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

QCanBusFactoryV2

该类已过时。 提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

公共函数

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

详细描述

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

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

此类已弃用,应使用 QCanBusFactoryV2 代替。

另请参阅 QCanBusFactoryV2 .

成员函数文档编制

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

创建新的 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 .