Implemented a workaround for a non-working implementation of inputMethodEvent() in QScintilla 2.8.x. It simply overwrites these methods with empty ones in order to not loose selected text on focus out.

Sat, 04 Jan 2014 16:23:47 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 04 Jan 2014 16:23:47 +0100
changeset 3169
7b1b754a60a6
parent 3168
c2d7fe80623f
child 3170
b177fe3b0063

Implemented a workaround for a non-working implementation of inputMethodEvent() in QScintilla 2.8.x. It simply overwrites these methods with empty ones in order to not loose selected text on focus out.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Fri Jan 03 18:53:10 2014 +0100
+++ b/APIs/Python3/eric5.api	Sat Jan 04 16:23:47 2014 +0100
@@ -7266,6 +7266,8 @@
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.hideFindIndicator?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.indentationGuideView?4()
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.indicatorDefine?4(indicator, style, color)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.inputMethodEvent?4(evt)
+eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.inputMethodQuery?4(query)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.lineAt?4(pos)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.lineEndPosition?4(line)
 eric5.QScintilla.QsciScintillaCompat.QsciScintillaCompat.lineIndexFromPosition?4(pos)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Fri Jan 03 18:53:10 2014 +0100
+++ b/Documentation/Help/source.qhp	Sat Jan 04 16:23:47 2014 +0100
@@ -9417,6 +9417,8 @@
       <keyword name="QsciScintillaCompat.hideFindIndicator" id="QsciScintillaCompat.hideFindIndicator" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.hideFindIndicator" />
       <keyword name="QsciScintillaCompat.indentationGuideView" id="QsciScintillaCompat.indentationGuideView" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.indentationGuideView" />
       <keyword name="QsciScintillaCompat.indicatorDefine" id="QsciScintillaCompat.indicatorDefine" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.indicatorDefine" />
+      <keyword name="QsciScintillaCompat.inputMethodEvent" id="QsciScintillaCompat.inputMethodEvent" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.inputMethodEvent" />
+      <keyword name="QsciScintillaCompat.inputMethodQuery" id="QsciScintillaCompat.inputMethodQuery" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.inputMethodQuery" />
       <keyword name="QsciScintillaCompat.lineAt" id="QsciScintillaCompat.lineAt" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.lineAt" />
       <keyword name="QsciScintillaCompat.lineEndPosition" id="QsciScintillaCompat.lineEndPosition" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.lineEndPosition" />
       <keyword name="QsciScintillaCompat.lineIndexFromPosition" id="QsciScintillaCompat.lineIndexFromPosition" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.lineIndexFromPosition" />
--- a/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Fri Jan 03 18:53:10 2014 +0100
+++ b/Documentation/Source/eric5.QScintilla.QsciScintillaCompat.html	Sat Jan 04 16:23:47 2014 +0100
@@ -238,6 +238,12 @@
 <td><a href="#QsciScintillaCompat.indicatorDefine">indicatorDefine</a></td>
 <td>Public method to define the appearance of an indicator.</td>
 </tr><tr>
+<td><a href="#QsciScintillaCompat.inputMethodEvent">inputMethodEvent</a></td>
+<td>Protected method to cope with a glitch in some Qscintilla versions handling input events.</td>
+</tr><tr>
+<td><a href="#QsciScintillaCompat.inputMethodQuery">inputMethodQuery</a></td>
+<td>Protected method to cope with a glitch in some Qscintilla versions handling input events.</td>
+</tr><tr>
 <td><a href="#QsciScintillaCompat.lineAt">lineAt</a></td>
 <td>Public method to calculate the line at a position.</td>
 </tr><tr>
@@ -1013,6 +1019,34 @@
 <dd>
 the indicator or style are not valid
 </dd>
+</dl><a NAME="QsciScintillaCompat.inputMethodEvent" ID="QsciScintillaCompat.inputMethodEvent"></a>
+<h4>QsciScintillaCompat.inputMethodEvent</h4>
+<b>inputMethodEvent</b>(<i>evt</i>)
+<p>
+        Protected method to cope with a glitch in some Qscintilla versions
+        handling input events.
+</p><p>
+        Note: This simply disables the Qscintilla behavior.
+</p><dl>
+<dt><i>evt</i></dt>
+<dd>
+reference to the input method event object
+            (QInputMethodEvent)
+</dd>
+</dl><a NAME="QsciScintillaCompat.inputMethodQuery" ID="QsciScintillaCompat.inputMethodQuery"></a>
+<h4>QsciScintillaCompat.inputMethodQuery</h4>
+<b>inputMethodQuery</b>(<i>query</i>)
+<p>
+        Protected method to cope with a glitch in some Qscintilla versions
+        handling input events.
+</p><p>
+        Note: This simply disables the Qscintilla behavior.
+</p><dl>
+<dt><i>query</i></dt>
+<dd>
+reference to the input method query object
+            (Qt.InputMethodQuery)
+</dd>
 </dl><a NAME="QsciScintillaCompat.lineAt" ID="QsciScintillaCompat.lineAt"></a>
 <h4>QsciScintillaCompat.lineAt</h4>
 <b>lineAt</b>(<i>pos</i>)
