-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add filter/search to table viewer #2392
Add filter/search to table viewer #2392
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a few small things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
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 b7a0f67 for performance concerns, but performance seemed okay for the filtering component).Still to do:
Closes #2386