Clearing a QTtableview
General and Desktop
4
Posts
2
Posters
896
Views
1
Watching
-
Hi All,
I'm fairly new to QT but am having an issue with clearing QT table view. Basically I have two tables views, one filled with items that I can drag and drop to the second one. What I'd like to do is click on a clear button to erase the items from the second view.
I've tried clear but that class function doesn't exist, I tried
[code]
QItemSelectionModel *mod2 = ui->tableView_2->selectionModel();while( mod2->model( )->rowCount( ) ) { mod2->model()->removeRow( 0, &mod2 ); }
[/code]
I thought I could use removeRow, however I don't know what the second parameter should be or even if I did would it clear the box?
Can anyone advise on this please? I think I'm talking myself in circles. Thanks.