[Qt-interest] Stacking / Multiple QSyntaxHighlighter on one document?
Wilhelm
wilhelm.meier at fh-kl.de
Mon Jun 6 09:12:13 CEST 2011
Am 06.06.2011 08:42, schrieb Diego Iastrubni:
> On Mon, Jun 6, 2011 at 8:23 AM, Wilhelm <wilhelm.meier at fh-kl.de> wrote:
>> if I understand the implementation of QSyntaxHighlighter correct, it
>> should be possible to install more than one highlighter instances onto
>> one document, e.g. one generic highlighter for code editing which does
>> parenthesis matching, and then one for a specific language.
>>
>> But there seems no way to add more than one QTextBlockUserData object
>> for one QTextBlock. So if I install more than one highlighter using
>> QTextBlockUserData the second one destroys the user data of the first one.
>>
>> Any chance to get that right?
>
> Solution is simple: just assume that the block data object will have a
> container, and you are done.
Sure.
But, one of the highlighters installs its own QTextBlockUserData object
I want to use it unchanged ( http://srchiliteqt.sourceforge.net/ ).
Well, I don't see any possibility to intercept the
QTextBlock::setUserData() ...
>
> BTW: for parenthesis use set/getExtraSelections
> http://doc.qt.nokia.com/main-snapshot/qplaintextedit.html#setExtraSelections
--
Wilhelm
More information about the Qt-interest-old
mailing list