Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
4.7.0, 5.4.2
-
None
-
Windows 7
Description
Steps to reproduce
- Create a standard QTreeView with the following properties:
setSelectionBehavior(QAbstractItemView::SelectRows);
setSelectionMode(QAbstractItemView::ExtendedSelection);
setAllColumnsShowFocus(false); - Add some columns and rows to the tree view
- Select a row with the mouse. Notice the focus rectangle around the column that was clicked with the mouse.
- Press left and right arrow keys on the keyboard. Notice that nothing happens to the focus rectangle.
Drawbacks
- When the contents is bigger than the view and both scrollbars are active, the left and right arrow keys will scroll the view horizontally. However, since the focus remains on the same column, pressing the up and down arrow keys will force the view to scroll horizontally if the focused column was moved out of view.
- If you want different context menus for different columns, the keyboard cannot be used.
Suggestions
- Move focus in response to the left and right arrow keys even if QAbstractItemView::SelectRows is the current selection behavior.