So I have been writing a Sudoku game in C++. I have most of the game logic done and tested, but I wanted to use Qt on top of it for the GUI. I was trying to figure out the best way to work with the Qt classes for my needs.
As a test, I played around with QAbstractTableModel. I subclassed it and had it access my existing data model and my existing controllers. For now I am using QTableView to get basic rendering of the Sudoku board and basic "editing" (you can just change any value). It looks nothing like what I want, but the functionality is all there (or can be added).
I wanted to make a data model and controllers to modify it all in C++, without depending on a framework. Then I wanted to just have Qt sit on top. So I have this working, and here is a quick "diagram" of how these things communicate at a high level
QTableView?
^
|
v
PuzzleModel : QAbstractTableModel
^ |
| |_____________
| v
Real data model classes <------------ Controllers
My question is, how can I modify QTableView or should I create my own view or QWidget in order to display the data the way I want?
Ideally, I'd like to display a fixed size table (no headers, no resizing), and disallow multi-selecting. There are some customizations on how I'd render various font styles/colors, but I think I can handle that pretty easily. I'd also like to render each cell as either a number, or like this for "marks":
*-------------* *-------------*
| 1 2 3 | | ****** |
| 4 6 | | * |
| 8 9 | | * |
*-------------* *-------------*
So clearly I can't continue using QTableView out of the box. Do I create my own QStyledItemDelegate and still use QTableView? Do I need to create a whole Widget? If I create
Just looking for some advice/direction from someone who knows the capabilities of the various Qt classes.