如何将QtLabel NAME(txtOutput)设置为变量字符串textout?

2024-06-23 02:36:32 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我按下的按钮

def setupUi(self, MainForm):
         self.BtnOK.clicked.connect(self.wordReverse)

这是反转功能

def wordReverse(self):
         textin = self.TxtInput.text()
         textout = textin[::-1]
         self.txtOutput.setText(self, print(textout)

我的问题在最后一行。按下按钮时,如何在标签(txtOutput)上显示字符串变量(textout)


Tags: textself功能defconnect按钮clickedsetupui