title: get the selected option from combo box
body: <p>Here is my python code converted from NetSim.ui to NetSim.py using pyuic4.</p>
  
  <p>The combobox name is changed to Codecs.</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  # Form implementation generated from reading ui file 'NetSim.ui'
  #
  # Created: Wed Oct 15 11:46:03 2014
  #      by: PyQt4 UI code generator 4.10.1
  #
  # WARNING! All changes made in this file will be lost!
  
  from PyQt4 import QtCore, QtGui
  
  try:
     _fromUtf8 = QtCore.QString.fromUtf8
  except AttributeError:
     def _fromUtf8(s):
        return s
  
  try:
     _encoding = QtGui.QApplication.UnicodeUTF8
     def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
  except AttributeError:
     def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)
  
  class Ui_NetSim(object):
     def setupUi(self, NetSim):
        NetSim.setObjectName(_fromUtf8("NetSim"))
        NetSim.resize(641, 564)
        self.Codecs = QtGui.QComboBox(NetSim)
        self.Codecs.setGeometry(QtCore.QRect(270, 90, 81, 29))
        self.Codecs.setObjectName(_fromUtf8("Codecs"))
        self.Codecs.addItem(_fromUtf8(""))
        self.Codecs.addItem(_fromUtf8(""))
        self.Codecs.addItem(_fromUtf8(""))
        self.Codecs.addItem(_fromUtf8(""))
        self.Codecs.addItem(_fromUtf8(""))
        self.Codecs.addItem(_fromUtf8(""))
  
     def retranslateUi(self, NetSim):
  
        NetSim.setWindowTitle(_translate("NetSim", "Dialog", None))
        self.Codecs.setItemText(0, _translate("NetSim", "Codecs", None))
        self.Codecs.setItemText(1, _translate("NetSim", "AMR-WB", None))
        self.Codecs.setItemText(2, _translate("NetSim", "AMR-WB+", None))
        self.Codecs.setItemText(3, _translate("NetSim", "VMR-WB", None))
        self.Codecs.setItemText(4, _translate("NetSim", "EVRC", None))
        self.Codecs.setItemText(5, _translate("NetSim", "EVRCb", No
  </code></pre>
  
  <p>I am using another python script to write my own functions and connect it to the widgets. I want to get the selected value of the combo box and use it (say print it) but it shows a red cross in the code on the line I want to get the selected value of Codec and I am unable to find the mistake.Error is : 
  val = str(Ui_NetSim.Codecs.currentText())
  AttributeError: type object 'Ui_NetSim' has no attribute 'Codecs'
  Here it is:</p>
  
  <pre><code>import sys
  
  from PyQt4 import QtCore, QtGui
  from NetSim import Ui_NetSim
  from PyQt4.Qt import QString
  from __builtin__ import str
  
  class AppGui(QtGui.QDialog,Ui_NetSim):
  
     def __init__(self):
        QtGui.QDialog.__init__(self)
  
        self.ui = Ui_NetSim()
        self.ui.setupUi(self)
  
        self.ui.Codecs.activated.connect(self.select_Codec)
  
      def select_Codec(self):
  
       val = str(Ui_NetSim.Codecs.currentText())
       print val
  
  
  app = QtGui.QApplication(sys.argv)
  window = AppGui()
  ui = Ui_NetSim()
  window.show()
  sys.exit(app.exec_())
  </code></pre>