Hello Everybody, <img src="http://www.qtforum.org/wcf/images/smilies/cool.png" alt="8)"> <br><br>I am using Qt and need to build a selection comboBox -- e.g.:<br><a href="http://www.java2s.com/Tutorial/VBImages/ComboBoxSelectionEventAddValue.PNG">http://www.java2s.com/Tutorial/VBImages/ComboBoxSelectionEventAddValue.PNG</a> .<br>
<br>The
problem is - after one choice was made, and the code run, for the next
time the user select a different choice, both, the present and all past
choices run. See what I mean: <img src="http://www.qtforum.org/wcf/images/smilies/crying.png" alt=";("> <br><br><div style="margin: 5px 20px 20px;">
        <div class="smallfont" style="margin-bottom: 2px;">Code:</div>
        <pre class="bbcodeblock" dir="ltr" style="border: 1px inset ; margin: 0px -99999px 0px 0px; padding: 3px; overflow: auto; width: 98%; height: 98px; text-align: left;"><font size="4">selected color - blue<br>we are on runBlue<br>
selected color - red<br>we are on runBlue<br>we are on runRed</font></pre>
</div><br>Here is the code:<div style="margin: 5px 20px 20px;"><pre class="bbcodeblock" dir="ltr" style="border: 1px inset ; margin: 0px -99999px 0px 0px; padding: 3px; overflow: auto; width: 98%; height: 434px; text-align: left;">
<font size="4">.........................................<br>QtCore.QObject.connect(self.selectComboBox, <br>                        QtCore.SIGNAL("currentIndexChanged(QString)"), <br>                     self.combo_activateInput)   <br>.........................................<br>
def combo_activateInput(self):<br>        color=unicode(self.selectComboBox.currentText())<br>        if(color == "blue"):<br>            print "selected color - blue"<br>            QtCore.QObject.connect(self.okButton, QtCore.SIGNAL("clicked()"), self.combo_runBlue)<br>
        if(color == "red"):<br>            print "selected color - red"<br>            QtCore.QObject.connect(self.okButton, QtCore.SIGNAL("clicked()"), self.combo_runRed)               <br>        if(color == "yellow"):<br>
            print "selected color - yellow"<br>            QtCore.QObject.connect(self.okButton, QtCore.SIGNAL("clicked()"), self.combo_runYellow)<br>        del color <br>.........................................<br>
def combo_runBlue(self):<br>        print "we are on runBlue"<br><br>def combo_runRed(self):<br>        print "we are on runRed"<br><br>def combo_runYellow(self):<br>        print "we are on runYellow"</font></pre>

</div>I run "del color" to clean the content returned by selectComboBox.currentText, but it didn't clean the content indeed.<br><br>So, any suggestion? All comments and suggestions are highly appreciated. <img src="http://www.qtforum.org/wcf/images/smilies/biggrin.png" alt=":D"> <img src="http://www.qtforum.org/wcf/images/smilies/biggrin.png" alt=":D"> <img src="http://www.qtforum.org/wcf/images/smilies/biggrin.png" alt=":D"><input id="gwProxy" type="hidden"><input onclick="jsCall();" id="jsProxy" type="hidden"><input id="gwProxy" type="hidden"><input onclick="jsCall();" id="jsProxy" type="hidden"><div id="refHTML">
</div>