Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto expand in Hdf5TreeView #4067

Closed
kklmn opened this issue Feb 19, 2024 · 2 comments
Closed

Auto expand in Hdf5TreeView #4067

kklmn opened this issue Feb 19, 2024 · 2 comments

Comments

@kklmn
Copy link

kklmn commented Feb 19, 2024

Hello,

At our beamline, several devices write their own h5 files that are soft-linked in the master file.
When we examine the files in silx view, we have to do multiple clicks to dig down to the actual data. When we do it on multiple data, this monkey business becomes annoying. This screenshot shows that each such file has multiple one-member groups:
image

I propose to add an option "auto expand singular groups" (or "auto expand simple branches" or similar) that would require only one click at the top level and it would go down to a group that has multiple members in it. There the auto expansion stops.

In the implementation, the class Hdf5TreeView(qt.QTreeView) can react to its expanded signal like this:

    def expandFurther(self, index):
        """Further expand a tree node if it has only one child."""
        model = self.model()
        if model.rowCount(index) == 1:
            child = model.index(0, 0, index)
            self.expand(child)

Thank you!

@vallsv
Copy link
Contributor

vallsv commented Feb 20, 2024

Hi.

Maybe i misunderstand something but what is the difference with the option [+] from the toolbar?

@kklmn
Copy link
Author

kklmn commented Feb 20, 2024

D'oh!
I've never used those buttons, probably because one tries them when the viewer is empty and then they do nothing.
image

@kklmn kklmn closed this as completed Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants