title: PyQt: make QLabel disappear when certain drop-down value is chosen
body: <p>I have a <code>QDialog</code> that has several <code>QLineEdits</code> and also one drop-down list (QComboBox) with 3 entries: passed, passed with additional comments and failed.</p>
  <p>Whenever the user chooses either &quot;failed&quot; or &quot;passed with additional comments&quot; I blend in an extra <code>QLineEdit</code> for a comment. If &quot;passed&quot; is chosen, no field gets added.
  I managed to implement the part of showing the extra comment field whenever one of the two entries gets chosen by making the field not visible in the beginning and as soon as the entry gets chosen, it becomes visible but I don't manage to make the field disappear again whenever &quot;passed&quot; is chosen.
  Here a few snippets that have to do with it:</p>
  <pre class="lang-py prettyprint-override"><code>        self.resultLabel = QLabel(&quot;Result:&quot;, self)
          #define dropdown
          self.resultCombo = QComboBox(self)
          self.resultCombo.addItem(&quot;passed&quot;)
          self.resultCombo.addItem(&quot;passed with additional comments&quot;)
          self.resultCombo.addItem(&quot;failed&quot;)
      
          #define the extra comment label and input field
          self.extraCommentLabel = QLabel(&quot;Comment&quot;,self)
          self.extraCommentLabel.setVisible(False)
          self.extraCommentLine = QLineEdit(self)
          self.extraCommentLine.setVisible(False)
          self.resultCombo.currentIndexChanged.connect(self.combo_value)
      
          #define layout
          self.resultLayout = QHBoxLayout()
          self.resultLayout.addWidget(self.resultLabel)
          self.resultLayout.addWidget(self.resultCombo)
          self.windowLayout = QVBoxLayout()
          self.windowLayout.addLayout(self.resultLayout)
          self.windowLayout.addLayout(self.extraCommentLayout)
      
       def combo_value(self):
          selected_option = self.resultCombo.currentText()
          print str(selected_option)
          if selected_option is &quot;passed with additional comments&quot; or &quot;failed&quot;:
                self.extraCommentLine.setVisible(True)
                self.extraCommentLabel.setVisible(True)
          elif selected_option is &quot;passed&quot;:
                self.extraCommentLabel.setVisible(False)
  </code></pre>
  <p>I'm guessing my <code>def combo_value</code> is missing something but not sure what. Thanks for any tips!</p>