comparison python/ide.py @ 154:81e08e2e7777

Used error icon
author Windel Bouwman
date Sat, 02 Mar 2013 10:19:38 +0100
parents b73bc14a3aa3
children d8c735dc31f9
comparison
equal deleted inserted replaced
153:e05b2b216bfc 154:81e08e2e7777
29 def __init__(self, parent=None): 29 def __init__(self, parent=None):
30 super(BuildErrors, self).__init__(parent) 30 super(BuildErrors, self).__init__(parent)
31 model = QStandardItemModel() 31 model = QStandardItemModel()
32 self.setModel(model) 32 self.setModel(model)
33 self.clicked.connect(self.itemSelected) 33 self.clicked.connect(self.itemSelected)
34 self.errorIcon = QIcon('error.png')
34 def setErrorList(self, errorlist): 35 def setErrorList(self, errorlist):
35 model = QStandardItemModel() 36 model = QStandardItemModel()
36 for e in errorlist: 37 for e in errorlist:
37 item = QStandardItem(str(e)) 38 item = QStandardItem(self.errorIcon, str(e))
38 item.setData(e) 39 item.setData(e)
39 model.appendRow(item) 40 model.appendRow(item)
40 self.setModel(model) 41 self.setModel(model)
41 def itemSelected(self, index): 42 def itemSelected(self, index):
42 if not index.isValid(): 43 if not index.isValid():
350 351
351 self.builderrors.setErrorList(self.diag.diags) 352 self.builderrors.setErrorList(self.diag.diags)
352 #self.astViewer.setAst(mods[0]) 353 #self.astViewer.setAst(mods[0])
353 for err in self.diag.diags: 354 for err in self.diag.diags:
354 self.buildOutput.append(str(err)) 355 self.buildOutput.append(str(err))
356 ce = self.activeMdiChild()
357 if ce:
358 print('setting errors')
359 ce.setErrors(self.diag.diags)
355 self.buildOutput.append("Done!") 360 self.buildOutput.append("Done!")
356 361
357 if __name__ == '__main__': 362 if __name__ == '__main__':
358 app = QApplication(sys.argv) 363 app = QApplication(sys.argv)
359 ide = Ide() 364 ide = Ide()