PDA

View Full Version : QCompleter popup item is not selectable using mouse



mvbhavsar
21st May 2021, 11:21
Hi All,

I am using QCompleter on QLineEdit. I am able to attach completer and popup is display with the filter of text I typed. The only challenge is that whatever filtered list is there I am able to select with arrow key but when I tried to select item from popup using mouse, it is not happening.
I have written below code.


QStringList frecs = {"One","Two","Three","Four","Five"}
QCompleter *completer = new QCompleter(frecs, this);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setFilterMode(Qt::MatchContains);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->popup()->installEventFilter(this);
ui->txSearch->setCompleter(completer);


Can anybody help to resolve this issue.

Cheers

Manish

d_stranz
21st May 2021, 15:35
What happens when you remove the event filter you have installed on the popup?

mvbhavsar
21st May 2021, 19:45
Event though I remove event filter no change and still mouse does not work.