title: Get QComboBox item text triggered by event in separate class method/function
body: <p>I'm having trouble getting any information from a QComboBox other than the index in a function. Most similar examples provides the function in the same class as the triggered event. I'm trying to get this from an external class (and file).</p>
  
  <p>Folder structure is as provided in the answer here:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/56491818/">PySide2 paint on widget created by designer</a></li>
  </ul>
  
  <p>In paintEventTest.py I've created a list which is used to populate the combobox with items. ComboEvent is instantiated from EventMethods.py and I'm trying to print the itemText in my function.</p>
  
  <p>EventMethods.py</p>
  
  <pre><code>from PySide2.QtWidgets import QWidget, QPushButton, QComboBox
  
  class widgetEventHandler(QWidget):
  
      def closeEvent(self, event):
          print("TEST")
  
  
  class comboBoxEvent(QComboBox):
      def getSectionShape(self, index):
          text = str(self.itemText(index))
          print(text)
          print("Index changed to: " + str(index))
  
  </code></pre>
  
  <p>paintEventTest.py</p>
  
  <pre><code>import sys
  
  from PySide2 import QtWidgets 
  from PySide2 import QtGui
  from PySide2 import QtCore
  from PySide2.QtUiTools import QUiLoader
  from PySide2.QtWidgets import (
      QApplication, QPushButton, QLineEdit, QTextEdit, QSpinBox, QMainWindow, QDesktopWidget, QTableWidget, 
      QTableWidgetItem, QToolButton, QToolTip)
  from PySide2.QtCore import QFile, QObject, Qt
  
  from EventMethods import *
  
  
  class MainForm(QMainWindow):
      def __init__(self, ui_file, parent=None):
          super(MainForm, self).__init__(parent)
          ui_file = QtCore.QFile(ui_file)
          ui_file.open(QtCore.QFile.ReadOnly)
  
          ### Load UI file from Designer ###
          loader = QUiLoader()
          self.ui_window = loader.load(ui_file)
          ui_file.close()
          self.ui_window.show()
  
          #region widget code
          widget = self.ui_window.widget
          widget.setStyleSheet("""
              QWidget {
                  border: 1px solid lightgrey;
                  border-radius: 2px;
                  background-color: rgb(255, 255, 255);
                  }
              """)
  
          #endregion
  
          sectionList = []
          sectionList.append("Rectangle")
          sectionList.append("Diamond")
          sectionList.append("Circle")
          sectionList.append("Box")
          sectionList.append("T-Section")
          sectionList.append("I-Section")
  
          comboBox = self.ui_window.comboBox
          #comboBox = QtWidgets.QComboBox      #Just to get intellisense working. Gets commented out
          comboBox.setCurrentIndex(0)
  
          for item in sectionList:
              comboBox.addItem(item)
  
          comboEvent = comboBoxEvent(self)
          comboBox.currentIndexChanged.connect(comboEvent.getSectionShape)
  
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      app.setStyle('Fusion')
      form = MainForm('./UI designer/testUI.ui')
      sys.exit(app.exec_())
  
  </code></pre>
  
  <p>testUI.ui file looks like this and is in a folder "UI designer":</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ui version="4.0"&gt;
   &lt;class&gt;MainWindow&lt;/class&gt;
   &lt;widget class="QMainWindow" name="MainWindow"&gt;
    &lt;property name="geometry"&gt;
     &lt;rect&gt;
      &lt;x&gt;0&lt;/x&gt;
      &lt;y&gt;0&lt;/y&gt;
      &lt;width&gt;996&lt;/width&gt;
      &lt;height&gt;892&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name="windowTitle"&gt;
     &lt;string&gt;MainWindow&lt;/string&gt;
    &lt;/property&gt;
    &lt;widget class="QWidget" name="centralwidget"&gt;
     &lt;layout class="QVBoxLayout" name="verticalLayout"&gt;
      &lt;item&gt;
       &lt;widget class="QGraphicsView" name="graphicsView"&gt;
        &lt;property name="minimumSize"&gt;
         &lt;size&gt;
          &lt;width&gt;0&lt;/width&gt;
          &lt;height&gt;200&lt;/height&gt;
         &lt;/size&gt;
        &lt;/property&gt;
       &lt;/widget&gt;
      &lt;/item&gt;
      &lt;item&gt;
       &lt;widget class="Drawer" name="widget" native="true"&gt;
        &lt;property name="minimumSize"&gt;
         &lt;size&gt;
          &lt;width&gt;0&lt;/width&gt;
          &lt;height&gt;250&lt;/height&gt;
         &lt;/size&gt;
        &lt;/property&gt;
        &lt;property name="maximumSize"&gt;
         &lt;size&gt;
          &lt;width&gt;16777215&lt;/width&gt;
          &lt;height&gt;300&lt;/height&gt;
         &lt;/size&gt;
        &lt;/property&gt;
        &lt;property name="styleSheet"&gt;
         &lt;string notr="true"/&gt;
        &lt;/property&gt;
       &lt;/widget&gt;
      &lt;/item&gt;
      &lt;item&gt;
       &lt;widget class="QComboBox" name="comboBox"/&gt;
      &lt;/item&gt;
     &lt;/layout&gt;
    &lt;/widget&gt;
    &lt;widget class="QMenuBar" name="menubar"&gt;
     &lt;property name="geometry"&gt;
      &lt;rect&gt;
       &lt;x&gt;0&lt;/x&gt;
       &lt;y&gt;0&lt;/y&gt;
       &lt;width&gt;996&lt;/width&gt;
       &lt;height&gt;21&lt;/height&gt;
      &lt;/rect&gt;
     &lt;/property&gt;
    &lt;/widget&gt;
    &lt;widget class="QStatusBar" name="statusbar"/&gt;
   &lt;/widget&gt;
   &lt;customwidgets&gt;
    &lt;customwidget&gt;
     &lt;class&gt;Drawer&lt;/class&gt;
     &lt;extends&gt;QWidget&lt;/extends&gt;
     &lt;header&gt;myDrawWidget&lt;/header&gt;
     &lt;container&gt;1&lt;/container&gt;
    &lt;/customwidget&gt;
   &lt;/customwidgets&gt;
   &lt;resources/&gt;
   &lt;connections/&gt;
  &lt;/ui&gt;
  </code></pre>
  
  <p>When debugging the text string in getSectionShape is empty (expecting section type) but my index is correct. Console prints one blank and one correct line. Something isn't working with the self.itemText(index) in getSectionShape form EventMethods.py. Any help is appreciated!</p>