[QScintilla] text() function including <CR> or <CR><LF> in QString

Daniel J Sebald daniel.sebald at ieee.org
Mon Jul 27 08:49:22 BST 2015


Hello QScintilla,

In using the text(LINENUMBER) function:

http://pyqt.sourceforge.net/Docs/QScintilla2/classQsciScintilla.html#ae7ad66e5c3ff4bf3f93feeb5cc535716

I've found that <CR> (in the case of Linux) appears to be included as 
part of the QString returned.  The QString .length() member function can 
then be used to position the QScintilla cursor at the start of the line 
after LINENUMBER because it appears the <CR> is ignored by the 
QScintilla index.

Someone reported a bug with that approach on Windows systems (off by one 
character).  I don't have a Windows computer, but I presume that for 
Windows the same holds true and that <CR> and <LF> are part of the 
QString.  Hence the .length() member function indicates one longer for 
Windows.

If QScintilla is going to treat Windows' end-of-line character pair as 
one character, perhaps QScintilla's text() function should create a 
QString not having <CR> or <CR><LF>.  In that case no special treatment 
is needed for WIN32.

Thought I'd just mention that even though it is a simple fix to have a 
WIN32 pre-processor conditional in the code I'm working on.

Dan

PS: The following cruft appears in the TGZ archive file:

gtk/makefile.orig
src/Editor.cxx.orig


More information about the QScintilla mailing list