title: Loop through QLabels in HBoxLayout
body: <p>I have an HBoxLayout with different QLabels inside. I want to loop through all those QLabels and set the text to an empty string. I tried the following, but nothing happens:</p>
  
  <pre><code>void MainWindow::addLabelItem() {
      const QList&lt;QLabel*&gt; labels = ui-&gt;hBoxLabels-&gt;findChildren&lt;QLabel*&gt;();
      for (QLabel *label : labels) {
          if (label-&gt;text() == "Head") {
              label-&gt;setText("");
          }
      }
  
      ui-&gt;hBoxLabels-&gt;addWidget(new QLabel("Head"));
  }
  </code></pre>
  
  <p>Where do I go wrong? Thanks :)</p>