Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upNew option in the context menu for using the value as filter #1182
Conversation
MKleusberg
requested changes
Oct 20, 2017
|
Thank you for this PR. This is a very good idea and a pretty good and simple implementation |
| if (!index.isValid() || !selectionModel()->hasSelection()) | ||
| return; | ||
|
|
||
| m_tableHeader->setFilter(index.column(), "=" + model()->data(index).toString()); |
This comment has been minimized.
This comment has been minimized.
MKleusberg
Oct 20, 2017
Member
One minor thing here: you should probably use the Qt::EditRole in the data() call here. We use that to get the actual, unmodified cell data instead of what is shown to the user. Without this, 1) a low 'Symbol limit in cell' option can mean that we're filtering for the truncated string, 2) filtering for a BLOB value would literally filter for 'BLOB' which doesn't seem right either, and 3) filtering for NULL values wouldn't work if the 'NULL fields Text' option is set to something other than 'NULL'.
When changing to Qt::EditRole you'll need to check for isNull() though and filter for '=NULL' if that's true. Currently this works sort of automatically but only as long as the null text is set to 'NULL' in the settings.
This comment has been minimized.
This comment has been minimized.
|
@MKleusberg I hope I have addressed your requests. Thanks for the feedback. |
justinclift
added
the
enhancement
label
Oct 21, 2017
This comment has been minimized.
This comment has been minimized.
|
Yes, that's perfect |
MKleusberg
merged commit 5cef432
into
sqlitebrowser:master
Oct 21, 2017
1 check passed
This comment has been minimized.
This comment has been minimized.
|
Thank you. In fact I'm working on updating the Spanish translation so you can expect at least one more :-) |
This comment has been minimized.
This comment has been minimized.
|
Awesome |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

mgrojo commentedOct 20, 2017
Added an option in the context menu of the extended table widget for using the currently selected cell value as filter for this column. This allows quick filtering by visible values.