Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. what does topLevelItem in QTreeWidget means?

what does topLevelItem in QTreeWidget means?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      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()

      1 Reply Last reply
      0
      • O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved