PDA

View Full Version : QTableView Problem



Eduardo Huerta
26th October 2019, 21:20
Hi, I have a problem with my QTableView where I show the values contained in a vector that has data contained in a structure. My problem is that the last value of the vector is not shown in the QTableView, I already checked the code (tableModel based on the example of Qt AddressBook) and I don't find the error, I have also tried to update the cell where this data should be contained and the last value of the vector still does not appear in the QTableView. Another question I have is because the functions like columnCount (), rowCount (), headerData () etc. of the QAbstractTableModel, do they run without being invoked? Finally, how can I highlight the first row of the QTableView (last vector data).
Add codes.
Thanks for your help.

ChristianEhrlicher
27th October 2019, 06:49
if(index.row()>=realDataValues.size() || index.row()<=0)


Not your last row is not shown but your first.