So I took a look at the QSqlTableModel C++ source code, and I noticed that there's an if statement in there that checks if the index has the flag ItemIsEditable set. If it isn't, then it returns false.
Now in the example I was adapting from (Which was this one that is subclassing a QSortFilterProxyModel rather than QSqlTableModel, and was using boolean values and doing other things as well) did NOT set that flag in the overridden flags() method! I assume that's done somewhere else, but I only adapted what I needed. I didn't even know it was a flag you could set since I've never really done this before. Should've looked more carefully at the example I guess...
Anyway, after setting that flag in the flags method it now works as expected. Here's what the method is looking like now if anyone is interested:
def flags(self, index):
if self.headerData(index.column(), Qt.Horizontal) in ("Game", "Console", "Accessory",
"Box", "Manual"):
return Qt.ItemIsUserCheckable | Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsEditable
else:
return super().flags(index)
You can also set the return statement to simply:
return super().flags(index) | Qt.ItemIsUserCheckable
And it'll work just the same. That's actually probably a better/cleaner way of doing it now that I think about it.