def refreshArrayList(self, qstring): self.arrayList.clear() #spec= self.__getCurrentSpec() self.currentSpec = str(qstring) spec = self.currentSpec if spec is not None: arraylist = {} for array in sps.getarraylist(spec): if array not in self.HiddenArrays: info = sps.getarrayinfo(spec, array) rows = info[0] cols = info[1] type = info[2] flag = info[3] if flag in (sps.IS_ARRAY, sps.IS_MCA, sps.IS_IMAGE) and type != sps.STRING: arraylist[array] = (rows, cols) if len(arraylist.keys()): arrayorder = arraylist.keys() arrayorder.sort() arrayorder.reverse() for name in arrayorder: self.arrayList.insertItem( qt.QListViewItem(self.arrayList, "", name, str(arraylist[name][0]), str(arraylist[name][1]))) self.refreshDataSelection() self.__getParamWidget("empty")
def refresh(self): self.list.clear() if self.data is None: return try: if self.data.sourceName is None: return except: if self.data.SourceName is None: return try: #new info= self.data.getSourceInfo() except: #old info= self.data.GetSourceInfo() self.scans= [] after= None if QTVERSION < '4.0.0': for (sn, cmd, pts, mca) in zip(info["KeyList"], info["Commands"], info["NumPts"], info["NumMca"]): if after is not None: item= qt.QListViewItem(self.list, after, "", sn, cmd, str(pts), str(mca)) else: item= qt.QListViewItem(self.list, "", sn, cmd, str(pts), str(mca)) if (self.disableMca and not mca) or (self.disableScan and not pts): item.setSelectable(0) #XXX: not possible to put in italic: other solutions ?? self.list.insertItem(item) self.scans.append(sn) after= item else: i = 0 for (sn, cmd, pts, mca) in zip(info["KeyList"], info["Commands"], info["NumPts"], info["NumMca"]): if after is not None: #print "after is not none" #item= qt.QTreeWidgetItem(self.list, [after, "", sn, cmd, str(pts), str(mca)]) item= MyQTreeWidgetItem(self.list, ["", sn, cmd, str(pts), str(mca)]) else: item= MyQTreeWidgetItem(self.list, ["", sn, cmd, str(pts), str(mca)]) if (self.disableMca and not mca) or (self.disableScan and not pts): item.setSelectable(0) #XXX: not possible to put in italic: other solutions ?? self.scans.append(sn) after= item i = i + 1