40 lines
771 B
C++
40 lines
771 B
C++
#ifndef MYSOCKET_H
|
|
#define MYSOCKET_H
|
|
|
|
#include <QTcpSocket>
|
|
#include <QHostAddress>
|
|
#include <QDebug>
|
|
#include <QDateTime>
|
|
#include <QThread>
|
|
#include <QMetaType>
|
|
#include <QImage>
|
|
|
|
|
|
|
|
class MySocket : public QTcpSocket
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit MySocket(qintptr sockDesc, QObject *parent = Q_NULLPTR);
|
|
~MySocket();
|
|
|
|
signals:
|
|
void IMGdataReady(const QString &ip, const QByteArray &data ,QString ImgName);
|
|
void LiveViewIMG(qintptr id , QImage img);
|
|
|
|
public slots:
|
|
void recvData(void);
|
|
void sendData(QString IP, const QByteArray &data);
|
|
void SocketError(QAbstractSocket::SocketError);
|
|
|
|
private:
|
|
qintptr m_sockDesc;
|
|
|
|
QString fileName;
|
|
QString fileType;
|
|
int fileSize;
|
|
QByteArray qByteArray;
|
|
};
|
|
|
|
#endif // MYSOCKET_H
|