I have a QComboBox, so the user can name the network name from the model column. I am using code like this:
self.networkSelectionCombo = QtGui.QComboBox() self.networkSelectionCombo.setModel(self.model.worldLinks) self.networkSelectionCombo.setModelColumn(WLM.NET_NAME)
I am using PySide, but this is a Qt question. Answers using C ++ are fine.
I need to give the user the option not to select any network. I would like to add an additional item to the No combo box. However, this is simply overridden by the contents of the model.
The only way I can think of is to create an intermediate user view in this column of the model and use it to update combos, then the view can handle the addition of an additional "magic" element. Does anyone know a more elegant way to do this?
source share