title: Qt 5.5 using C++, removing and item from ComboBox is removing all items before the item as well
body: <p>Working on a program where 6 combobox's have relative data, once an index is selected, the others shouldn't be able to select it, hence I'm just removing it from the index on the others, however in practice it is removing the index plus every index before it for some reason.  Any idea why?</p>
  
  <pre><code>void AssignStatsWindow::on_comboBox_currentIndexChanged()
  {
      ui-&gt;comboBox_2-&gt;removeItem(ui-&gt;comboBox-&gt;currentIndex());  //these should remove 1 index but removes many
      ui-&gt;comboBox_3-&gt;removeItem(ui-&gt;comboBox-&gt;currentIndex());
      ui-&gt;comboBox_4-&gt;removeItem(ui-&gt;comboBox-&gt;currentIndex());
      ui-&gt;comboBox_5-&gt;removeItem(ui-&gt;comboBox-&gt;currentIndex());
      ui-&gt;comboBox_6-&gt;removeItem(ui-&gt;comboBox-&gt;currentIndex());
  
      for (int i = ui-&gt;comboBox-&gt;count(); i &gt;= 0; --i) //removes all but newly selected index, seems to be working fine
      {
          if (i != ui-&gt;comboBox-&gt;currentIndex()) {
              ui-&gt;comboBox-&gt;removeItem(i);
          }
      }
  }
  </code></pre>
  
  <p><code>comboBox</code> is the one having the <code>indexChanged</code>  and triggering the code, <code>comboBox_2</code> through 6 are the others that need adjust and are 'over-removing' indexes.  Once I get this first one working correctly it should be easy to build the rest of the <code>indexChanged</code> for the rest of the <code>comboBox</code>es. Any help would be greatly appreciated. </p>