PDA

View Full Version : Adding a OK and Cancel button to QTableview



rex
24th July 2011, 17:32
Hello everyone, I wanted to know how i should add a OK and a Cancel button on QTableview. I am creating a QTableView and updating changes to the data base. I wanted do the changed only when i clicked OK or Cancel button. I am doing all the software using a IDE so i have not created any button or anything with code..

The below code opens up a window,when i click the EditData button.

QSqlTableModel *model3;
model3 = new QSqlTableModel;

model3->setTable("tempBulkdb");
model3->setEditStrategy(QSqlTableModel::OnFieldChange);
model3->select();

QTableView *view = new QTableView;
view->setModel(model3);

view->showMaximized();
view->setAlternatingRowColors(true);
view->resizeColumnsToContents();

i wanted to add a OK and a cancel button to this window. Pls help me out.
thank you