diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2018-09-18 13:53:24 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2018-10-09 07:47:56 +0000 |
commit | fac56a229b45395488f3e41bf178361c72b3ee1e (patch) | |
tree | ae99681642099d2bd3cb42fc66804f61c6f65aab /src/bluetooth/qbluetoothdeviceinfo.cpp | |
parent | 7ef3dfbd4354367ad78040010aa851943b7b9e75 (diff) |
Deprecate QBluetoothDeviceInfo::DataCompleteness with Qt 6 in mind
The patch deprecates the mentioned enum and all users of it. In addition,
QList usage is replaced by QVector (which is a design pattern in Qt).
Task-number: QTBUG-62425
Change-Id: I63e8dceb03ed231d0d06709896a1aad2b6bb31a3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothdeviceinfo.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothdeviceinfo.cpp | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothdeviceinfo.cpp b/src/bluetooth/qbluetoothdeviceinfo.cpp index bde8655e..5e26dea5 100644 --- a/src/bluetooth/qbluetoothdeviceinfo.cpp +++ b/src/bluetooth/qbluetoothdeviceinfo.cpp @@ -536,6 +536,8 @@ quint8 QBluetoothDeviceInfo::minorDeviceClass() const } /*! + \deprecated + Sets the list of service UUIDs to \a uuids and the completeness of the data to \a completeness. */ void QBluetoothDeviceInfo::setServiceUuids(const QList<QBluetoothUuid> &uuids, @@ -543,11 +545,38 @@ void QBluetoothDeviceInfo::setServiceUuids(const QList<QBluetoothUuid> &uuids, { Q_D(QBluetoothDeviceInfo); - d->serviceUuids = uuids; + d->serviceUuids = uuids.toVector(); d->serviceUuidsCompleteness = completeness; } /*! + Sets the list of service UUIDs to \a uuids. + \since 5.13 + */ +void QBluetoothDeviceInfo::setServiceUuids(const QVector<QBluetoothUuid> &uuids) +{ + Q_D(QBluetoothDeviceInfo); + d->serviceUuids = uuids; +} + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +/*! + Returns the list of service UUIDS supported by the device. Most commonly this + list of uuids represents custom uuids or a uuid value specified by + \l QBluetoothUuid::ServiceClassUuid. + + \sa serviceUuids() + \since 6.0 +*/ +QVector<QBluetoothUuid> QBluetoothDeviceInfo::serviceUuids() const +{ + Q_D(const QBluetoothDeviceInfo); + return d->serviceUuids; +} + +#else + +/*! Returns the list of service UUIDS supported by the device. If \a completeness is not 0 it will be set to DataComplete and the complete list of UUIDs supported by the device is returned. DataIncomplete if additional service UUIDs are supported by the device and DataUnavailable if @@ -562,10 +591,13 @@ QList<QBluetoothUuid> QBluetoothDeviceInfo::serviceUuids(DataCompleteness *compl if (completeness) *completeness = d->serviceUuidsCompleteness; - return d->serviceUuids; + return d->serviceUuids.toList(); } +#endif //QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) /*! + \deprecated + Returns the completeness of the service UUID list. If DataComplete is returned, serviceUuids() returns the complete list of service UUIDs supported by the device, otherwise only the partial or empty list of service UUIDs. To get a list |