blob: 8e4299a49ce9d3e304066e75e8d4225853ccc6e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// -*- c++ -*-
#include <QtNetwork/QTcpSocket>
#include <QtNetwork/QTcpServer>
#include <QtWidgets/QTabWidget>
class Server
: public QObject
{
Q_OBJECT
public:
Server(QTabWidget& tabs, QObject *parent = 0);
signals:
void dataReceived(QByteArray);
private slots:
void newConnection();
void disconnected();
void readyRead();
private:
QTcpServer *server;
QTabWidget& tabs;
QByteArray payload;
int payload_size;
};
class MyTabs : public QTabWidget
{
Q_OBJECT
public:
MyTabs();
public slots:
void doCloseIt(int index);
};
|