Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[closed] Need implementation of Find & Replace option similar to QtCreator IDE
haney last edited by
I am implementing find & replace option for my text editor application. I want the find & replace behavior similar to the find & replace option implemented in QtCreator IDE latest one.
I am able to find word and replace word but how to set some background color to the found word or replaced word.
I tried this.
QTextCursor c = textEdit->textCursor();
QTextCharFormat format = c.charFormat(); format.setBackground(Qt::green); // this will set the background of word to green c.setCharFormat(format); }
I tried this to set some background color in order to highlight the replaced word. But after textEdit gains back focus the highlighted part should come to normal and that is not happening.. Now i need to restore the original background and I tried clearBackground() and it dint work for me..
Plz help me with ur ideas.
andre last edited by
Please don't open multiple topics on the same issue. I have closed this topic. Discussion can continue in "your original topic":http://developer.qt.nokia.com/forums/viewthread/12040/ on the same issue.