January 2016
Beginner
512 pages
12h 35m
English
Create a new
Qt Widgets Application project. After the project infrastructure is ready, choose New File or Project from the File menu and choose to create a C++ Class. Call the new class ChessBoard and set QObject as its base class. Repeat the process to create a GameAlgorithm class derived from QObject and another one called ChessView but, this time, choose QWidget as the base class. You should end up with a file named main.cpp and four classes—MainWindow, ChessView, ChessBoard, and ChessAlgorithm.
Now navigate to the header file for ChessAlgorithm and add the following methods to the class:
public: ChessBoard* board() const; public slots: virtual void newGame(); signals: void boardChanged(ChessBoard*); ...