jijoadoor71
16th May 2014, 07:59
I have a single QTableView(model based).I need to give focus on first row of QTableview while data displaying.While selecting first row, data will displays in line edit boxes.
I am not able to foucus on the first row selection. QSqlQueryModel i am using
If I manually clicked then its working,means first row data displaying in Line edit boxes.please suggest.
my code below
ui->TbleViewUserMgmt->setSelectionMode(QAbstractItemView::SingleSelecti on);
ui->TbleViewUserMgmt->selectRow(0);
ui->TbleViewUserMgmt->setFocus();
I am not able to foucus on the first row selection. QSqlQueryModel i am using
If I manually clicked then its working,means first row data displaying in Line edit boxes.please suggest.
my code below
ui->TbleViewUserMgmt->setSelectionMode(QAbstractItemView::SingleSelecti on);
ui->TbleViewUserMgmt->selectRow(0);
ui->TbleViewUserMgmt->setFocus();