I want to populate a combobox with udims of current geometry and I also want to make it checkable.
I have applied a model to combobox as a data. Here’s my code
from PySide.QtGui import *
from PySide.QtCore import *
cmb = QComboBox()
udims = [udim.name() for udim in mari.current.geo().patchList() ]
model = StandardItemModel(len(udims), 1)
for i, udim in enumerate(udims):
item = QStandardItem(udim)
item.setFlags(Qt.ItemIsUserCheckable | ItemIsEnabled)
item.setData(Qt.Checked | Qt.CheckStateRole)
model.setItem(item)
cmb.setModel(model)
Behavior of combox is changed but no checkbox is visible nor the items are selectable. I can’t figure out what’s the problem.