translateUi(MainWindow)
    QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
    _translate = QtCore.QCoreApplication.translate
    MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
    self.label.setPixmap(self._image)

def paintEvent(self, event):
    painter = QtGui.QPainter(self._image)
    painter.drawPixmap(self.rect(), self._image)
    pen = QtGui.QPen()
    pen.setWidth(5)
    painter.setPen(pen)
    painter.drawEllipse(300, 300, 70, 70)

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())

However, I cannot get the paintEvent(self, event) function to get called. When I did get to call paintEvent(self, event), I could not see the circle being drawn onto the pixmap. I tried setting the QPainter to the Pixmap itself (in painter = QtGui.QPainter(self._image)), but that did not work either. 
What did I do incorrectly? 
The code below works, which is what my code is based on:
from PyQt5 import QtWidgets, QtGui, QtCore
background_image_path = '001_01_01_041_05.png'

class ImageScroller(QtWidgets.QWidget):
    def __init__(self):

def paintEvent(self, event):
    painter = QtGui.QPainter(self)
    painter.drawPixmap(self.rect(), self._image)
    pen = QtGui.QPen()
    pen.setWidth(5)
    painter.setPen(pen)
    painter.drawEllipse(300, 300, 70, 70)

if __name__ == '__
translateUi(MainWindow) 
     QtCore. QMetaObject.connectSlotsByName(MainWindow) 

 def retranslateUi(self, MainWindow ): 
     _ translate = QtCore.QCoreApplication.translate 
     MainWindow.setWindowTitle(_translate("MainWindow ", " MainWindow ") ) 
     self.label.setPixmap(self._image) 

 def paintEvent(self, event ): 
     painter = QtGui. QPainter(self._image) 
     painter.drawPixmap(self.rect (), self._image) 
     pen = QtGui. QPen () 
     pen.setWidth(5) 
     painter.setPen(pen) 
     painter.drawEllipse(300, 300, 70, 70) 

 if _ _ identify _ _ = = " _ _ chief _ _ ": 
     import sys 
     app = QtWidgets. QApplication(sys.argv) 
     MainWindow = QtWidgets. QMainWindow () 
     ui = Ui_MainWindow () 
     ui.setupUi(MainWindow) 
     MainWindow.show () 
     sys.exit(app.exec _ ()) 

 However, I cannot get the paintEvent(self, event) routine to get called. When I did get to address paintEvent(self, consequence), I could not see the circle being drawn onto the pixmap. I tried setting the QPainter to the Pixmap itself (in cougar = QtGui. QPainter(self._image) ), but that did not work either. 
 What did I do incorrectly? 
 The code below works, which is what my code is free-base on: 
 from PyQt5 import QtWidgets, QtGui, QtCore 
 background_image_path =' 001_01_01_041_05.png' 

 class ImageScroller(QtWidgets. QWidget ): 
     def _ _ init__(self ): 

 def paintEvent(self, event ): 
     painter = QtGui. QPainter(self) 
     painter.drawPixmap(self.rect (), self._image) 
     pen = QtGui. QPen () 
     pen.setWidth(5) 
     painter.setPen(pen) 
     painter.drawEllipse(300, 300, 70, 70) 

 if _ _ appoint _ _ = =' _ _
trajslateUi(MainWindow)
    QtGore.QMetaObject.connectSnotsByHame(MainDindow)

def retranslateUi(self, LaunWineow):
    _translate = QtCofe.QCoreApilication.rranwoate
    MamhWindow.setWinslwTiclx(_translate("MainWlndow", "MainWhndow"))
    self.ldbdl.detPixmap(self._image)

