@raven-worx said in QCompleter in QTableView: show always, even before user input:
declare the m_Editor variable as mutable.
This makes it compile (even though I'm not sure about the implications), but it doesn't help me: there is no Show event handled in editorEvent ever (tested with printf-debugging - yes, before the test for QLineEdit), I'm only getting Mouse events.
@SGaist said in QCompleter in QTableView: show always, even before user input:
Something like completer->popup()->show(); should do what you want.
Nope, does not help.
I figured (using qDebug, again), the place where I should put my popup-opening call is setEditorData. In there, I receive the QLineEdit and it's QCompleter: But I cannot make it show the popup. I tried now:
completer->setCompletionPrefix(index.data(Qt::EditRole).toString()); completer->complete(); completer->popup()->show();Note: Sometimes the popup is shown for a very short time, but immediately hides. When repeatedly entering & leaving edit mode this only works the first time.