title: Using the GroupBoxes in Qt
body: <p>I'm a student programmer and I am using Qt to build a GUI application. I'm trying to ensure that some check boxes are checked in order to proceed. These check boxes enable or disable the group box itself and are part of the QGroupBox class. Accepted combinations could be either or both. The problem I am running into is getting the boolean value(at least that's what I think it is) from the QGroupBox member function QGroupBox::setChecked(bool) and use it to determine whether or not to display an error message. I have tried several methods and reference Qts documentation hoping for a good example. Because the QGroupBox I'm trying to use is a member of my ui class I tried creating a new instance of QGroupBox and setting it to the values of the ui. Then; using an if statement, find out whether or not the boxes are check or not. Here's my code for this:</p>
  
  <pre><code>QGroupBox activeParticleInjection = ui-&gt;groupBoxParticleInjection;
      QGroupBox activeFluidInjection = ui-&gt;groupBoxFluidInjection;
      if (activeParticleInjection::setChecked(false) &amp;&amp; activeFluidInjection(false));
      {
          QMessageBox noInjectionSelectedError;
          noInjectionSelectedError.setText("Error: No injection type selected");
          noInjectionSelectedError.exec();
      }
      else
      {
          transData.particleInjectionActive = activeParticleInjection::setChecked();
          transData.fluidInjectionActive = activeFluidInjection::setChecked();
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/4e0pk.png" alt="Compile and code"></p>
  
  <p>This doesn't work; starting with the way I'm trying to pass the Ui properties to the new instance of QGroupBox. I know that is question is relatively generic question but I tried passing the ui checkbox directly and that caused even more issues. I looked through the documentation and that led me to the way im trying to do it know; with no luck. I was hoping for some feedback on a better method of handling QGroupBox. Being a student sometimes its hard to see the answer especially when dealing with such unique members as the ones put together in QT. </p>
  
  <p>Prior to changes I was using this method to build this process; and I received errors for the way my if parameters were setup. Compile error was : no matching function for call to 'QGroupBox::isChecked(bool)'</p>
  
  <pre><code>if (ui-&gt;groupBoxFluidInjection-&gt;isChecked(false) &amp;&amp; ui-&gt;groupBoxParticleInjection-&gt;isChecked(false));
      {
          QMessageBox noInjectionSelectedError;
          noInjectionSelectedError.setText("Error: No injection type selected");
          noInjectionSelectedError.exec();
      }
      else
      {
          transData.particleInjectionActive = ui-&gt;groupBoxParticleInjection-&gt;isChecked();
          transData.fluidInjectionActive = ui-&gt;groupBoxFluidInjection-&gt;isChecked();
      }
  </code></pre>
  
  <p>I have been using these sites for most help:
  <a href="http://developer.qt.nokia.com/doc/qt-4.8/widgets-groupbox.html" rel="nofollow noreferrer">QGroupBox</a>
  <a href="http://developer.qt.nokia.com/doc/qt-4.8/qcheckbox.html" rel="nofollow noreferrer">QCheckBox</a></p>