【PyQt4 實例23】獲取文件屬性(上)


# -*- coding: utf-8 -*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import sys
QTextCodec.setCodecForTr(QTextCodec.codecForName("utf8"))

class FileInformation(QDialog):
def __init__(self,parent=None):
super(FileInformation,self).__init__(parent)
self.setWindowTitle(self.tr("獲取文件屬性"))

mainLayout=QGridLayout(self)

LabelFile = QLabel(self)
LabelFile.setText(self.tr("文件名:"))
hb1 = QHBoxLayout()
self.LineEditFile = QLineEdit(self)
self.PushButtonFile = QPushButton(self)
self.PushButtonFile.setText(self.tr("文件"))
hb1.addWidget(self.LineEditFile)
hb1.addWidget(self.PushButtonFile)

SizeName = QLabel(self)
SizeName.setText(self.tr("大小:"))
self.LineEditSize = QLineEdit(self)

CDateName = QLabel(self)
CDateName.setText(self.tr("創建時間:"))
self.LineEditCDate = QLineEdit(self)

mainLayout.addWidget(LabelFile,0,0)
mainLayout.addLayout(hb1,0,1)
mainLayout.addWidget(SizeName,1,0)
mainLayout.addWidget(self.LineEditSize,1,1)
mainLayout.addWidget(CDateName,2,0)
mainLayout.addWidget(self.LineEditCDate,2,1)

MDateName = QLabel(self)
MDateName.setText(self.tr("最后修改時間:"))
self.LineEditMDate = QLineEdit(self)
mainLayout.addWidget(MDateName,3,0)
mainLayout.addWidget(self.LineEditMDate,3,1)

VDateName = QLabel(self)
VDateName.setText(self.tr("最后訪問時間:"))
self.LineEditVDate = QLineEdit(self)
mainLayout.addWidget(VDateName,4,0)
mainLayout.addWidget(self.LineEditVDate,4,1)

Propertie = QLabel(self)
Propertie.setText(self.tr("屬性:"))
mainLayout.addWidget(Propertie,5,0)

hb2 = QHBoxLayout()
self.Record_check = QCheckBox(self)
Record = QLabel(self)
Record.setText(self.tr("目錄:"))
hb2.addWidget(self.Record_check)
hb2.addWidget(Record)

self.F_check = QCheckBox(self)
hb2.addWidget(self.F_check)
File = QLabel(self)
File.setText(self.tr("文件:"))
hb2.addWidget(File)

self.S_check = QCheckBox(self)
Symbolic_link = QLabel(self)
Symbolic_link.setText(self.tr("符號鏈接:"))
hb2.addWidget(self.S_check)
hb2.addWidget(Symbolic_link)

self.H_check = QCheckBox(self)
hb2.addWidget(self.H_check)
Hide = QLabel(self)
Hide.setText(self.tr("隱藏:"))
hb2.addWidget(Hide)

self.Read_check = QCheckBox(self)
hb2.addWidget(self.Read_check)
Read = QLabel(self)
Read.setText(self.tr("讀:"))
hb2.addWidget(Read)

self.W_check = QCheckBox(self)
hb2.addWidget(self.W_check)
Write = QLabel(self)
Write.setText(self.tr("寫:"))
hb2.addWidget(Write)

self.E_check = QCheckBox(self)
hb2.addWidget(self.E_check)
Execution = QLabel(self)
Execution.setText(self.tr("執行:"))
hb2.addWidget(Execution)



注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2020 ITdaan.com