(self)
| 27 | self, clicked=self.onOpenFile)) |
| 28 | |
| 29 | def onOpenFile(self): |
| 30 | path, _ = QFileDialog.getOpenFileName( |
| 31 | self, '请选择文件', '', 'excel(*.xlsx *.xls);;word(*.docx *.doc);;pdf(*.pdf)') |
| 32 | if not path: |
| 33 | return |
| 34 | if _.find('*.doc'): |
| 35 | return self.openOffice(path, 'Word.Application') |
| 36 | if _.find('*.xls'): |
| 37 | return self.openOffice(path, 'Excel.Application') |
| 38 | if _.find('*.pdf'): |
| 39 | return self.openPdf(path) |
| 40 | |
| 41 | def openOffice(self, path, app): |
| 42 | self.axWidget.clear() |
nothing calls this directly
no test coverage detected