Re: QcomboBox autoCompletion
Write a validator and set it with QComboBox::setValidator().
Re: QcomboBox autoCompletion
thanks for replying,
I can't figure it out how to write the QValidator::validate to accomplich my requirements,
maybe I could check when user lost focus from the combo and put the closest string from the possible items.
thanks again
Re: QcomboBox autoCompletion
Don't give up. It's not so complicated! :)
QComboBox uses a QStringListModel. Pass a QStringList fetched from the model to the validator to validate against. Here's a pseudo algo suggestion for QValidator::validate()
Code:
if stringlist contains input
return Acceptable
else if input is empty or any string in the stringlist starts with input
return Intermediate
else
return Invalid