. , , .
The problem is that Qtranslator cannot translate this QDialogButtonBox button because there is no line to translate. therefore it must be qt that does this work domestically. or with some mechanism that I don’t know about.
here is another piece of code generated by pyuic4
self.buttonBox = QtGui.QDialogButtonBox(Dialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 8, 0, 1, 1)
As a line, QtGui.QDialogButtonBox.Cancel can be translated if there is no line in the code.
Is it because I am not creating mainwindow and only use QDialog ??
I can not comment on the answer of swanson!
source
share