如何通过单击按钮将小部件添加到QDialog类中?这是我的代码,它确实执行命令,但是在我尝试添加的操作之后不显示按钮。
def next_turn(self): #triggers when button is pressed
textinput = self.consoletext.toPlainText()
game = GameState()
returnvalue = game.gui_input(textinput) #used in the future for format
self.card_graphics()
def card_graphics(self):
print("dude")
card = QPushButton('HK',self)
card.setToolTip('Heart\nHandvalue: 13 \nBoardvalue: 13')
card.setDisabled(True)
card.move(200,200)
card.resize(50,100)
card.setStyleSheet("background-color: rgb(196, 13, 105); color:
rgb(51, 41, 26)")