Voonter
5th April 2014, 17:39
I have 2 classes, one is a mainwindow (iherits from QMainWindow), and second is addwindow (iherits from QDialog). In mainwindow I have QTableView connected with database, and buttons like "add data", "remove data". In addwindow I put data and click "ok" button to add data to database. Now, how could I call "tablica->select()" to update QTableView after clicked "ok" button in addwindow?
Problem is that QSqlRelationalTableModel associated with QTableView is included in mainwindow constructor, and method adddata is included in addwindow class.
There are my header and c++ files.
1026410265102661026710268
EDIT: I just found after hours, that thing I supposed to do was add connection in clicking "add data" slot in mainwindow class.
Problem is that QSqlRelationalTableModel associated with QTableView is included in mainwindow constructor, and method adddata is included in addwindow class.
There are my header and c++ files.
1026410265102661026710268
EDIT: I just found after hours, that thing I supposed to do was add connection in clicking "add data" slot in mainwindow class.