View Single Post
Old 10-16-2025, 03:31 PM   #137
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,062
Karma: 6361556
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DiapDealer View Post
Windows Sigil already uses the Fusion theme as its base:

https://github.com/Sigil-Ebook/Sigil.../main.cpp#L598

Or did you mean something else?
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.

Last edited by KevinH; 10-16-2025 at 04:35 PM.
KevinH is offline   Reply With Quote