diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2023-03-16 18:26:38 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-03-20 18:51:13 +0000 |
commit | 0502cc6a2cc26f34d983a7b0554633b2ebda0294 (patch) | |
tree | 3c1bd5c83c0e2a945c78a83682101d14312e6ac9 /examples/bluetooth/btchat/remoteselector.cpp | |
parent | 2b71228cd36b2964635afe6f6501c9a4e9a93c30 (diff) |
BtChat example: improve code
Improve the example code according to guidelines:
* fix CMakeLists.txt by using qt_standard_project_setup() and PRIVATE
linking
* fix memory leak in Chat dialog
* fix includes
* fix forward declarations and do not use QT_USE_NAMESPACE
* use Qt::StringLiterals
* remove outdated warning for Windows platform
* split too long lines
Task-number: QTBUG-111972
Change-Id: I81e472cfacf8c6adf97b31e97254797d40b01519
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 30bb6406024831d8f79a0718da170eff7b41ff79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/bluetooth/btchat/remoteselector.cpp')
-rw-r--r-- | examples/bluetooth/btchat/remoteselector.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/bluetooth/btchat/remoteselector.cpp b/examples/bluetooth/btchat/remoteselector.cpp index a0a8430c..a7a9a00e 100644 --- a/examples/bluetooth/btchat/remoteselector.cpp +++ b/examples/bluetooth/btchat/remoteselector.cpp @@ -4,15 +4,20 @@ #include "remoteselector.h" #include "ui_remoteselector.h" +#include <QtBluetooth/qbluetoothaddress.h> #include <QtBluetooth/qbluetoothlocaldevice.h> #include <QtBluetooth/qbluetoothservicediscoveryagent.h> +#include <QtBluetooth/qbluetoothuuid.h> -QT_USE_NAMESPACE +#include <QtWidgets/qlistwidget.h> RemoteSelector::RemoteSelector(const QBluetoothAddress &localAdapter, QWidget *parent) : QDialog(parent), ui(new Ui::RemoteSelector) { ui->setupUi(this); +#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) + setWindowState(Qt::WindowMaximized); +#endif m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(localAdapter); |