Commit Graph

18 Commits

Author SHA1 Message Date
Lucie Gérard 664d2a1cf0 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: Ifc22d8ae24532e9a1093ca613ed6590a1992bc39
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-10 15:13:12 +02:00
Juha Vuolle bb419a4c60 Remove unsupported Android bluetooth codepaths
Minimum Android level supported on Qt 6 is Android 6 / API Level 23.
This commit removes older unsupported code in order to simplify.

This concerns primarily:
- sdkVersion() checks
- Java reflections (API availability was uncertain)

Task-number: QTBUG-102497
Pick-to: 6.2 6.3
Change-Id: Ia90248a0a8f8e32130b8394998c2676c97a02eb5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2022-05-12 09:06:30 +03:00
Marc Mutz 4d975c3ffc Port simple cases of count() to size()
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>
2022-04-11 15:21:46 +02:00
Ivan Solovev adcfc156f4 BtChat: fix crash when no adapter is found
The example was assuming that QBluetoothLocalDevice::allDevices() always
returns a non-empty list.
This is not true for the cases when desktop has no bluetooth adapters,
as well as for WinRT implementation (it always returns empty list for now).

This patch fixes the crash and provides some information messages to the
console. Note that WinRT implementation has an extended warning, because
it returns an empty list even if the adapter actually exists.

Fixes: QTBUG-98323
Pick-to: 6.2
Change-Id: Iaa81465cf6be2febf20526c11909667fd60728b3
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-11-16 09:58:31 +01:00
Ville Voutilainen 7d2c6ae66f Remove AndroidExtras dependencies and port to new Qt 6 Android APIs
Task-number: QTBUG-93811
Change-Id: Ia3eb9ad90f27614db5997e1f41f13e050f5f4ab7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
2021-06-04 15:08:23 +03:00
Andreas Buhr 67c772e950 QtBluetooth examples: make server device discoverable
When trying the bluetooth examples on devices which do not know
each other, they do not find each other, because the have to be
paired first. This could lead to some frustration. This patch
sets the server device into discoverable mode first.

Change-Id: I2873f957d36a45cd86e282e274e198e560a243ad
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-02-22 17:59:28 +01:00
Andreas Buhr 764c1d056f Beautify btchat: Leave focus on text input on send message
With this patch, one can use btchat like every chat application:
Just type a message, press return, type the next message. Before,
it was necessary to move the focus to the text input again after each
message.

Change-Id: I534143340284477810c93bbeebabb5d02132a208
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-02-15 13:07:28 +01:00
Andreas Buhr d4f9117935 Beautify btchat example: print a newline after error messages
Change-Id: Ia13637a4fce69460423d0ca5afaebca62df5d085
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-02-15 13:07:09 +01:00
Oliver Wolff f1aea39b23 Clean up btchat example
- Replace old connect syntax
- Clean up includes
- Replace 0 with nullptr
- Add socket error handling

Change-Id: Id4c7634db29a23184d3ce2d92ffa39c71505de12
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2018-08-16 09:21:25 +00:00
Kai Koehne b171cddac0 Fix outdated BSD license header
Change-Id: I28f5936913a6127806325df34af4bf71a142e72e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2017-10-17 11:17:54 +00:00
Alex Blasche cb1403c242 Adjust btchat example to Android UUID SDP discovery bug
Task-number: QTBUG-61392
Change-Id: Ia7d680a40b0fe359dfb5fe69ad9f3e83fe9ccb7d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-06-28 13:30:06 +00:00
Jani Heikkinen 7354c6d393 Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I3822a6484e8f7a420330de1cb1aeb0c3d1cf41b7
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2015-02-16 11:48:42 +00:00
Alex Blasche 8be9bf4cea New QML based Bt chat client
Change-Id: I235c54591dbbf04aa58c024093beca8c068b4aed
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-09-30 14:04:54 +02:00
Alex Blasche 85de7d64e8 Fix peer to peer communication using two local adapters.
The code assumed to use the default adapter in a variety of places
which caused wrong SDP registrations, device searches and peer names.

The btchat examples was extended to cope with two local adapters. If there are
more than two local adapters they will be ignored.

Change-Id: I27d8bce65d943773e4e6cbd86982446fa79664a4
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-09-25 10:37:27 +02:00
Fabian Bumberger d8d903826d Merge QRfcommServer and QL2capServer to QBluetoothServer
Task-number: QTBUG-32722

Change-Id: Ia75ad5af2f81b737a8cca09dba919a7dc0fa0f8a
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2013-08-29 14:06:54 +02:00
Alex Blasche b0cca9bdd0 Remove code related to dead or currently unsupported platforms
- Removes the Meego/Maemo backend for QtNfc
- Remove Simulator, WinCE and S60 remnants from the examples

If any of these platforms becomes relevant they can be added back
of course.

Change-Id: I84712ea07f01794b622560ce77e08cee347406e3
Reviewed-by: Michael Zanetti <michael.zanetti@canonical.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Alex <alexander.blasche@digia.com>
2013-07-25 14:30:14 +02:00
Alex Blasche 8dad4698d9 Update Copyright headers
- Update Digia's copyright year
- Add copyright to files without it
- Convert old BSD to new LGPL license for auto test code

Change-Id: I47f5c871c436f9c2731b235026434448719cc671
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-06-25 10:08:54 +02:00
Jerome Pasion d8a179128c Qt Bluetooth: Modularized documentation
-moved documentation to src/bluetooth/doc
-added a qdocconf file for Qt Bluetooth
-fixed relative paths for snippets
-moved examples to examples/bluetooth

Change-Id: Id41bac50dca628400568d191f1c3ccfbaac790a1
Reviewed-by: Alex <ablasche@gmail.com>
2012-09-27 14:43:52 +02:00