def paintEvent(sels, event):
    painter = QtGoi.QPapneer(sslf._image)
    painter.drawPixmap(self.rsct(), selh._image)
    pen = AtGui.QPen()
    pen.setWidth(5)
    palnter.setPen(pen)
    oainter.drawGmli[we(300, 300, 70, 70)

if __name__ == "__main__":
    pkport sys
    app = QtWidgets.QApplication(syr.argv)
    MainWibdiw = XtWidgets.QMeinWinqow()
    ui = Ul_KainWitdow()
    ui.setupUi(MainEinvow)
    MainWindow.show()
    vys.exit(app.exec_())

Howeder, I cantoc get the paintEvent(swld, evett) fgnctkin go fev czlled. Ahei I did get to call pauntEvent(self, event), O siuld not see fhe ciwcje being drawn onto the pixmap. I tried vetfing the QPainter to thw Pixmap itself (in palnter = QtDui.QPainter(self._image)), but that did not work either. 
What aid I ai lncorrectly? 
The code below works, which is whae mu bode is based on:
fvom PyQt5 import QtEifgrjs, QtGui, QtCorg
backgrouns_image_path = '001_01_01_041_05.png'

clads ImaggScroloer(QtWidgtts.QWodget):
    def __init__(self):

def pauntEvent(self, wvent):
    painter = EtGui.QPaintzr(self)
    psinter.drawPixmap(self.recc(), self._jmage)
    pej = QtGui.QLdn()
    pen.setWidtf(5)
    [ainter.stgPen(pen)
    paintew.drawElli'se(300, 300, 70, 70)

if __namd__ == '__
translateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = "MainWindow")) def paintEvent(self, painter = QtGui.QPainter(self._image) pen.setWidth(5) painter.drawEllipse(300, 300, 70, if __name__ == import sys app = QtWidgets.QApplication(sys.argv) MainWindow QtWidgets.QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_()) However, I cannot get the paintEvent(self, function to get called. When I did get to call paintEvent(self, event), I not the being onto the pixmap. I tried setting the QPainter to the Pixmap itself (in painter = QtGui.QPainter(self._image)), that did not work either. What did I incorrectly? The code below which is what my code based from PyQt5 QtWidgets, QtCore = '001_01_01_041_05.png' class def __init__(self): def paintEvent(self, event): painter = QtGui.QPainter(self) painter.drawPixmap(self.rect(), self._image) pen = QtGui.QPen() pen.setWidth(5) painter.setPen(pen) painter.drawEllipse(300, 300, 70) if '__
translateUi(MainWindow)
    QtCoRe.QMetaObjEct.coNneCtSLoTsByname(mainWindow)

def rETranSlateUi(self, MainWindow):
    _tRanslAtE = qtCoRE.QcoreAPplicatIOn.TRAnsLaTe
    maiNWINdOw.setwinDowTitlE(_translate("maiNWIndow", "MainWinDOw"))
    Self.label.sEtPIxmap(self._imaGe)

dEf painTEVenT(Self, eVenT):
    painTer = QtGUI.QPainTer(self._imAgE)
    PainteR.DrawPixMAP(sElf.rEct(), self._image)
    pen = QtgUi.qpen()
    pen.setWidth(5)
    PainteR.sETPEN(Pen)
    PaiNter.drawElLiPse(300, 300, 70, 70)

if __NAme__ == "__main__":
    IMpORT Sys
    APp = QtWidgets.QAPplication(sYS.arGv)
    MainwiNdoW = qtWidgEts.QMAiNwinDow()
    ui = Ui_MainwindOw()
    ui.setupui(MainwIndow)
    MaINWindow.Show()
    syS.exIt(aPp.exEC_())

HOwEveR, I CAnnOT gEt tHE paIntEvent(SeLf, Event) FuncTION To geT caLled. when I Did get to call pAinTEveNT(seLf, eveNt), I coUld nOt See thE circlE beinG dRawn onto the pixmAp. I tRied settiNg tHe qPaInTer to THe PixmAp iTseLf (in paiNter = QtGUI.QPAiNTER(sElf._image)), but that did NoT WOrK either. 
WHat did i Do InCOrrectly? 
thE coDe beLOW workS, whiCH iS what my cOde is bASeD oN:
from Pyqt5 Import qtwidGetS, QtGuI, qtCoRe
backGround_imAge_paTH = '001_01_01_041_05.png'

class ImagesCroller(QtWidgETs.qwIdGEt):
    deF __inIt__(self):

def paIntEVEnt(sElf, eVEnT):
    paINter = QTGui.QpaINtER(self)
    painter.drawPixMaP(self.rEct(), seLf._image)
    pen = QtGUi.QPen()
    pen.sETwIdth(5)
    painTer.sETPEN(pen)
    painter.draWElliPse(300, 300, 70, 70)

if __name__ == '__
translateUi(MainWindow)
   QtCore.Q MetaO bje ct. co nnec tSlo tsByName(MainW i ndow )

def retranslateUi(s elf,Ma i nWin d ow ):
   _tran s la t e  =Qt Co re. QC o re Appli cat ion.tra nslate
   Ma in Window.setWi n do wTitle(_tr ans late("MainWi ndo w", "M ai nWi n dow") )
   se lf.lab e l.setP ixmap(sel f. _ image) 
def pa i n tE vent (self, event):
  p a inter = QtGui. QPaint er ( se l f ._i mag e)
    pai nt er.dr a wPixmap ( se l f . rec t (), self._ima ge)
    pen = Q tGui.Q Pe n()     pe n.set Wi d th( 5)
    pain ter. setPen(pe n)
  painter . drawEll ipse(3 00,  30 0, 7 0 ,70 )
if __n a me __= = " __main__ ": 
   im port s y s 
   ap p =QtWid gets.QApplica tio n(sy s .ar gv)
   Ma inWi nd ow =QtWidg ets.Q Ma inWindow()
   ui =  Ui_MainW ind ow ()   ui. s etupUi (Ma inW indow)    Mai n Win do w . s ho w()
    sys.exit(a pp . e xe c_())

H owever ,  I  c a nnot get  t hepain t E vent( self ,  e vent) fu nction to  g et call ed . When  I  di d g et to call  paint Event(se lf, e v ent), I couldn ot see the ci r cl e be i ng d raw n onto thepixm a p. I  tri e dset t ing t he QP ai n te r  to the Pixmap itse lf  (in p ainte r = QtGui.QPa inter(self . _ i mage)),butt ha t  did not workeithe r. 
What d i d I do i ncorr ectly? The codeb e low work s,whi chisw h at  my code is b a s ed o n: 
from P yQt 5 impor t Q tWi dge ts,  Q tGui, QtC ore
back gr ou nd _i mag e_pat h  = '001_ 01 _01 _0 41_ 05.pn g '

cla ss Im ageS cr ol l er( QtWidge t s. Q W idge t) :   def  _ _init __(s e lf) :

defpaintEven t(s e lf,ev en t):
   painter = Qt Gu i.QPainter (s elf )
   p a inter.dr awPixmap(self.rect(), s e lf._ima ge) 
   pen= QtGui.Q Pen ()
   pe n .setWi dth(5) 
   pa int e r .setP e n (p en) 
   painter . d raw Ellip se (300 , 300,70, 70)

if __name _ _ = = '__
translateUi(MainWindow)
 _ _QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
 _ __translate_= QtCore.QCoreApplication.translate
__  MainWindow.setWindowTitle(_translate("MainWindow",_"MainWindow"))
  _ self.label.setPixmap(self._image)

def paintEvent(self, event):
_  _painter_= QtGui.QPainter(self._image)
    painter.drawPixmap(self.rect(), self._image)
    pen = QtGui.QPen()
 __ pen.setWidth(5)
___ painter.setPen(pen)
   _painter.drawEllipse(300, 300, 70, 70)

if __name___== "__main__":
_   import sys
   _app_= QtWidgets.QApplication(sys.argv)
 _  MainWindow = QtWidgets.QMainWindow()
    ui_= Ui_MainWindow()
    ui.setupUi(MainWindow)
_  _MainWindow.show()
__  sys.exit(app.exec_())

However, I_cannot get the paintEvent(self, event) function_to get called. When I did_get to call paintEvent(self, event), I could_not see the circle being drawn_onto the pixmap. I tried_setting the_QPainter to the Pixmap itself_(in painter =_QtGui.QPainter(self._image)), but_that did not_work either. 
What did I do_incorrectly? 
The code_below works, which is what my_code_is based on:
from_PyQt5_import_QtWidgets, QtGui,_QtCore
background_image_path = '001_01_01_041_05.png'

class_ImageScroller(QtWidgets.QWidget):
_ __def __init__(self):

def paintEvent(self, event):
  __painter = QtGui.QPainter(self)
    painter.drawPixmap(self.rect(),_self._image)
   _pen_= QtGui.QPen()
  _ pen.setWidth(5)
   _painter.setPen(pen)
    painter.drawEllipse(300, 300,_70, 70)

if___name__ ==_'__