MCPcopy
hub / github.com/PyQt5/PyQt / closeEvent

Method closeEvent

Demo/FacePoints.py:105–123  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

103 QMessageBox.critical(self, "错误", str(e))
104
105 def closeEvent(self, event):
106 if hasattr(self, "_reply") and self._reply:
107 self.httpRequestAborted = True
108 self._reply.abort()
109 try:
110 os.unlink("Data/shape_predictor_68_face_landmarks.dat.bz2")
111 except:
112 pass
113 try:
114 os.unlink("Data/shape_predictor_68_face_landmarks.dat")
115 except:
116 pass
117 if hasattr(self, "timer"):
118 self.timer.stop()
119 self.timer.deleteLater()
120 self.cap.release()
121 del self.predictor, self.detector, self.cascade, self.cap
122 super(OpencvWidget, self).closeEvent(event)
123 self.deleteLater()
124
125 def onCapture(self):
126 _, frame = self.cap.read()

Callers

nothing calls this directly

Calls 2

deleteLaterMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected