QCompleter forces double enter
I have a QCompleter that is forcing my users to hit enter twice when the popup is visible but is not used to select an item. The model for the QComboBox associated to the completed is used as the model for the completer.
QCompleter *completer = new QCompleter(this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setModel(this->ui->comboBox->model());
this->ui->comboBox->setCompleter(completer);
As the user enters items the list of possible completions grows. If they start to type short completions (e.g. "dir") where there are longer completions available, and they hit without choosing anything from the popup (i.e. neither activated, highlited, or indexchanged get fired) then they are forces to hit enter again to process the text they entered. I开发者_JAVA技巧s there a simple way around this?
thanks
I tried it with Qt 4.6.2 and Visual 2008 and the situation you describe does not happen. project available if you want to try.
Compile, start, type 'something' then returb in combobox : it's registered, type 'some' and return : your combobox now has "some" and "somewhere"
精彩评论