Answer the question
In order to leave comments, you need to log in
Qt: how to make the editor in the table behave differently when pressing Tab?
I already asked a question about this: Qt: how to check if a combobox is expanded?
So, the combobox editor in QTableView is set up. But the questions continue. It turned out that the editor behaves funny when you press Tab: it just jumps to another table cell. You should jump to the next component in tab order.
tabKeyNavigation for the table is, of course, disabled. If the cursor is on a non-editable cell (there are some), everything is in order.
Answer the question
In order to leave comments, you need to log in
QModelIndex EditableTable::moveCursor(
CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
{
switch (cursorAction) {
case QAbstractItemView::MoveNext:
case QAbstractItemView::MovePrevious:
return QModelIndex();
break;
default:
return Super::moveCursor(cursorAction, modifiers);
}
}
Then write your own class inherited from QTableView, in the keyboard handler of which you will write everything as you like)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question