Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
mock translate and UnicodeUTF8 for PySide2 and PyQt5
  • Loading branch information
lorenzo angeli committed Aug 10, 2016
commit 5bccb00e7fbca89fecf70433268e460f9ec7aea4
15 changes: 15 additions & 0 deletions Qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ def _pyqt5():
PyQt5.__qt_version__ = PyQt5.QtCore.QT_VERSION_STR
PyQt5.load_ui = pyqt5_load_ui

# provide mocked UnicodeUTF8 For backward compatibility
PyQt5.QtWidgets.QApplication.UnicodeUTF8 = None

def translate(self, context, sourceText, disambiguation, n):
return self.translate(context, sourceText, disambiguation)

PyQt5.QtWidgets.QApplication.translate = translate

return PyQt5


Expand Down Expand Up @@ -94,6 +102,13 @@ def _pyside2():
PySide2.__qt_version__ = PySide2.QtCore.qVersion()
PySide2.load_ui = pyside2_load_ui

# provide mocked UnicodeUTF8 For backward compatibility
PySide2.QtWidgets.QApplication.UnicodeUTF8 = None

def translate(self, context, sourceText, disambiguation, n):
return self.translate(context, sourceText, disambiguation)

PySide2.QtWidgets.QApplication.translate = translate
return PySide2


Expand Down