I have an editable QComboBox *m_combo_name. I modify/correct the text as the user type
QString mod_name = ....
and write the modifed text back, thus:
Qt Code:
  1. m_combo_name->lineEdit()->setText(mod_name);
To copy to clipboard, switch view to plain text mode 
That works fine, but when I try to add more items, from a list, QList<QString> optional_names, thus
Qt Code:
  1. for (int i=0; i<optional_names->size(); i++){
  2. m_combo_name->insertItem(i+1, optional_names.at(i));
  3. }
To copy to clipboard, switch view to plain text mode 
the text in the combobox' LineEdit gets overwritten (I want to preserve the text in the LineEdit). I thought I could avoid that by using the index i+1, but it makes no difference. What am I doing wrong?

Another question: is it possible to open the drop-list, from code, when new items are added? In the same manner as Wikipedia.