summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/btchat/chatclient.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth/btchat/chatclient.h')
-rw-r--r--examples/bluetooth/btchat/chatclient.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/bluetooth/btchat/chatclient.h b/examples/bluetooth/btchat/chatclient.h
index a2f2eafc..25002f90 100644
--- a/examples/bluetooth/btchat/chatclient.h
+++ b/examples/bluetooth/btchat/chatclient.h
@@ -51,9 +51,10 @@
#ifndef CHATCLIENT_H
#define CHATCLIENT_H
-#include <qbluetoothserviceinfo.h>
+#include <QtCore/qobject.h>
-#include <QtCore/QObject>
+#include <QtBluetooth/qbluetoothserviceinfo.h>
+#include <QtBluetooth/qbluetoothsocket.h>
QT_FORWARD_DECLARE_CLASS(QBluetoothSocket)
@@ -65,7 +66,7 @@ class ChatClient : public QObject
Q_OBJECT
public:
- explicit ChatClient(QObject *parent = 0);
+ explicit ChatClient(QObject *parent = nullptr);
~ChatClient();
void startClient(const QBluetoothServiceInfo &remoteService);
@@ -78,13 +79,15 @@ signals:
void messageReceived(const QString &sender, const QString &message);
void connected(const QString &name);
void disconnected();
+ void socketErrorOccurred(const QString &errorString);
private slots:
void readSocket();
void connected();
+ void onSocketErrorOccurred(QBluetoothSocket::SocketError);
private:
- QBluetoothSocket *socket;
+ QBluetoothSocket *socket = nullptr;
};
//! [declaration]