<岩滑textarea id="a"></textarea>
<textarea id="b"></textarea>
<input type="button" value="提交" onclick="tijiao()" />
<input type="button" value="删除" onclick="shanchu()" />
</form>
<script type="text/javascript">
var neirong=new Array
var i=0
function tijiao()
{
var body=document.getElementById("a").value
for(var j=0j<ij++)
{if(neirong[j]==body)
{alert("重复")var p=0}
else var p=1
}
if(p=1)
{
var neirong[i]=body
var b=""
for(var k=0k<=ik++)
{b=b+"<br />"+neirong[k]}
document.getElementById("b").value=b
i++
}
}
function shanchu()
{
var body=document.getElementById("轿改a").value
for(var j=0j<=ij++)
{if(neirong[j]==body)
{for(var q=jq<iq++)
{neirong[q]=neirong[q+1]}
i--}
}
var b="闭枣判"
for(var k=0k<=ik++)
{b=b+"<br />"+neirong[k]}
document.getElementById("b").value=b
}
QAbstractButton/QPushButton,QToolButton,QRadioButton,QCheckBox
按钮状态:
isDown() isChecked() isEnable() isCheckAble() setAutoRepeat()
click
setEnabled() setText() text()
'''
【简辩歼介】
PyQt5中友灶卖好逗QButton例子
'''
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class Form(QDialog):
def init (self, parent=None):
super(Form, self). init (parent)
layout = QVBoxLayout()
if name == ' main ':
app = QApplication(sys.argv)
btnDemo = Form()
btnDemo.show()
sys.exit(app.exec_())
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)