On 10/28/22 21:31, DFS wrote: > I found one person that said they did it but their syntax didn't work. > But it doesn't throw an error either. > > model.setData(model.index(tblRow, col), font, Qt.FontRole)
I wouldn't expect that to work but it's understandable why it didn't throw an error. setData() is used to edit the contents of the model at the provided index. Remember a model can store anything. All this does is replace whatever was at that index with a Font object instance. I'm puzzled why you keep trying to mess with the model when it's the view that does the actual font setting. Remember that a single model can be used with more than one view at the same time, each view implementing its own style. Thus a model has no information like fonts in it, nor should it, other than perhaps HTML text markup that the view will render. Did you consult the folk on the PyQt mailing list? Or even the main Qt lists? This isn't language-specific stuff you're asking about. -- https://mail.python.org/mailman/listinfo/python-list