How can I use completer in QComboBox when I use editable=false ?
I have a lot of data in database and completer will be usefull to find correct row.
Printable View
How can I use completer in QComboBox when I use editable=false ?
I have a lot of data in database and completer will be usefull to find correct row.
Using a completer with a combo box doesn't make any sense... You can use it with a line edit but a combo box already acts as a completer - start typing on your keyboard when it has focus and you'll see.
Standard completer in combobox (when editable=false) works only for first letter but I want add something like search term.
And how it should work if the combo box would be not editable? Make it editable and, as wysota said, it would be working as a completer.Quote:
How can I use completer in QComboBox when I use editable=false ?
You will need to write your own completer for that and set on combo box (QComboBox::setCompleter) .
You can have look at QCompleter examples in Tools section in Qt Demos.
You need to write to search, dont you ?
And by making combobox editable, it doesnt mean you can chage the existing entries. I guess combobox adds entries when u press return, but that behaviour can be easily overriden.
Can you explain what you try to achieve ?
You have told us what you have tried, but ur goals are still not clear. Might be there is a better way :)