Well, as requested here comes the code:
...
public:
//declaring the SqlTable model
//declaring the searchBox
...
}
class mainwindow : public QMainWindow {
...
public:
//declaring the SqlTable model
QSqlTableModel *model;
//declaring the searchBox
QLineEdit *searchBox;
...
}
To copy to clipboard, switch view to plain text mode
And later on in the implementation file:
//this submits all changes to the database
void mainwindow::save() {
model->submitAll();
}
//this submits all changes to the database
void mainwindow::save() {
model->submitAll();
}
To copy to clipboard, switch view to plain text mode
or even,
/*this funtion sets up everything in the toolbar (buttons, icons, descriptions of buttons, connections)
and menus*/
void mainwindow::setting_up_toolbar_menus() {
...
ui->toolBar->addWidget(searchBox);
searchBox->show();
...
}
/*this funtion sets up everything in the toolbar (buttons, icons, descriptions of buttons, connections)
and menus*/
void mainwindow::setting_up_toolbar_menus() {
...
ui->toolBar->addWidget(searchBox);
searchBox->show();
QAction *searchAct;
...
}
To copy to clipboard, switch view to plain text mode
Hope this helps...
Bookmarks