diff options
-rw-r--r-- | src/bluetooth/qbluetoothuuid.cpp | 13 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothuuid.h | 5 | ||||
-rw-r--r-- | src/bluetooth/removed_api.cpp | 7 | ||||
-rw-r--r-- | tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp | 6 |
4 files changed, 13 insertions, 18 deletions
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp index ef6db13c..4a0f007b 100644 --- a/src/bluetooth/qbluetoothuuid.cpp +++ b/src/bluetooth/qbluetoothuuid.cpp @@ -561,19 +561,6 @@ quint128 QBluetoothUuid::toUInt128(QSysInfo::Endian order) const noexcept */ /*! - Creates a QBluetoothUuid object from the string \a uuid, - which must be formatted as five hex fields separated by '-', - e.g., "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where 'x' is a hex digit. - The curly braces shown here are optional, but it is normal to include them. - If the conversion fails, a null UUID is created. See \l QUuid::toString() for an - explanation of how the five hex fields map to the public data members in QUuid. -*/ -QBluetoothUuid::QBluetoothUuid(const QString &uuid) -: QUuid(uuid) -{ -} - -/*! \fn QBluetoothUuid::QBluetoothUuid(const QUuid &uuid) Constructs a new Bluetooth UUID that is a copy of \a uuid. diff --git a/src/bluetooth/qbluetoothuuid.h b/src/bluetooth/qbluetoothuuid.h index 07298da7..b0a7dcc2 100644 --- a/src/bluetooth/qbluetoothuuid.h +++ b/src/bluetooth/qbluetoothuuid.h @@ -352,15 +352,16 @@ public: : QUuid(uuid, 0x0, 0x1000, 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb) {}; // end of bluetooth-specific constructors; rest is essentially `using QUuid::QUuid;` + using QUuid::QUuid; #if QT_BLUETOOTH_REMOVED_SINCE(6, 6) explicit QBluetoothUuid(quint128 uuid); #endif QT6_ONLY(QT_POST_CXX17_API_IN_EXPORTED_CLASS) // quint128 changes based on QT_SUPPORTS_INT128! explicit QBluetoothUuid(quint128 uuid, QSysInfo::Endian order = QSysInfo::BigEndian) noexcept : QUuid{fromBytes(&uuid, order)} {} - explicit QBluetoothUuid(Id128Bytes uuid, QSysInfo::Endian order = QSysInfo::BigEndian) noexcept - : QUuid(uuid, order) {}; +#if QT_BLUETOOTH_REMOVED_SINCE(6, 6) // actually 6.3 (cf. QUuid) explicit QBluetoothUuid(const QString &uuid); +#endif QBluetoothUuid(const QBluetoothUuid &uuid) = default; QT_BLUETOOTH_INLINE_SINCE(6, 6) QBluetoothUuid(QUuid QT6_ONLY(const &)uuid); diff --git a/src/bluetooth/removed_api.cpp b/src/bluetooth/removed_api.cpp index da42f242..c4f37b68 100644 --- a/src/bluetooth/removed_api.cpp +++ b/src/bluetooth/removed_api.cpp @@ -39,6 +39,13 @@ quint128 QBluetoothUuid::toUInt128() const return uuid; } +// END quint128 functions + +QBluetoothUuid::QBluetoothUuid(const QString &uuid) + : QUuid(qToAnyStringViewIgnoringNull(uuid)) +{ +} + #ifndef QT_NO_DEBUG_STREAM QDebug QBluetoothUuid::streamingOperator(QDebug debug, const QBluetoothUuid &uuid) { diff --git a/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp b/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp index 6cff5c2e..218c9580 100644 --- a/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp +++ b/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp @@ -246,7 +246,7 @@ void tst_QBluetoothUuid::tst_conversion() if (constructUuid16) { QBluetoothUuid uuid(uuid16); - QCOMPARE(uuid, QBluetoothUuid(uuidS)); + QCOMPARE(uuid, QBluetoothUuid(QStringView{uuidS})); bool ok; @@ -268,7 +268,7 @@ void tst_QBluetoothUuid::tst_conversion() if (constructUuid32) { QBluetoothUuid uuid(uuid32); - QCOMPARE(uuid, QBluetoothUuid(uuidS)); + QCOMPARE(uuid, QBluetoothUuid(QLatin1StringView{uuidS.toLatin1()})); bool ok; @@ -293,7 +293,7 @@ void tst_QBluetoothUuid::tst_conversion() if (constructUuid128) { QBluetoothUuid uuid(uuid128); - QCOMPARE(uuid, QBluetoothUuid(uuidS)); + QCOMPARE(uuid, QBluetoothUuid(QUtf8StringView{uuidS.toUtf8()})); bool ok; |