How update QStringListModel and combo box after initialization
I use QStringListMode and QComboBox. I initialize model in constructor of main window and I fill list in other function. I dont how update combo box after I set model for comboBox.
I try use update funcion but i tried use update function but it didnt work.
What do you mean by update the combo box ? Add new values to the QStringListModel ?
Hi i add new value to list after i set model for combo box but combo box is empty.
You need to update the model also
I had same problem as your.
- you can get the pointer of the model by calling model() method on the combobox
- at this point, you have two opportunities:
** if you have the displayable datas from another, you can reset the stringlist on the model
** simply insert a new row by calling the insertRow