separed QSqlQuery for different windows
This commit is contained in:
parent
450b8d4f2d
commit
511c6ea84b
|
@ -15,6 +15,9 @@ EditWindow::EditWindow(int idSocio, QWidget* parent) : QMainWindow(parent), ui(n
|
|||
comboFonte = this->findChild<QComboBox*>("comboFonte");
|
||||
checkAbilitaQuestionario = this->findChild<QCheckBox*>("checkAbilitaQuestionario");
|
||||
|
||||
/* connect query with common database */
|
||||
query = QSqlQuery(db);
|
||||
|
||||
/* retrieve professione and fonte from database */
|
||||
query.prepare("SELECT id, professione FROM professione ORDER BY professione");
|
||||
query.exec();
|
||||
|
|
|
@ -40,6 +40,8 @@ private:
|
|||
QComboBox* comboFonte = nullptr;
|
||||
QCheckBox* checkAbilitaQuestionario = nullptr;
|
||||
|
||||
QSqlQuery query;
|
||||
|
||||
Ui::EditWindow *ui;
|
||||
};
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ private slots:
|
|||
|
||||
private:
|
||||
SociModel* sociModel = nullptr;
|
||||
QSqlQuery query;
|
||||
|
||||
QLineEdit* lineNome = nullptr;
|
||||
QLineEdit* lineCognome = nullptr;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include "db.h"
|
||||
|
||||
QSqlDatabase db;
|
||||
QSqlQuery query;
|
Loading…
Reference in New Issue