Qt 5.10 Book Examples
MyClient.h
Go to the documentation of this file.
1 // ======================================================================
2 // MyClient.h
3 // ======================================================================
4 // This file is a part of the book
5 // "Qt 5.10 Professional programming with C++"
6 // http://qt-book.com
7 // ======================================================================
8 // Copyright (c) 2017 by Max Schlee
9 // ======================================================================
10 
11 #pragma once
12 
13 #include <QWidget>
14 #include <QTcpSocket>
15 
16 class QTextEdit;
17 class QLineEdit;
18 
19 // ======================================================================
20 class MyClient : public QWidget {
21 Q_OBJECT
22 private:
23  QTcpSocket* m_pTcpSocket;
24  QTextEdit* m_ptxtInfo;
25  QLineEdit* m_ptxtInput;
26  quint16 m_nNextBlockSize;
27 
28 public:
29  MyClient(const QString& strHost, int nPort, QWidget* pwgt = 0) ;
30 
31 private slots:
32  void slotReadyRead ( );
33  void slotError (QAbstractSocket::SocketError);
34  void slotSendToServer( );
35  void slotConnected ( );
36 };
MyClient(const QString &strHost, int nPort, QWidget *pwgt=0)
Definition: MyClient.cpp:16