QpushButton从功能设置按钮文本

时间:2019-12-09 21:31:47

标签: python pyqt5 qpushbutton

我想从db函数调用中获取按钮文本。这样,按钮的命名就类似于数据库中的项目。我正在做一个餐厅管理项目。

def botun():
with conn:
    c.execute("select item from items where code=1")
    a = print(c.fetchall())
return a

b = botun()

我不知道如何实现以及在哪里实现,我是否将召回插入retranslateUi

self.pushPice_1.setText(_translate("MainWindow", "PushButton"))

或另类

self.pushPice_1.setText()

非常感谢您!

0 个答案:

没有答案