我正在制作 QMessageBox,但无法将弹出窗口中的文本和按钮居中。
这是我的消息框的代码:
def update_msgbox(self):
self.msg = QMessageBox(self.centralwidget)
self.msg.setWindowTitle(" Software Update")
self.msg.setText("A software update is available. \nDo you want to update now?")
self.msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
self.msg.setStyleSheet("QLabel{min-width: 200px;}")
self.msg.exec_()
Run Code Online (Sandbox Code Playgroud)
这是弹出窗口当前的样子:
有没有办法使文本居中和按钮居中?