Qt: QTableView how to add a row?

qt, qtableview

Solution

As you use som YourModel to show it in YourTableView (QTableView) should do like this:

YourModel->insertRow(YourModel->rowCount(QModelIndex()));
// paste some data to new row

update of model causes update of View

Problem

I have got a QTableView with data in it. What is the simplest way to add a row? Thanks!

Original source