Well, as requested here comes the code:

Qt Code:
  1. class mainwindow : public QMainWindow {
  2. ...
  3. public:
  4. //declaring the SqlTable model
  5. //declaring the searchBox
  6. QLineEdit *searchBox;
  7. ...
  8. }
To copy to clipboard, switch view to plain text mode 

And later on in the implementation file:

Qt Code:
  1. //this submits all changes to the database
  2. void mainwindow::save() {
  3. model->submitAll();
  4. }
To copy to clipboard, switch view to plain text mode 

or even,
Qt Code:
  1. /*this funtion sets up everything in the toolbar (buttons, icons, descriptions of buttons, connections)
  2.   and menus*/
  3. void mainwindow::setting_up_toolbar_menus() {
  4. ...
  5. ui->toolBar->addWidget(searchBox);
  6. searchBox->show();
  7. QAction *searchAct;
  8. ...
  9. }
To copy to clipboard, switch view to plain text mode 

Hope this helps...