Example #1
0
 def __init__(self, fieldlist):
     self.rolenames = rn = {}
     self.roleids = ri = {}
     for n, f in enumerate(fieldlist):
         rid = n + 100
         rn[rid] = f
         ri[f] = rid
     self.model = mo = QtGui.QStandardItemModel()
     mo.setRoleNames(rn)
Example #2
0
 def __init__(self, fieldlist):
     '''Ctor for ModelWrapper class.'''
     self.rolenames = rn = {}
     self.roleids = ri = {}
     for n, f in enumerate(fieldlist):
         rid = n + 100
         rn[rid] = f
         ri[f] = rid
     self.model = mo = QtGui.QStandardItemModel()
     try:
         mo.setRoleNames(rn)
     except AttributeError:
         pass