eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCodeSelectionDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8166
bd5cd5858503
child 8188
bfa6c0969acf
equal deleted inserted replaced
8153:e01ae92db699 8176:31965986ecd1
79 itm.setIcon(0, UI.PixmapCache.getIcon("namingError")) 79 itm.setIcon(0, UI.PixmapCache.getIcon("namingError"))
80 elif code.startswith("D"): 80 elif code.startswith("D"):
81 itm.setIcon(0, UI.PixmapCache.getIcon("docstringError")) 81 itm.setIcon(0, UI.PixmapCache.getIcon("docstringError"))
82 elif code.startswith("S"): 82 elif code.startswith("S"):
83 itm.setIcon(0, UI.PixmapCache.getIcon("securityLow")) 83 itm.setIcon(0, UI.PixmapCache.getIcon("securityLow"))
84 elif code.startswith("P"):
85 itm.setIcon(0, UI.PixmapCache.getIcon("dirClosed"))
84 else: 86 else:
85 # unknown category prefix => warning 87 # unknown category prefix => warning
86 itm.setIcon(0, UI.PixmapCache.getIcon("warning")) 88 itm.setIcon(0, UI.PixmapCache.getIcon("warning"))
87 itm.setFlags(itm.flags() | Qt.ItemIsUserCheckable) 89 itm.setFlags(itm.flags() | Qt.ItemFlag.ItemIsUserCheckable)
88 if code in codeList: 90 if code in codeList:
89 itm.setCheckState(0, Qt.Checked) 91 itm.setCheckState(0, Qt.CheckState.Checked)
90 codeList.remove(code) 92 codeList.remove(code)
91 else: 93 else:
92 itm.setCheckState(0, Qt.Unchecked) 94 itm.setCheckState(0, Qt.CheckState.Unchecked)
93 self.codeTable.resizeColumnToContents(0) 95 self.codeTable.resizeColumnToContents(0)
94 self.codeTable.resizeColumnToContents(1) 96 self.codeTable.resizeColumnToContents(1)
95 self.codeTable.header().setStretchLastSection(True) 97 self.codeTable.header().setStretchLastSection(True)
96 98
97 self.__extraCodes = codeList[:] 99 self.__extraCodes = codeList[:]
105 """ 107 """
106 selectedCodes = [] 108 selectedCodes = []
107 109
108 for index in range(self.codeTable.topLevelItemCount()): 110 for index in range(self.codeTable.topLevelItemCount()):
109 itm = self.codeTable.topLevelItem(index) 111 itm = self.codeTable.topLevelItem(index)
110 if itm.checkState(0) == Qt.Checked: 112 if itm.checkState(0) == Qt.CheckState.Checked:
111 selectedCodes.append(itm.text(0)) 113 selectedCodes.append(itm.text(0))
112 114
113 return ", ".join(self.__extraCodes + selectedCodes) 115 return ", ".join(self.__extraCodes + selectedCodes)

eric ide

mercurial