chat.h Example File
btchat/chat.h
#include "ui_chat.h"
#include <QDialog>
#include <qbluetoothserviceinfo.h>
#include <qbluetoothsocket.h>
#include <qbluetoothhostinfo.h>
#include <QDebug>
QT_USE_NAMESPACE
class ChatServer;
class ChatClient;
class Chat : public QDialog
{
Q_OBJECT
public:
Chat(QWidget *parent = 0);
~Chat();
signals:
void sendMessage(const QString &message);
private slots:
void connectClicked();
void sendClicked();
void showMessage(const QString &sender, const QString &message);
void clientConnected(const QString &name);
void clientDisconnected(const QString &name);
void clientDisconnected();
void connected(const QString &name);
void newAdapterSelected();
private:
int adapterFromUserSelection() const;
int currentAdapterIndex;
Ui_Chat *ui;
ChatServer *server;
QList<ChatClient *> clients;
QList<QBluetoothHostInfo> localAdapters;
QString localName;
};