title: How to add an argument to pyqt5 paintEvent?
body: <p>A function that runs inside of paintEvent needs a multiprocessing.Queue object to be passed into itself.</p>
  
  <p>I have tried to use global python lists but lists don't work with the multiprocessing library. In the "main" section of my code I create a multiprocess.Queue object. The function drawMandelbrot is part of my QWidget class and is executed by the paintEvent. The paint event runs whenever the gui window needs to be drawn on the screen. But the function drawMandelbrot needs to access the Queue object to get data that needs to be drawn.</p>
  
  <pre class="lang-py prettyprint-override"><code>if __name__ == '__main__':
      procQueue = Queue()
      app = QApplication([])
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>    #Called whenever the window is resized or brought into focus
      def paintEvent(self, event, procQueue):
          qp = QPainter()
          qp.begin(self)
  
          #Run the drawMandelbrot program
          self.drawMandelbrot(qp, procQueue)
          qp.end()
  </code></pre>
  
  <p>I expect the function to pass the Queue object into the drawMandelbrot function. When the program is run it gives the error "TypeError: paintEvent() missing 1 required positional argument: 'Queue'". How do I allow the drawMandelbrot function to have access to the Queue object that I created in my "main" section of the python app?</p>