i have subclass a QTableView to display row limit ... and is model model->setEditStrategy(QSqlTableModel::OnManualSubmit) ;
How i can access last query to update the 2° database back-up to?
/* save all DirtySQL true value and reset DirtySQL to false */
void Mysql_Table::BigCommit()
{
if (model->submitAll()) {
model->database().commit();
DirtySQL = false;
emit ModelError(true);
return;
} else {
model->database().rollback();
if (!haveindex) {
tr("The database reported an error: %1\nAnd table not having index!").arg(model->lastError().text()));
} else {
tr("The database reported an error: %1").arg(model->lastError().text()));
}
emit ModelError(false);
return;
}
}
/* save all DirtySQL true value and reset DirtySQL to false */
void Mysql_Table::BigCommit()
{
if (model->submitAll()) {
model->database().commit();
DirtySQL = false;
emit ModelError(true);
return;
} else {
model->database().rollback();
if (!haveindex) {
QMessageBox::warning(0, tr("Table %1 ").arg(table),
tr("The database reported an error: %1\nAnd table not having index!").arg(model->lastError().text()));
} else {
QMessageBox::warning(0, tr("Table %1 ").arg(table),
tr("The database reported an error: %1").arg(model->lastError().text()));
}
emit ModelError(false);
return;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks