Quote:
Originally Posted by DiapDealer
|
Even Fusion always descends on right arrow.
It is so silly. Deep inside QTreeView in a routine called moveCursor there is the following stylehint:
bool descend = style()->styleHint(QStyle::SH_ItemView_ArrowKeysNavigateIn toChildren, nullptr, this);
We need that style to always return false for the MetaEditor QTreeView but not for any other one in a different class.
I am just not sure how to go about it as the moveCursor routine can be overridden but the damn thing uses too many Qt private methods and I can not replicate its logic so I can not easily override it with our own MetaEditorTreeView::moveCursor routine.
So we can force a stylehint for Windows and some Linux (but we already do that at times and it leads to a mess especially on Windows with all the astyles and bstyles and stuff) but that would not be correct for all tree views.
I can not override the damn QTreeView::moveCursor routine since it uses a bunch of Qt private methods, handles visibility and updates the viewport when collapsing or expanding an entry. I do not know how to do all of that without using Qt private header routines.
This is just so stupid.
Update: It turns out the moveCursor routine is invoked from the keyPressEvent routine, so I will try overriding it there. Why on earth Qt defaults to the right and left arrow keys doing strange things here is beyond me. At least MacOS is sane here.