The count() methods on QByteArray and QString are deprecated. The ones
on other Qt containers will likely follow soon, so port them all to
size().
The changes which also require int -> qsizetype will come in a
follow-up patch.
Pick-to: 6.3
Change-Id: I23e364019b9cfc457d93f4a3bb4660fe8d790da8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Since Qt 6.3 Windows has a QBluetoothLocalDevice support which can be
used to provide the address.
Fixes: QTBUG-102007
Pick-to: 6.3
Change-Id: I214c43983bfcc323fcd6b01436ed82577c0c4450
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Since 6.2 there are in-class initializations for many of the
variables. In addition the Windows backend does not use
the socket that is created.
Pick-to: 6.2 6.3
Change-Id: I371b9b23aee54c49aa8fc71f86c2e8ecbbbfc407
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The COM apartment model needs to be initialized before use, but
the existing CoInitialize/CoUninitialize pairs don't cover all COM
usage in bluetooth. This may be a problem for non-gui applications
whose main thread's apartment model may not be implicitly initialized
by Qt baseclasses.
This commit adds initialization calls to the classes that use COM.
Fixes: QTBUG-101953
Pick-to: 6.2 6.3
Change-Id: I07a8a5dc38cdbd150794056cb91074f478765e53
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
There were two logging categories on Windows:
qt.bluetooth.winrt and qt.bluetooth.windows. As there is now only
one Windows backend, multiple logging categories are not required.
This patch removes qt.bluetooth.winrt and changes all usages
to qt.bluetooth.windows.
Change-Id: I3f42774e77326fa30f3f7bff6cac8160bf4e644f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This patch changes QBluetooth::Security and
QBluetooth::AttAccessConstraint to be scoped
enums for improved type safety.
Fixes: QTBUG-91906
Change-Id: Ife4797aa8e106690a10e4fcb7f623877023fbb3c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Currently, there is a name clash between the error getter and
the error signal. This leads to extensive use of qOverload or
similar. This patch renames all error signals to errorOccurred
to resolve this.
Task-number: QTBUG-62877
Change-Id: I615e2405f855433b6e142d820072c4d3f35ae28f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
We have to unlock the mutex locker after the pending connection is
handled in QBluetoothServerPrivate::handleClientConnection. Otherwise
the application will hang, if the slot that is connected to
QBluetoothServer::newConnection calls
QBluetoothServer::hasPendingConnections as this functions also tries to
lock the mutex.
Fixes: QTBUG-81827
Change-Id: I40632d0c1e4a6cf4436f6471e5a0933c53dda9f1
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This change enables the optional use of the Win32-based Bluetooth
backend on Windows. By default, the WinRT backend is used, if
supported by the platform. The use of the Win32 backend must be
selected by the -native-win32-bluetooth configuration option.
Task-number: QTBUG-40698
Change-Id: I6904bf077467d826e3ff5ad026ebae5f955f2e37
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Instead of checking for a certain Windows version, we should check
whether the API is actually available
[ChangeLog][QtBluetooth][Windows] Enabled UWP backend for desktop
Windows versions that support the API
Task-number: QTBUG-61566
Change-Id: I8384119c70cc2c4bdcdbe6b297cfcf5fb3e3f534
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
If there are no pending connections, the call should not make
the application crash but just return nullptr.
Change-Id: I33c2ec9b47bbb72abc99ad22035f794724b295ef
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
We have to use a similar approach to the one that is used on android
as the ComPtr cannot reliably passed as an int.
Change-Id: Ia52c78d4725fb3240eafa62fcb55531a282c0cd3
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>