20 lines
504 B
Python
20 lines
504 B
Python
import sys
|
|
from PySide6.QtWidgets import QApplication, QWidget
|
|
from demo3 import Ui_Form
|
|
|
|
class Window(Ui_Form,QWidget):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setupUi(self)
|
|
self.pushButton.clicked.connect(self.change_label)
|
|
|
|
def change_label(self):
|
|
str1="问渠那得清如许,唯有源头活水来。"
|
|
self.label.setText(str1)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app = QApplication(sys.argv)
|
|
win = Window()
|
|
win.show()
|
|
sys.exit(app.exec()) |