Using Qt 4.8.5

I want a dynamic data model for a QCompleter installed in a QLineEdit. I connect the QLineEdit::textEdited signal to my own function that updates the model, which is my sub-class of QAbstractListModel. It begins as an empty model, but fills itself out on the third keystroke. No completions occur. If I full populate the model when constructed, all works. See code below. I do not know how to notify the QCompleter that the model has changed. I used 'beginResetModel()/endResetModel()' as a try.

Qt Code:
  1. // This slot is connected to the QLineEdit::textEdited signal.
  2. void MyaNameModel::Update(const QString &text)
  3. {
  4. if (text.size() < 3)
  5. { if (!names.empty())
  6. { m_names.clear(); // Clear data model's collection of names.
  7.  
  8. // Notify QCompleter that model has changed.
  9. beginResetModel();
  10. endResetModel();
  11. }
  12. }
  13. else if (m_names.empty())
  14. { // This extracts information from an external repository via in-house API.
  15. // It fills the container of names.
  16. m_ap.MatchChannel(Glob((text + "*").toAscii().data()), m_names);
  17.  
  18. // Notify QCompleter that model has changed.
  19. beginResetModel();
  20. endResetModel();
  21. }
  22. }
To copy to clipboard, switch view to plain text mode