The translate method is different between Qt4 and Qt5.
You can try this Python code:
import sys
from Qt import QtWidgets
class MainWindow(QtWidgets.QWidget):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
title = QtWidgets.QApplication.translate("MainWindow", "MainWindow", None, -1)
def main():
app = QtWidgets.QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
app.exec_()
if __name__ == '__main__':
main()
If I have PySide2, this will work. If I have PySide, I will get the error:
TypeError: 'PySide.QtCore.QCoreApplication.translate' called with wrong argument types:
PySide.QtCore.QCoreApplication.translate(str, str, NoneType, int)
Supported signatures:
PySide.QtCore.QCoreApplication.translate(str, str, str = None, PySide.QtCore.QCoreApplication.Encoding = CodecForTr)
PySide.QtCore.QCoreApplication.translate(str, str, str, PySide.QtCore.QCoreApplication.Encoding, int)
I was trying to compile .ui files like how it is being done in #88 compiling resources . And this always generates a bunch of translate lines.
The translate method is different between Qt4 and Qt5.
You can try this Python code:
If I have PySide2, this will work. If I have PySide, I will get the error:
I was trying to compile .ui files like how it is being done in #88 compiling resources . And this always generates a bunch of translate lines.