Need help QTreeWidget in Pyside



  • Hi,

    I need a QTreeWidget that contains items in below fashion.

    MainName
    >FirstName
    * FirstChild
    * SecChild
    >SecondName
    * ThirdChild
    * FourthChild

    in this fashion

    @
    treeWidget = QtGui.QTreeWidget()
    treeWidget.setColumnCount(1)

    items=['FirstName','SecondName','ThirdName']
    childitems=['FirstChild','SecChild','ThirdChild','FourthChild','FifthChild','SixChild']
    
     for i in range(3): 
      treeItems = QtGui.QTreeWidgetItem(None,[items[ i ]])
      for j in range(6):
        childTree = QtGui.QTreeWidgetItem(None,[childitems[ j ]])
        treeItems.addChild(childTree)
      treeWidget.insertTopLevelItem(0,treeItems)
    

    @
    How do I get the MainName tag??
    Plz share your views.

    Thanks,
    Haney


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.