After providing the server's address and port and choosing a username, the user can connect to the server:
void TcpClient::on_connect_clicked() { //... if (m_socket->state() != QAbstractSocket::ConnectedState) { ui->chat->appendPlainText(tr("== Connecting...")); m_socket->connectToHost(ui->address->text(), ui->port->value()); //... } }