self.expand(index)
def search(index):
- if index.data().toString() == txt:
+ # voodoo alert: baris was using index.data()
+ # and apparently it worked. But after me
+ # messing around, only index.model().data(index)
+ # seems to give non-empty QVariant as output.
+ if index.model().data(index).toString() == txt:
recursiveExpand(index)
self.scrollTo(index, self.PositionAtCenter)
return
layout.addWidget(self.view)
self.setLayout(layout)
- print 'CHILDREN', str(self.children())
self.updateView()
def showNode(self, hostname):
self.model = None
self.document = QDomDocument(self.title)
- self.model = DomModel(self.document, self)
-
- self.view.setModel(self.model)
- self.view.expand(self.model.index(0, 0)) #expand first level only
rspec_file = config.getSliceRSpecFile()
if not os.path.exists(rspec_file):
return
self.document.setContent(open(rspec_file,'r').read())
+ # DomModel.__init__ is gonna purge the doc
+ # from the "xml bla bla bla" node.
+ # so the arg 'document' needs to be not None
+ # for this to happen
+ self.model = DomModel(self.document, self)
+
+ self.view.setModel(self.model)
+ self.view.expand(self.model.index(0, 0)) #expand first level only
+