Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.11.2
-
None
-
-
7863be311570fa219066df5fe8720d5b92ddb680 (qt/qtbase/5.12) 37c24c6b1b65c2ff9808e5c2e2a18cf496e4a9db (qt/qtbase/5.12)
Description
When using NoItemFlags on some cells of a QTableWidget you can't navigate the corresponding lines with Home/End or Ctrl+Home/End. (respective PageUp/PageDown)
The navigation with those keys will not work (stays at the current cell), because the target cell is ignored. It would be preferable if the navigation would jump to the last cell that can be navigated to instead.
If you use the frozencolumn example in Qt Creator you can just add the following to main.cpp in order to make the last item non selectable:
QStandardItem *newItem = new QStandardItem();
newItem->setFlags(Qt::NoItemFlags);
model->setItem(model->rowCount() - 1, model->columnCount() - 1, newItem);
Keep in mind that you need to have the item in the view to test this properly. I suggest reducing the number of rows and columns to something like 3.
I included my adjusted frozencolumn project for testing purposes
For further information see:
https://forum.qt.io/topic/97252/table-navigation-with-noitemflags