Yes, I see you are calling begin / endResetModel(). You are missing the QFileSystemWatcher part to trigger the reload.But I reckon I'm missing the replacing part in my code!?
Your code to parse the CSV file looks overly complex. Why don't you simply read the text stream line-by-line into a QString using QTextStream::readLine() (instead of character-by-character), and then use QString::split() with ';' as the split character, and behavior set to KeepEmptyParts? You'd then get a QStringList for every row in the table and could replace about 20 lines of parsing code with 4.
Qt Code:
while ( !in.atEnd() ) { // appendToCSVMatrix( fields ); }To copy to clipboard, switch view to plain text mode
In fact, if all you are doing is reading a CSV file and displaying the fields in a table view, you can dispense with using a QAbstractTableModel entirely and simply use QTableWidget as is and insert the fields as QTableWidgetItem instances. Let your MainWindow handle watching the log file and reloading the table when needed.
Bookmarks