So...
There is a table QTableView tableViewMain.
there is a class TableAmdinWidget (let's call for an example like this =)), which manages various tables in the application, including this one.
in the declaration of this class, the AmdinWidgetSqlModel class inherited from QSqlQueryModel is connected. In which the methods are overridden
bool setData(const QModelIndex &index,const QVariant &value, int role);
And in general, the essence of the problem, when editing a tableViewMain, the data of other tables should be automatically updated. I cause in the designer TableAmdinWidget
QObject::connect(model,SIGNAL(dataChanged(QModelIndex,QModelIndex)),this,SLOT(initViewRez(QTableView*)));
Does not work
QObject::connect' : none of the 3 overloads could convert all the argument types
Explanations.
- In TableAmdinWidget there is a method that receives a pointer to a table.
- There is also an initViewRez slot (QTableView *) in which we put this pointer - it takes data from the database and displays it on the table.
- model is a pointer to the AmdinWidgetSqlModel class.
In general, somehow everything ... how to solve this problem. And as it is generally possible, if possible, so that when updating the model model , others would be updated automatically.