cic
27th September 2013, 08:40
Hello all,
after the completer is set to combobox,
the combobox doesn't have the items. is it correct?
QComboBox box;
box.setEditable(true);
//box.addItem("a1");
//box.addItem("a2");
//box.addItem("a3");
QStringList list;
list << "a1" << "a2" << "a3";
QCompleter com(list);
com.setCaseSensitivity(Qt::CaseInsensitive);
com.setCompletionMode(QCompleter::PopupCompletion) ;
box.setCompleter(&com);
// int num = box.count();
box.show();
here num is 0, and if you push the button of dropdown menu, there is no element shown.
only when you input something e.g "a", the meet results are shown.
does it mean for the combobox list, we need to call addItem to set it again?
after the completer is set to combobox,
the combobox doesn't have the items. is it correct?
QComboBox box;
box.setEditable(true);
//box.addItem("a1");
//box.addItem("a2");
//box.addItem("a3");
QStringList list;
list << "a1" << "a2" << "a3";
QCompleter com(list);
com.setCaseSensitivity(Qt::CaseInsensitive);
com.setCompletionMode(QCompleter::PopupCompletion) ;
box.setCompleter(&com);
// int num = box.count();
box.show();
here num is 0, and if you push the button of dropdown menu, there is no element shown.
only when you input something e.g "a", the meet results are shown.
does it mean for the combobox list, we need to call addItem to set it again?