Pregunta

I have a QLineEdit plus a QListView widget,

  1. When then QListView is visible, the completer should be disabled.
  2. Otherwise the completer is enabled.

But it appears like there's no enable/disable interface for QCompleter. What should I do then?

¿Fue útil?

Solución

Removing the completer from the QLineEdit will effectively disable it, you can later set it back again to enable it. To remove it, call QLineEdit::setCompleter(QCompleter*) with a null pointer. Use the same member function to set/restore it again later.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top