×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2009
    Location
    Belluno, Italy
    Posts
    11

    QSyntaxHighlighter on a TextEdit

    Hello everybody,
    I have just created two classes (CPPHighlighter and CSharpHighlighter) that inherits from QSyntaxHighlighter to provide colored Source Code on a TextEdit.

    I have also created a menu to switch between them. However when I switch the code is not highluighte in the new language but keeps old highlighting. Any suggestions on how to fix this (could be that highlightblock is called only when text changes). CPPHighlighter is almost the same as in the QSyntaxHiglighter Demo.

    Thanks

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QSyntaxHighlighter on a TextEdit

    Did you try QSyntaxHiglighter::rehighlight()?
    http://doc.qt.nokia.com/4.6/qsyntaxh...ml#rehighlight

  3. #3
    Registered User
    Join Date
    May 2009
    Location
    Belluno, Italy
    Posts
    11

    Re: QSyntaxHighlighter on a TextEdit

    Thank you so much... I didn't know about that. Now it should work.

Similar Threads

  1. Need Listbox and TextEdit on screen
    By blackpaw in forum Symbian
    Replies: 2
    Last Post: 2008-04-03, 14:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×