Adding the Windows implementation

Remember the UML diagram at the beginning of this chapter? The SysInfoWindowsImpl class is one of the classes derived from the SysInfo class. The main purpose of this class is to encapsulate the Windows-specific code to retrieve CPU and memory usage.

It's time to create the SysInfoWindowsImpl class. To do that, you need to perform the following steps:

  1. Right click on the ch02-sysinfo project name in the hierarchy view
  2. Click on Add New | C++ Class | Choose
  3. Set the Class name field to SysInfoWindowsImpl
  4. Set the Base class field to <Custom> and write under the SysInfo class
  5. Click on Next then Finish to generate an empty C++ class

These generated files are a good starting point, but we must tune them:

#include ...

Get Mastering Qt 5 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.