Re: [PyQt] General questions on parsing large QStrings

2013-05-13 Thread David Cortesi
> > Which is why you wouldn't do it, even in C++. You would use QTextDocument, > QSyntaxHighlighter etc. > Sorry, that was a stupid example, as a I realized not long after hitting "send." My fault. ___ PyQt mailing listPyQt@riverbankcomputing.com htt

Re: [PyQt] General questions on parsing large QStrings

2013-05-13 Thread Joel B. Mohler
On 05/13/2013 01:12 AM, David Cortesi wrote: That is not IMO a good design choice. At least if toPlainText returns a const QString reference, one can then use r/o QString methods like count(), contains(), indexOf etc, without penalty. Also one could provide it to a QRegExp, e.g.: j = qre.ind

Re: [PyQt] General questions on parsing large QStrings

2013-05-13 Thread Phil Thompson
On Sun, 12 May 2013 22:12:00 -0700, David Cortesi wrote: > Thanks to you and Mathias for the prompt replies. > > > docstring = unicode( myEditor.toPlainText() ) >> In PyQt5 toPlainText() will return a str object for Python3 and a unicode >> object for Python2. >> > > And, as Mathias says, i

Re: [PyQt] General questions on parsing large QStrings

2013-05-12 Thread David Cortesi
Thanks to you and Mathias for the prompt replies. > docstring = unicode( myEditor.toPlainText() ) > In PyQt5 toPlainText() will return a str object for Python3 and a unicode > object for Python2. > And, as Mathias says, it is a copy?... That is not IMO a good design choice. At least if toPla

Re: [PyQt] General questions on parsing large QStrings

2013-05-12 Thread Phil Thompson
On Sun, 12 May 2013 13:19:55 -0700, David Cortesi wrote: > For an app to be built with PyQt5/Qt5, I will have a > QPlainTextEdit in which the document may be quite > sizable, 500K characters or more. > > I will want at times to inspect the document character > by character, or possibly apply Pyth

Re: [PyQt] General questions on parsing large QStrings

2013-05-12 Thread Mathias . Born
On 12.05.2013, 22:19:55 David Cortesi wrote: > For an app to be built with PyQt5/Qt5, I will have a > QPlainTextEdit in which the document may be quite > sizable, 500K characters or more. > I will want at times to inspect the document character > by character, or possibly apply Python relib REs to

[PyQt] General questions on parsing large QStrings

2013-05-12 Thread David Cortesi
For an app to be built with PyQt5/Qt5, I will have a QPlainTextEdit in which the document may be quite sizable, 500K characters or more. I will want at times to inspect the document character by character, or possibly apply Python relib REs to it. I am somewhat at sea regarding the relationship b