Results 1 to 3 of 3

Thread: Highlight open & close brackets in QTextEdit

  1. #1
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Highlight open & close brackets in QTextEdit

    Hi,

    I want to highlight open and close braces in QTextEdit exactly how Qt creator does when we code.
    when I move my cursor to open brace "(" the respective close brace ")" should be highlight and opposite also should work.

    I am interested to know is there a way available in Qt already for this behavior or do we need to implement our own algorithm.

    Thanks in advance :-)
    Last edited by prasad_N; 31st July 2015 at 21:14.
    Thanks :-)

  2. #2
    Join Date
    Feb 2015
    Posts
    7
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Highlight open & close brackets in QTextEdit

    Hi.

    I think you can take a look here: http://www.qtcentre.org/threads/6165...ht=#post272950. There are many features for editors in that program. Even though it is python, I believe implementation in C++ won't differ much.

  3. #3
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Highlight open & close brackets in QTextEdit

    Here is the best I found. we could extract
    automatic parenthesis matcher
    part from this.

    http://qt-apps.org/content/show.php/...content=125532
    Thanks :-)

  4. The following user says thank you to prasad_N for this useful post:

    emobemo (22nd August 2019)

Similar Threads

  1. Forcing a QTextEdit to highlight
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 26th November 2012, 00:45
  2. Open or close?
    By isaias1984 in forum Newbie
    Replies: 3
    Last Post: 12th July 2011, 13:31
  3. QTextEdit contents changed highlight the color
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 3
    Last Post: 8th June 2011, 18:31
  4. highlight in QTextEdit
    By ubuntudevelop78 in forum Qt Programming
    Replies: 1
    Last Post: 27th November 2009, 01:22
  5. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 21:39

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.