码迷,mamicode.com
首页 > 其他好文 > 详细

PYQT控件使用

时间:2014-04-28 06:49:26      阅读:613      评论:0      收藏:0      [点我收藏+]

标签:com   string   ext   tab   get   ble   set   line   table   text   word   

QtGui.QComboBox

 

.addItem(string)
#添加字符串项到Item
.addItems(list)
#添加列表或元组元素到Item
.clear()
#清除所有Item
.clearEditText()
#清除编辑框内容
.count()
#返回Item数目
.currentIndex()
#返回当前选择索引,从0开始
.currentText()
#返回当前选择内容
.insertItem(index,string)
#插入字符串项到Item项index后
.insertItems(index,list)
#插入列表或元组元素到Item项index后
.insertSeparator(index)
#插入分隔符到Item项index后
.itemText(index)
#返回Item项index的内容
.removeItem(index)
#删除Item项index
.setCurrentIndex(index)
#设置Item项index为当前选择
.setEditable(True)
#设置选框可编辑
.setEditText(string)
#设置编辑框内容
.setItemText(index,string)
#设置Item项index内容为字符串值


QtGui.QLineEdit

 

.backspace()
#模拟backspace退格键
.clear()
#清除输入框内容
.cursorPosition()
#返回输入框光标位置,从0开始
.setEchoMode(EchoMode)
#设置输入框显示格式
#0--Normal,1--NoEcho,2--Password,3--PasswordEchoOnEdit
.setPlaceholderText(string)
#设置输入框浮显文字
.setReadOnly(True)
#设置输入框只读
.setText(string)
#设置输入框内容
.text()
#返回输入框内容


QtGui.QSpinBox

 

.setMaximum(max)
#设置最大值
.setMinimum(min)
#设置最小值
.setRange(min,max)
#设置范围
.setSingleStep(step)
#设置步长
.setValue(num)
#设置输入框当前值
.value()
#返回输入框当前值


QtGui.QLabel

 

.clear()
#清除标签内容
.setPixmap(QtGui.QPixmap(path))
#设置标签内容图片
.setText(string)
#设置标签内容文字
.text()
#返回标签内容


QtGui.QListWidget

 

.addItem(string)
#添加字符串项到Item
.addItems(list)
#添加列表或元组元素到Item
.clear()
#清除所有Item
.count()
#返回Item数目
.currentItem()
#返回当前选择Item类,没选返回None
.currentRow()
#返回当前选择索引行,从0开始,没选返回-1
.insertItem(row,string)
#插入字符串项到Item项row行后
.insertItems(row,list)
#插入列表或元组元素到Item项row行后
.item(row)
#返回Item项row行的Item类
.setCurrentItem(item)
#设置Item项item为当前选择
.setCurrentRow(row)
#设置Item项row行为当前选择

Item类方法:
.text()
#返回内容
.setText()
#设置内容

PYQT控件使用,布布扣,bubuko.com

PYQT控件使用

标签:com   string   ext   tab   get   ble   set   line   table   text   word   

原文地址:http://www.cnblogs.com/doudongchun/p/3694771.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!