Browse Source

Removed SIP dependency
Changed QString and QStringList to native python str and list

Timo Dritschler 3 years ago
parent
commit
dd820188c2
3 changed files with 3 additions and 7 deletions
  1. 1 1
      KCG/base/LeftBar.py
  2. 2 2
      KCG/base/loghandler.py
  3. 0 4
      kcg.py

+ 1 - 1
KCG/base/LeftBar.py

@@ -480,7 +480,7 @@ class LeftBar(kcgw.KCGWidgets):
         else:
             if text in iter(self.openDataNames.values()):
                 return
-            self.openDataNames[unique_id] = QtCore.QString(text)  # Add a qstring for comparison
+            self.openDataNames[unique_id] = text  # Add a qstring for comparison
         self.openData[unique_id] = QtGui.QTreeWidgetItem()
         self.openData[unique_id].uid = unique_id
         self.openData[unique_id].is_child = False

+ 2 - 2
KCG/base/loghandler.py

@@ -75,7 +75,7 @@ class Highlighter(QtGui.QSyntaxHighlighter):
         keyword = QtGui.QTextCharFormat()
         keyword.setForeground(QtCore.Qt.darkBlue)
         keyword.setFontWeight(QtGui.QFont.Bold)
-        keywords = QtCore.QStringList(kw)
+        keywords = kw
         for word in keywords:
             pattern = QtCore.QRegExp("\\b" + word + "\\b")
             self.highlightingRules.append((pattern, keyword))
@@ -98,7 +98,7 @@ class Highlighter(QtGui.QSyntaxHighlighter):
                 pref_format = self.format(index)
                 pref_format.merge(format)
                 self.setFormat(index, length, pref_format)
-                index = text.indexOf(pattern, index + length)
+                index = pattern.indexIn(text, index + length)
 
         self.setCurrentBlockState(0)
 

+ 0 - 4
kcg.py

@@ -3,9 +3,5 @@ from __future__ import print_function
 from __future__ import division
 from __future__ import absolute_import
 
-import sip #needed for pyQT4 to run with python 3
-sip.setapi('QString', 1)
-sip.setapi('QStringList', 1)
-
 import KCG.kcg as k
 k.run()