Have a go hero – Extending the game

There are a lot of subtle improvements you can make in the project. For example, you can change the title of the main window (by editing its windowTitle property), add accelerators to the actions, disable the board buttons that do nothing on click, remove the status bar, or use it for displaying the game status.

As an additional exercise, you can try to modify the code we wrote in this chapter to allow playing the game on boards bigger than 3 × 3. Let the user decide the size of the board (you can modify the game options dialog for that and use QSlider and QSpinBox to allow the user to choose the size of the board), and you can then instruct TicTacToeWidget to build the board based on the size it gets. ...

Get Game Programming using Qt 5 Beginner's Guide - 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.