QTableView Model data change Error.
Unsolved
General and Desktop
-
I use Linux 64Bit for Qt 5.4.
You want to set the Model in the QTableView.
We have not set backgroundColorRole in the data function of the model.
I want to change the background color of the 0,0 index after the model is created and set in the QTableView.
QModelIndex index = model-> index (0,0);
model-> setData (index, QColor (Qt :: blue), Qt :: BackgroundColorRole);model's setData has not been overridden.
The color does not change. How do I change it? -
@Pada_ said in QTableView Model data change Error.:
model's setData has not been overridden.
Then how should it work at all? https://doc.qt.io/qt-5/qabstractitemmodel.html#setData