venom00 | 1 May 22:37 2011

RE: Too much options in LyX

> hideView() doesn't work as this is only called when the Ok or Close
> button are pressed. Not when the dialog is canceled by Escape.
> 
> Maybe you should put the resetSearch function in a showEvent function
> which is called when the dialog is shown.

OK, that's a good idea, this makes the patch more self-contained, but I'll use
hideEvent. showEvent is called after the widget is shown, that's not what we
want.

> However, you should then set the text in the textfield and then
> manually reset all widgets to enabled. This means you have to either
> block the signals, but better .. listen to textEdited instead of
> textChanged.
> > +
> > +	connect(search_, SIGNAL(textChanged(QString)), this,
> > SLOT(filterChanged(QString)));
> 
> 
> textChanged -> textEdited so that this will not react to
> programmatically changing the text in the search box as a
> consequence of resetSearch() for instance.

Why we don't want that? It's correct: "search_->setText(QString())" re-enables
all the widgets automatically. See below.

> > +bool matches(QString & input, QString const & search)
> 
> QString const & input ... ?
> > +{
(Continue reading)

Vincent van Ravesteijn | 1 May 22:56 2011

Re: Too much options in LyX

>> However, you should then set the text in the textfield and then
>> manually reset all widgets to enabled. This means you have to either
>> block the signals, but better .. listen to textEdited instead of
>> textChanged.
>>> +
>>> +	connect(search_, SIGNAL(textChanged(QString)), this,
>>> SLOT(filterChanged(QString)));
>>
>>
>> textChanged -> textEdited so that this will not react to
>> programmatically changing the text in the search box as a
>> consequence of resetSearch() for instance.
> 
> Why we don't want that? It's correct: "search_->setText(QString())" re-enables
> all the widgets automatically. See below.

The problem is that when you rely on the signal you also wait
for 300 ms, which is not what you want if you programmaticaly
change the text.

I guess this is no issue when you use hideEvent instead of
showEvent, though I like to avoid this delay if it is not
necessary.

>  
>>> +bool matches(QString & input, QString const & search)
>>
>> QString const & input ... ?
>>> +{
>>> +	// Check if the input contains the search string
(Continue reading)


Gmane