from PyQt5.Qt import *
import sys
class Window(QWidget):
def __init__(self):
super().__init__()
self.setup_ui()
def setup_ui(self):
self.ttp()
def ttp(self):
btn=QPushButton(self)
btn.setText('點擊')
btn.move(200,200)
def slot_btn(self):
print('1234')
self.setWindowTitle('我改變了一次')
btn.clicked.connect(slot_btn)
if __name__=='__main__':
app=QApplication(sys.argv)
window=Window()
window.show()
sys.exit(app.exec_())
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/39868.html
上一篇:2020數學建模國賽題目
