How pyqt5+opengl can be drawn in functions other than paintGL

problem description

how pyqt5+opengl draws functions other than paintGL

the environmental background of the problems and what methods you have tried

I used makecurrent () but still can"t draw

related codes

/ / Please paste the code text below (do not replace the code with pictures)

def mousePressEvent(self,r):
    if self.paintFig == True:
        self.defaultFramebufferObject()
        self.makeCurrent()
        glClear(GL_COLOR_BUFFER_BIT)
        glPointSize(3.0)  -sharp 
        glColor4f(0.0, 0.0, 0.0, 0.5)
        glBegin(GL_POINTS)
        glVertex2f(0,0)
        glEnd()
        glFlush()
        print(r.button(),r.globalX(),r.x())
        -sharp self.points.append((r.x(),r.y()))

what result do you expect? What is the error message actually seen?

Oct.07,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dba1-2c3be.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dba1-2c3be.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?