(self, event)
| 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() |
nothing calls this directly
no test coverage detected