def __init__(self, parent = None): """ Constructor """ hw_info_in_xml() QMainWindow.__init__(self, parent) self.setupUi(self) hw_info=xml_parser("./resources/hw.xml") stack=[hw_info.first_node_key] hw_info=hw_info.hw_info stack1 = [self.treeWidget] while len(stack)!=0 : t=stack.pop() try: hw_info[t]["description"] except KeyError : try: t=stack.pop() except IndexError: pass item = QtGui.QTreeWidgetItem(stack1.pop()) item.setData(1, 1, list(t)) #print list(t) #for i in item.data(1, 1).toList() : #print i.toString() try: item.setText(0, hw_info[t]["description"]) except KeyError : pass tmp=hw_info[t]['child_nodes'] tmp.reverse() for i in tmp: stack.append(i) stack1.append(item) #self.sys_info_view.setUrl(QUrl("file:///home/boss/py/resources/system-info.html")) self.treeWidget.show()
def on_qt_tabwidget_tabbar_selected(self, p0): """ Slot documentation goes here. """ if p0==0: hw_info_in_xml()