How to do it...

Follow these steps to create a TCP server:

  1. First, let's create a Qt Console Application project from File | New File or Project, as shown in the following screenshot:
  1. After that, go to File | New File or Project again. But this time, select C++ Class under the C++ category, as shown in the following screenshot:
  1. Then, name your class as server. Set its base class to QObject and make sure the Include QObject option is checked before clicking the Next button. Once the class has been created, two files will be created for you— ...

Get Qt5 C++ GUI Programming Cookbook - Second Edition 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.