what does topLevelItem in QTreeWidget means?



  • what does topLevelItem in QTreeWidget means?
    i read the doc, but still don't understand what it really mean...



  • Top level items in a QTreeWidget do not have parent items.
    Take a look on the pictures in QTreeWidget description
    The most left items on each image are the top level items.
    Not sure if forum will show my drawing correctly

    invisible_root
        top_level_1
                not_top_level_1
                not_top_level_2
        top_level_2
                not_top_level_1
                not_top_level_2
    

    Invisible_root is not visible in QTreeWidget and is accessible by QTreeWidget::invisibleRootItem()



  • so u mean when i write like this: pRootItem = new QTreeWidgetItem(this);
    pRootItem is just top_level_1, and not invisible_root...
    why do Qt add an invisible_root here?
    and what things will the top_level related API make easier?


Log in to reply
 

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