--- a/QScintilla/Editor.py	Fri Jan 03 18:53:10 2014 +0100
+++ b/QScintilla/Editor.py	Sat Jan 04 16:23:47 2014 +0100
@@ -142,7 +142,7 @@
         @exception IOError raised to indicate an issue accessing the file
         """
         super().__init__()
-        self.setAttribute(Qt.WA_DeleteOnClose)
+##        self.setAttribute(Qt.WA_DeleteOnClose)
         self.setAttribute(Qt.WA_KeyCompression)
         self.setUtf8(True)
         
--- a/QScintilla/QsciScintillaCompat.py	Fri Jan 03 18:53:10 2014 +0100
+++ b/QScintilla/QsciScintillaCompat.py	Sat Jan 04 16:23:47 2014 +0100
@@ -709,7 +709,7 @@
             pass
     
     ###########################################################################
-    # methods to perform searches in target range
+    ## methods to perform searches in target range
     ###########################################################################
     
     def positionFromPoint(self, point):
@@ -885,7 +885,7 @@
         self.__targetSearchStart = start + len(r)
     
     ###########################################################################
-    # indicator handling methods
+    ## indicator handling methods
     ###########################################################################
     
     def indicatorDefine(self, indicator, style, color):
@@ -1050,7 +1050,7 @@
             self.SendScintilla(QsciScintilla.SCI_FINDINDICATORHIDE)
     
     ###########################################################################
-    # methods to perform folding related stuff
+    ## methods to perform folding related stuff
     ###########################################################################
     
     def __setFoldMarker(self, marknr, mark=QsciScintilla.SC_MARK_EMPTY):
@@ -1151,7 +1151,7 @@
                            QsciScintilla.SC_MARKNUM_FOLDEREND, backColor)
     
     ###########################################################################
-    # interface methods to the standard keyboard command set
+    ## interface methods to the standard keyboard command set
     ###########################################################################
     
     def clearKeys(self):
@@ -1169,7 +1169,7 @@
         self.standardCommands().clearAlternateKeys()
 
     ###########################################################################
-    # specialized event handlers
+    ## specialized event handlers
     ###########################################################################
     
     def focusOutEvent(self, event):
@@ -1194,9 +1194,33 @@
         @return result of the event handling (boolean)
         """
         return QsciScintillaBase.event(self, evt)
+    
+    def inputMethodEvent(self, evt):
+        """
+        Protected method to cope with a glitch in some Qscintilla versions
+        handling input events.
+        
+        Note: This simply disables the Qscintilla behavior.
+        
+        @param evt reference to the input method event object
+            (QInputMethodEvent)
+        """
+        pass
+    
+    def inputMethodQuery(self, query):
+        """
+        Protected method to cope with a glitch in some Qscintilla versions
+        handling input events.
+        
+        Note: This simply disables the Qscintilla behavior.
+        
+        @param query reference to the input method query object
+            (Qt.InputMethodQuery)
+        """
+        pass
 
     ###########################################################################
-    # interface methods to the mini editor
+    ## interface methods to the mini editor
     ###########################################################################
 
     def getFileName(self):
@@ -1215,7 +1239,7 @@
                 return ""
     
     ###########################################################################
-    # replacements for buggy methods
+    ## replacements for buggy methods
     ###########################################################################
     
     def showUserList(self, id, lst):
@@ -1234,7 +1258,7 @@
                            self._encodeString(self.UserSeparator.join(lst)))
     
     ###########################################################################
-    # utility methods
+    ## utility methods
     ###########################################################################
     
     def _encodeString(self, string):
@@ -1253,7 +1277,7 @@
                 return string.encode("latin-1")
     
     ###########################################################################
-    # methods below have been added to QScintilla starting with version 2.5
+    ## methods below have been added to QScintilla starting with version 2.5
     ###########################################################################
     
     if "positionFromLineIndex" not in QsciScintilla.__dict__:

eric ide

mercurial