Unsolved Update QTableView when my datasource gets a new record from remote server.
-
I implement a QAbstructTableModel, and I want insert a new row at the top of tableview when my datasource gets a new record from remote server. How to do this?
-
@ryman said in Update QTableView when my datasource gets a new record from remote server.:
when my datasource gets a new record from remote server
What do you mean by this? Do you mean something outside of your program causes the remote data source to now have an extra row? In which case, how does the remote know that has happened, and how would it inform your program that it had happened?
-
From https://doc.qt.io/qt-5/qabstractitemmodel.html#subclassing
implementation must call
beginInsertRows()
before inserting new rows into the data structure, andendInsertRows()
immediately afterwards.