Results 1 to 3 of 3

Thread: QTextEdit parenthesis matcher works - but only partially

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    May 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit parenthesis matcher works - but only partially : solved

    Hello dear list,

    now wonder, that nobody came up with a solution. The patch is quite short, but tricky too because the Qt4 Quarterly solution only fails with more complex recursion levels.

    When interested look at the attachment. Please note that my "patch" is inherited from "mainWindow" instead of the original "TextEdit" and my Q(Plain)TextEdit is my own "textEdit" instead of "this". For sure you can abstract this minor difference only affecting a few lines.

    So what really changed?

    a) matchParentheses()
    .. only added a reset for new parenthesis counters

    b) matchLeftParenthesis(...
    nothing as this stuff works perfect

    c) matchRightParenthesis(...
    added some missing checks and an additional recursion level when necessary

    All other functions/files from the original Qt4 Quarterly code can stay completely unchanged.


    Kind regards, Heinz
    Attached Files Attached Files

Similar Threads

  1. Replies: 3
    Last Post: 26th April 2010, 03:15
  2. Replies: 5
    Last Post: 31st January 2009, 07:36
  3. Replies: 2
    Last Post: 19th December 2008, 15:57
  4. Replies: 1
    Last Post: 16th February 2007, 07:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.