title: QCheckbox name access
body: <p>I generate checkboxes as follows:</p>
  
  <pre><code>foreach(QString filt, types){
      QCheckBox *checkbox = new QCheckBox(filt, this);
      checkbox-&gt;setChecked(true);
      vbox-&gt;addWidget(checkbox);
  }
  </code></pre>
  
  <p>I need to get access to these checkboxes by name but they are all called the same?</p>
  
  <p>I need to read the text they display.</p>
  
  <p>How can I go about this?</p>
  
  <p>Is it possible to run a for loop and attach the value of i onto the end of the checkbox. So in effect, the checkbox would be called checkbox[0], checkbox [1], etc?</p>
  
  <p>EDIT:</p>
  
  <p>I've changed the code to the following:</p>
  
  <pre><code>for(int i=0; i&lt;types.count(); ++i)
  {
      QString filt = types[i];
      *checkboxCount = *checkboxCount + 1;
      QCheckBox *typecheckbox[i] = new QCheckBox(filt, this);
      typecheckbox[i]-&gt;setChecked(true);
      vbox-&gt;addWidget(typecheckbox[i]);
  }
  </code></pre>
  
  <p>I thought this was a way to dynamically name the checkboxes so I can loop through them to get the text value from them.</p>
  
  <p>I'm getting the error '<strong>variable-sized object may not be initialized</strong>' on this line <code>QCheckBox *typecheckbox[i] = new QCheckBox(filt, this);</code></p>
  
  <p>Any ideas to a solution/ alternate approach?</p>