GUI: fix issue of text not displaying when jumping to table with Ctrl+0
This commit is contained in:
parent
2fe5490c39
commit
ebcef6a1ff
@ -834,6 +834,18 @@ void ResTable::setCurrentRowFromKbd(int row)
|
||||
LOGDEB1("setCurrentRowFromKbd: " << row << "\n");
|
||||
m_rowchangefromkbd = true;
|
||||
tableView->setFocus(Qt::ShortcutFocusReason);
|
||||
|
||||
// After calling setCurrentIndex(), currentChanged() gets called
|
||||
// twice, once with row 0 and no selection, once with the actual
|
||||
// target row and selection set. It uses this fact to discriminate
|
||||
// this from hovering. For some reason, when row is zero, there is
|
||||
// only one call. So, in this case, we first select row 1, and
|
||||
// this so pretty hack gets things working
|
||||
if (row == 0) {
|
||||
tableView->selectionModel()->setCurrentIndex(
|
||||
m_model->index(1, 0),
|
||||
QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Rows);
|
||||
}
|
||||
tableView->selectionModel()->setCurrentIndex(
|
||||
m_model->index(row, 0),
|
||||
QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Rows);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user