Closed jfoster17 closed 1 year ago
Very nice! Let me know once you would like me to review this :) One request is whether we could hide the search box by default and have a viewer tool with a 'funnel' icon for filtering that when clicked would toggle the search box?
Very nice! Let me know once you would like me to review this :) One request is whether we could hide the search box by default and have a viewer tool with a 'funnel' icon for filtering that when clicked would toggle the search box?
I considered that. I think that it is better to have the search box by default because
Thus I think the friction of requiring a user to correctly identify and toggle the 'funnel' item for the most common interaction with a table is not worth the marginal cost of having a little bit less space in the viewer for showing the data.
@astrofrog -- this is ready for your review.
I presented at our glue weekly meeting and they were fine with having the search bar be shown all the time. The main request was to be able to toggle the regex search so that users won't be tripped up if they want to search for unescaped special characters; I have now added this button.
Add filter/search to the Table Viewer
Description
This PR adds a search/filter field and component selection widget to the Table Viewer. The displayed elements in the table are then filtered based on applying
re.search()
to the selected component. The primary motivation is to allow the user to use the GUI to find matching rows in a dataset and create a subset from those rows. I limit the user to searching on categorical components.This necessitated adding a TableViewerState in order to keep track of the things going into the filter.
I experimented with using
QSortFilterProxyModel
just for the filtering and although I was able to get a working implementation, I was then getting frequent segfaults that I was unable to diagnose. Since we are already doing sort within our customDataTableModel
it was easy enough to apply the filtering here as well. (I also that usingQSortFilterProxyModel
was rejected in b7a0f67500 for performance concerns, but performance seemed okay for the filtering component).Still to do:
Closes #2386