def loadFile(self, fileName):
file = QFile(fileName)
if not file.open( QFile.ReadOnly | QFile.Text):
QMessageBox.warning(self, "Recent Files",
"Cannot read file %s:\n%s." % (fileName, file.errorString()))
return
instr = QTextStream(file)
QApplication.setOverrideCursor(Qt.WaitCursor)
self.textEdit.setPlainText(instr.readAll())
QApplication.restoreOverrideCursor()
self.setCurrentFile(fileName)
self.statusBar().showMessage("File loaded", 2000)
评论列表
文章目录