[SOLVED]Setting current row in QSqlTableModel
-
Hi,
Could you please guide me how can I set the current row in QSqlTableModel?
PS
I've QTableView and QComboBox both of them attached to same QSqlTableModel I want to set the current row in QTableView dependeing on selected index in QComboBox. I can get the selected index in QComboBox through currentIndexChanged(int index) slot but I don't know to set the current in QSqlTableModel.@void MainWindow::on_comboBox_find_currentIndexChanged(int index)
{
if (p_db.isOpen()) {
//! \bug doesn't select the row although the index is correct!
if (p_tableModel->selectRow(index)) {
qDebug() << index;
}
}
}@