I am working in Qt 4.7, and have a dialog containing (among other, unrelated things) a QTableView and a QButton. When the QButton is clicked, it must clear all the data from the QTableView. I am unsure on how to accompish this. I've looked around online for a while, but haven't found anything too helpful. Based on what I found here, I tried this:
void MyClass::on_myButton_clicked()
{
myTableView->model()->clear();
}
However, this gave the following error:
error: C2039: 'clear' : is not a member of 'QAbstractItemModel'
Is there another way to do this that I am accidentally overlooking? Thanks!