Skip to content

UI improvment#85

Description

@jo-mueller

馃殌 Pitch: Add more info to the treeview elements

Motivation

We are having a number of issues (#73, #76, #67) which I think have the same common root cause, as pointed out by @psobolewskiPhD: The QTreeView is not the single source of truth when loading images into the viewer. The other problem is that clicking on some elements of the TreeView (i.e., the ">" icons), triggers unintended multiple loading operations and ultimately even segfaults (not sure where exactly those even come from, tbh).

Improving the UI

While I love the current UI and especially the ThumbGrid, I feel like the UI lacks a few information that are relevant to me when I browse data:

  • Image ID
  • Image dimensions - when I browse a large dataset and visualize a sample, I may want to not pick the largest one, if it can be avoided
  • Channel names

That being said, I'd also want to have a look at the thumbnail, obviously before loading the data, as that's probably the whole point of a thumbnail in the first place. Thus, I suggest to integrate the thumbnail and additional information directly into the QTreeView, which could, in practice, look something like this (just meddled a bit with pyqt):

Image

The additional space now taken up by the QThumbGrid would then be freed to either make more space for the QTreeView or a possible Preview area, which could show the Thumbnail in a larger space, along with a Load button, which would get rid of the implict image loading upon selecting an entry in the TreeView, and, I suppose, the segfaults. It would also considerably remove complexity because the widget wouldn't have to check what data was already in the viewer.

Implementation

Implementation-wise, it should be possible to populate the TreeView with QStandardItems as it is already done right now. By adding these without text, the tree structure in its current form would be maintained. Instead of setting text data in QStandardItem, a CustomWidget could be created and set at the item's index using setIndexWidget(index, widget).

Another option would be to use QStyledItemDelegates for QTreeViewItems, but with that I'm not so familiar myself.

LMKWYT about it. Looking forward to feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions