Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.3, 6.2.3
-
None
-
macOS
Description
If you have a QTreeView with an expanded item and one of the item's children being selected, a keyboard navigation using the left key should select the parent item.
This works as expected on Windows and Linux. It fails on macOS. The reason is, that QTreeView::moveCursor checks for QStyle::SH_ItemView_ArrowKeysNavigateIntoChildren , and only performs selecting the parent if this is set.
https://github.com/qt/qtbase/blob/dev/src/widgets/itemviews/qtreeview.cpp#L2250-L2257
But for macOS this is always false:
This behaviour is confusing and inconsistent:
- The description of "SH_ItemView_ArrowKeysNavigateIntoChildren " states "Controls whether the tree view will select the first child when it is exapanded and the right arrow key is pressed.". But it is additionally used to control the navigation to parent.
- The behaviour is inconsistent with the behaviour in native macOS applications. E.g. in Finder's tree view this navigation leads to the selection of the parent.
Note that the behaviour for right navigation is indeed consistent with native tree views on macOS. A right navigation does not select the first child.