[Qt-interest] QTextEdit contents changed highlight the color

Gopalakrishna Bhat gopalakbhat at gmail.com
Wed Jun 8 21:03:34 CEST 2011


Hi,

You can have a look at QTextCursor to highlight the modified block.
You should keep track of the modified QTextBlock(s) . On save you can
restore these to the non highlighted text.

With regards,
Gopalakrishna

On 6/8/11, Sujan Dasmahapatra <sdh at lmwindpower.com> wrote:
> Dear Friends
>
> I need your help in implementing a TextEdit....I have the functionality
> of saving  option of the text available in the TextEdit. But everytime
> user loads a file and when starts editing the file the contents  changed
> in the file should be highlighted with some color. And when save it it
> should return back to the original black & white color.
>
> I am not getting any idea about this. Any suggestions would  be highly
> appreciated.
>
>
>
> QString contents;
>
> QTextEdit *textEdit = new QTextEdit(this);
>
> textEdit->setPlainText(contents);
>
> textEdit->show();
>
>
>
> Now after displaying the contents user wants to modify the contents, so
> all the contents only the modified part should be highlighted with some
> color, and when save it then come back to the normal mode.
>
>
>
>
>
>
>
> Kind Regards,
>
>
>
>
>
> Sujan Dasmahapatra
> Project Leader, Aero Group
> Aero Group
>
> Tel    +91 80 66470248
> Mob
>
> sdh at lmwindpower.com <mailto:%25EMAIL%25>
>
>
>
> LM Wind Power Blades
>
> lmwindpower.com
>
>
>
> Together we capture the wind to power a cleaner world
>
> ________________________________
>
>
>
> This e-mail and any attachments are confidential. If you are not the
> named or intended recipient, please notify the sender immediately and do
> not disclose the contents to any other person, use it for any purpose,
> or store or copy the information in any medium. Any unauthorized
> disclosure, use or storage is prohibited and might be unlawful.
>
>


-- 
My blog http://gkbhat.blogspot.com



More information about the Qt-interest-old mailing list