MCPcopy Create free account
hub / github.com/PyQt5/PyQt / onOpenFile

Method onOpenFile

QAxWidget/ViewOffice.py:29–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 2

openOfficeMethod · 0.95
openPdfMethod · 0.95

Tested by

no test coverage detected