このページでは

QCanBusFactory Class

QCanBusFactory クラスは、CANバスプラグインのプラグインインターフェースとして使用されるファクトリクラスです。詳細...

ヘッダー: #include <QCanBusFactory>
CMake: find_package(Qt6 REQUIRED COMPONENTS SerialBus)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)
qmake: QT += serialbus

パブリック関数

virtual QList<QCanBusDeviceInfo> availableDevices(QString *errorMessage) const = 0
virtual QCanBusDevice *createDevice(const QString &interfaceName, QString *errorMessage) const = 0

詳細な説明

すべてのプラグインは、このファクトリクラスが提供する関数を実装する必要があります。

メンバ関数のドキュメント

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

QCanBusDevice に対して利用可能なデバイスとその機能の一覧を返します。

errorMessage 失敗した場合は、エラーの説明が含まれます。

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

新しいQCanBusDevice を作成します。呼び出し元は、返されたポインタの所有権を取得する必要があります。

interfaceName は CAN インターフェース名であり、errorMessage には、失敗した場合のエラー説明が含まれます。

ファクトリがプラグインを作成できない場合、nullptr を返します。

© 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.