diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2017-03-03 08:11:44 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2017-03-30 05:51:23 +0000 |
commit | d09ec5d8f496b7e3b5bdfef52f48e2d301be99f1 (patch) | |
tree | 18ca5380240c73fef605c99bc9133557553a2047 /src/serialbus/qcanbusfactory.cpp | |
parent | dc124162efeabe90b9025789391d1f0e15cef0f1 (diff) |
QCanBusFactory: Restore binary compatibility to Qt 5.8
Added a new QCanBusFactoryV2 to load plugins with the
new virtual function availableDevices().
To be able to still load plugins compiled against Qt 5.8,
both factories have to be considered when loading plugins
and creating devices.
Change-Id: I843cdd0b82193e391699daa298454c8b9522e860
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/serialbus/qcanbusfactory.cpp')
-rw-r--r-- | src/serialbus/qcanbusfactory.cpp | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/src/serialbus/qcanbusfactory.cpp b/src/serialbus/qcanbusfactory.cpp index db6c294..0a0e9b7 100644 --- a/src/serialbus/qcanbusfactory.cpp +++ b/src/serialbus/qcanbusfactory.cpp @@ -42,39 +42,72 @@ QT_BEGIN_NAMESPACE \class QCanBusFactory \inmodule QtSerialBus \since 5.8 + \deprecated \brief The QCanBusFactory class is a factory class used as the plugin interface for CAN bus plugins. All plugins must implement the functions provided by this factory class. + + This class is deprecated, you should use QCanBusFactoryV2 instead. + + \sa QCanBusFactoryV2 */ /*! - \fn QList<QCanBusDeviceInfo> QCanBusFactory::availableDevices(QString *errorMessage) const + \fn QCanBusDevice *QCanBusFactory::createDevice(const QString &interfaceName, + QString *errorMessage) const - Returns the list of available devices and their capabilities for the QCanBusDevice. + Creates a new QCanBusDevice. The caller must take ownership of the returned pointer. + \a interfaceName is the CAN interface name and \a errorMessage contains an error description in case of failure. + If the factory cannot create a plugin, it returns \c nullptr. +*/ + +/*! + \internal + + \fn QCanBusFactory::~QCanBusFactory() +*/ + +/*! + \class QCanBusFactoryV2 + \inmodule QtSerialBus \since 5.9 + + \brief The QCanBusFactoryV2 class is a factory class used as the + plugin interface for CAN bus plugins. + + All plugins must implement the functions provided by this factory class. */ /*! - \fn QCanBusDevice *QCanBusFactory::createDevice(const QString &interfaceName, + \fn QCanBusDevice *QCanBusFactoryV2::createDevice(const QString &interfaceName, QString *errorMessage) const Creates a new QCanBusDevice. The caller must take ownership of the returned pointer. - \a interfaceName is the network/CAN interface name. + \a interfaceName is the CAN interface name and \a errorMessage contains an error description in case of failure. If the factory cannot create a plugin, it returns \c nullptr. */ /*! - \internal + \fn QList<QCanBusDeviceInfo> QCanBusFactoryV2::availableDevices(QString *errorMessage) const - \fn QCanBusFactory::~QCanBusFactory() + Returns the list of available devices and their capabilities for the QCanBusDevice. + + \a errorMessage contains an error description in case of failure. */ +/*! + * \internal + */ +QCanBusFactoryV2::~QCanBusFactoryV2() +{ +} + QT_END_NAMESPACE |