diff python/astviewer.py @ 169:ee0d30533dae

Added more tests and improved the diagnostic update
author Windel Bouwman
date Sat, 23 Mar 2013 18:34:41 +0100
parents 49f1ab80d040
children 8b2f20aae086
line wrap: on
line diff
--- a/python/astviewer.py	Fri Mar 22 19:09:38 2013 +0100
+++ b/python/astviewer.py	Sat Mar 23 18:34:41 2013 +0100
@@ -8,9 +8,11 @@
       self.variableIco = QIcon(QPixmap('variableicon.png').scaled(32, 32))
       self.visitor = Visitor(self.p1, self.p2)
       self.model = QStandardItemModel()
+      self.model.setHorizontalHeaderLabels(['Object', 'Type'])
    def build(self, pkg):
-      self.model.clear()
-      self.model.setHorizontalHeaderLabels(['Object', 'Type'])
+      #self.model.clear()
+      c = self.model.rowCount()
+      self.model.removeRows(0, c)
       self.curItem = self.model.invisibleRootItem()
       self.visitor.visit(pkg)
    def p1(self, node):