I have implemented a simple QAbstractTableModel
and attached it to a QTableView
in Qt5. How can I trigger a repaint from a timer? The data changes every second?
My naïve attempt does not work (no repaint occurs):
connect(timer,SIGNAL(timeout()),table,SLOT(update()));
timer->start(1000);
When data changes you should emit the dataChanged signal from the model.