Fix potential detaches when iterating over QMap::values()


Found by the Axivion code analyzer.
The obvious fix could be to store the result of var.values() calls
in a local const variable. However, we can do even better and avoid
creating a temporary list of values, because QMap::const_iterator
iterates over values.

As a result, drop the .values() calls and wrap the member variables
into std::as_const() to avoid potential detaches. Also add a comment
that mentions the behavior of QMap::const_iterator.

Axivion-Id: qt_Add-ons_qtbluetooth_dev_linux:SV215
Axivion-Id: qt_Add-ons_qtbluetooth_dev_linux:SV216
Task-number: QTBUG-144754
Pick-to: 6.11 6.8
Change-Id: I9c334d8cf8c874805e71662e69cc03b627154722
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
commitd961175081905d71b98efcf5637136ee9ac83f00
parent2cba3ce6187382e571dba61053b999ef5df7dc88
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeWed, 8 Apr 2026 09:48:13 +0200