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

Real time search feature #6

Closed
rocketman768 opened this Issue Apr 3, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@rocketman768
Copy link
Member

rocketman768 commented Apr 3, 2015

From launchpad

It would be very handy if the ingredient list windows had some sort of search field, allowing us to search for some text string, and having the list view update to show only the matching items.
For example, I could then type "cara" in the search field and it would show me also items named like "Simpsons - Caramalt".

@dpettersson

This comment has been minimized.

Copy link
Contributor

dpettersson commented Sep 16, 2015

Should the searchfield be a permanent textfield or a popup?
Which is the preferred style?
I have a (almost) working solution.
[SOLVED]
The only thing that causes me problems is that the rows tends to change size when they have been filtered. Any ideas about what might be causing it would be appreciated, :)

@theophae

This comment has been minimized.

Copy link
Contributor

theophae commented Sep 19, 2015

I found why the row size change. It is because of this line
tableWidget->verticalHeader()->setDefaultSectionSize(20);
By the way, I do prefer when the lines are thinner, so it would be better change their default height, but this is my opinion.

@dpettersson

This comment has been minimized.

Copy link
Contributor

dpettersson commented Sep 19, 2015

That line "fixed" the problem. The problem was this:
When the filter was applied some of the lines became 2 rows (instead of 1). It changed back when i changed the search phrase.
I tested to find the same height as the other windows and 20 seemed to be the correct number. I also searched for how to set the height and the solution i used was the one i found. I will change it if you can point me at the correct function. :) I am fairly new to Qt-development so i appreciate all comments and tips that i get. :)

@theophae

This comment has been minimized.

Copy link
Contributor

theophae commented Sep 19, 2015

I got the problem by searching something that give not result then I erased the filter field and I got thinner lines.
I don't work on Brewtarget for very long time too, so I can help you that much.

@theophae

This comment has been minimized.

Copy link
Contributor

theophae commented Sep 21, 2015

About the size of the lines, I think it would be better to set it like this:

parentTableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
parentTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);

in

FermentableTableModel::FermentableTableModel(QTableView* parent, bool editable)

This will handle the line height for all table occurrences (dialog & fermentable tab)

You should also remove all the occurrences of

if(parentTableWidget)
{
   parentTableWidget->resizeColumnsToContents();
   parentTableWidget->resizeRowsToContents();
}

In my view, they become useless.

EDIT: After some test, I must say that my solution is not complete. I must find a better way to resize table row and column. I am thinking to use a SIGNAL/SLOT to update table display at any changes. But I haven't something fully working yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment