【发布时间】:2020-10-07 09:55:36
【问题描述】:
首先,我是一名韩国学生。所以我英语不好,请见谅。
我正在使用 PyQt5。但我不知道“如何使用setOkButtonText()”
setOkButtonText()或setCancelButtonText()如何使用?
我在哪里插入这些代码?
以下是我的部分代码:
import sys
import PyQt5
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5 import uic
class MainDialog(QDialog):
def __init__(self):
QDialog.__init__(self, None)
uic.loadUi(WdmUI, self)
self.depositButton.clicked.connect(self.depositClicked)
self.withdrawButton.clicked.connect(self.withdrawClicked)
def withdrawClicked(self):
while True:
money1, ok1 = QInputDialog.getInt\
(self, "Withdraw", "<font face=\"Malgun Gothic\">Input withdraw amount:</font>", 1000, 0, 10000001)
QInputDialog.setOkButtonText(self, "OKOK")
这是它产生的错误:
TypeError: setOkButtonText(self, str): 未绑定方法的第一个参数必须具有类型“QInputDialog”
【问题讨论】: