Made a change to the tr() change to handle using eric5 with Qt5.

Sat, 11 Jan 2014 13:05:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 11 Jan 2014 13:05:23 +0100
changeset 3193
d425f6251b6b
parent 3192
34689c08f095
child 3194
c95193671ab5

Made a change to the tr() change to handle using eric5 with Qt5.

Toolbox/Startup.py file | annotate | diff | comparison | revisions
--- a/Toolbox/Startup.py	Sat Jan 11 12:55:28 2014 +0100
+++ b/Toolbox/Startup.py	Sat Jan 11 13:05:23 2014 +0100
@@ -10,7 +10,8 @@
 import os
 import sys
 
-from PyQt4.QtCore import QTranslator, QLocale, QLibraryInfo, QDir, QTextCodec
+from PyQt4.QtCore import QTranslator, QLocale, QLibraryInfo, QDir, \
+    QTextCodec, qVersion
 from PyQt4.QtGui import QApplication
 
 from E5Gui.E5Application import E5Application
@@ -161,8 +162,9 @@
     
     global loaded_translators
     
-    # set the default encoding for tr()
-    QTextCodec.setCodecForTr(QTextCodec.codecForName("utf-8"))
+    if qVersion() < "5.0.0":
+        # set the default encoding for tr()
+        QTextCodec.setCodecForTr(QTextCodec.codecForName("utf-8"))
     
     translations = ("qt", "eric5") + translationFiles
     loc = Preferences.getUILanguage()

eric ide

mercurial