title: How to get the number of items of a QTreeWidget
body: <p>I have created a QTreeWidget, I'm trying to list all the items displayed.</p>
  
  <p>I do not want to go inside the items if the item have child but not expanded. It's really getting the number of Items I can see in the tree.</p>
  
  <p>I have tried  :</p>
  
  <pre><code>   for( int i = 0; i &lt; MyTreeWidget-&gt;topLevelItemCount(); ++i )
      {
         QTreeWidgetItem *item = MyTreeWidget-&gt;topLevelItem(i);
         ...
  </code></pre>
  
  <p>but this is giving me only the topLevelItem and I want all I can see. In the example, I should be able to count 14 items</p>
  
  <p><img src="https://i.stack.imgur.com/hSvJH.jpg" alt="enter image description here"></p>