PDA

View Full Version : On successful entry a new record, a new empty row will should be added to QTableView



nageshvk
27th October 2010, 05:27
hi

I want to create a blank row in QTableView.On successful entry a new record, a new empty row will should be added to QTableView. Could you please help me out.

Thank in advance
Nagesh

ChrisW67
27th October 2010, 07:59
I want to create a blank row in QTableView.
QAbstractItemModel::insertRow (int row, const QModelIndex & parent = QModelIndex())

On successful entry a new record, a new empty row will should be added to QTableView.
The call above will either insert a 'blank' row and return true, or fail and return false. Presumably you want the user to input some data before you declare a row is a 'successful entry'. You can detect when the user moves off your new row by overriding the currentChanged() protected method of the view.

nageshvk
27th October 2010, 11:23
Thank you for the reply. Could you please provide me an example.

what kind of listener i need to write to add a new row when user add data to last row
Regards
Nagesh