The client

The graphical user interface of the client (TcpClient) is pretty simple. It has three input fields to define the server's address (ui->address), the server's port (ui->port), and a username (ui->user). Of course, there is also a button to connect to (ui->connect) and disconnect from (ui->disconnect) the server. Finally, the GUI has a text edit that holds the received messages (ui->chat) and a line edit (ui->text) to send messages.

Get Game Programming Using Qt now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.