【PyQt4 实例23】获取文件属性(下)
来源:互联网 发布:单例模式php例子 编辑:程序博客网 时间:2024/05/29 12:31
bottomLayout=QVBoxLayout() bottomLayout.addLayout(hb2) mainLayout.addLayout(bottomLayout,6,0,1,2) hb3 = QHBoxLayout() self.ButtonMessage = QPushButton(self) self.ButtonMessage.setText(self.tr("获得文件信息")) hb3.addWidget(self.ButtonMessage) bottomLayout.addLayout(hb3) self.connect(self.ButtonMessage,SIGNAL("clicked()"),self.getFileInformation) self.connect(self.PushButtonFile,SIGNAL("clicked()"),self.slotopenFile) def slotopenFile(self): name = QFileDialog.getOpenFileName(self,"open file dialog",".","strip file(*.*)") self.LineEditFile.setText(name) def getFileInformation(self): file = self.LineEditFile.text() if file.isEmpty(): QMessageBox.warning(self,self.tr("error"),self.tr("Please input file address!")) info = QFileInfo(file) size = info.size() created = info.created() lastModified = info.lastModified() lastRead = info.lastRead() isDir = info.isDir() isFile = info.isFile() isSymlink = info.isSymLink() isHidden = info.isHidden() isReadable = info.isReadable() isWritable = info.isWritable() isExecutable = info.isExecutable() self.LineEditSize.setText(QString.number(size)) self.LineEditCDate.setText(created.toString()) self.LineEditMDate.setText(lastModified.toString()) self.LineEditVDate.setText(lastRead.toString()) self.Record_check.setCheckState(isDir if Qt.Checked else Qt.Unchecked) self.F_check.setCheckState(isFile if Qt.Checked else Qt.Unchecked) self.S_check.setCheckState(isSymlink if Qt.Checked else Qt.Unchecked) self.H_check.setCheckState(isHidden if Qt.Checked else Qt.Unchecked) self.Read_check.setCheckState(isReadable if Qt.Checked else Qt.Unchecked) self.W_check.setCheckState(isWritable if Qt.Checked else Qt.Unchecked) self.E_check.setCheckState(isExecutable if Qt.Checked else Qt.Unchecked) app=QApplication(sys.argv)dialog=FileInformation()dialog.show()app.exec_()
0 0
- 【PyQt4 实例23】获取文件属性(下)
- 【PyQt4 实例23】获取文件属性(上)
- wince下获取文件属性
- wince下获取文件属性续
- Linux下文件属性的获取
- Linux下文件属性的获取
- 【PyQt4 实例18】获取网卡信息
- Ubuntu下PyQt4官方文档获取
- python获取文件属性(转)
- VC下文件属性的获取与更改
- 获取文件属性
- 获取文件属性
- 获取文件属性
- 获取文件属性
- 文件属性获取
- Linux获取文件属性stat()、fstat()、lstat()函数实例学习
- IOS获取文件属性。(包括创建日期)
- 封装类之FileVersion(获取文件属性)
- 编译Sqoop2错误解决
- ASP.NET MVC Unity Controller Factory
- iOS - 系统常用框架(framework)的简单介绍
- CodeForces 165E Compatible Numbers
- java 中文转化为unicode
- 【PyQt4 实例23】获取文件属性(下)
- LeetCode: Gary Code
- 在CentOS 6.3下安装MPlayer-1.0rc4
- 赚宗踪抓组佐爪爪祝总罪嘴卓驻注诅子灼
- Activity之间的动画切换
- Objective-C的setter和getter
- td内容 换行和不换行
- Android 屏幕截图并且发送email
- 着诅资住诅棕酌椎浊注桌座茁族宗钻转庄