QTableWidget moveCursor
-
I'm wondering if I found a Qt bug.
I overrode this function:
QModelIndex moveCursor (QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers)I find when I'm using the arrow keys to move the cursor downward, sometimes the cursor just disappears. This happens after the cursor has forced the table widget to scroll itself at least once.
The rows that I'm moving the cursor on really do exist in the model.
At the start of my moveCursor I print the current row and column. After the cursor disappears, these are -1.
Is there any need to call the superclass's moveCursor?
-
Hi,
Please share your implementation or even better a minimal compilable example that reproduces the behavior you see.
-
I'm wondering if I found a Qt bug.
I overrode this function:
QModelIndex moveCursor (QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers)I find when I'm using the arrow keys to move the cursor downward, sometimes the cursor just disappears. This happens after the cursor has forced the table widget to scroll itself at least once.
The rows that I'm moving the cursor on really do exist in the model.
At the start of my moveCursor I print the current row and column. After the cursor disappears, these are -1.
Is there any need to call the superclass's moveCursor?
@clarify said in QTableWidget moveCursor:
Is there any need to call the superclass's moveCursor?
As @SGaist said, it's difficult to guess without seeing any code.
But returning a randomly disappearing cursor is quite likely related to not returning to the superclass'smoveCursor().