1
Код создает окно QDialog
с одним QPushButton
. Нажатие кнопки вызывает окно QMessageBox
с тремя кнопками. Есть ли способ изменить порядок кнопок?Как изменить порядок кнопок в QMessageBox
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication([])
class Dialog(QtGui.QDialog):
def __init__(self, parent=None):
super(Dialog, self).__init__(parent)
self.resize(300, 100)
self.setLayout(QtGui.QVBoxLayout())
button = QtGui.QPushButton('Submit')
button.clicked.connect(self.onclick)
self.layout().addWidget(button)
def onclick(self):
self.close()
messagebox = QtGui.QMessageBox(QtGui.QMessageBox.Warning, "Title text", "body text", buttons = QtGui.QMessageBox.Ok | QtGui.QMessageBox.No | QtGui.QMessageBox.Cancel, parent=self)
messagebox.setDefaultButton(QtGui.QMessageBox.No)
exe = messagebox.exec_()
print exe
dialog = Dialog()
dialog.show()
app.exec_()
Каждый знает, что происходит здесь с кнопки текста проклейки на OSX? Он не сосредоточен. – eephillip