PDA

View Full Version : Highlight open & close brackets in QTextEdit



prasad_N
31st July 2015, 14:44
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 :-)

Kozersky
1st August 2015, 21:15
Hi.

I think you can take a look here: http://www.qtcentre.org/threads/61650-Creating-indent-guides-for-QPlainTextEdit?p=272950&highlight=#post272950. There are many features for editors in that program. Even though it is python, I believe implementation in C++ won't differ much.

prasad_N
9th August 2015, 10:27
Here is the best I found. we could extract
automatic parenthesis matcher part from this.

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