How does QTextEdit store the text?
Hi,
I want to implement a fuzzy search in a QTextEdit, so I want to know how does it store the text, basically what I need is the list of words and the position of each word (to move the cursor there), is there a way to get that, or should I just get the plain text and do it myself?
Thanks
Re: How does QTextEdit store the text?
You could use QTextCursor to go over the entire document word by word, keep a list of the words, and use position() to remember its position. Depends on what you want exactly. QTextEdit has a find() function too.
Regards,
Marc
Re: How does QTextEdit store the text?
Thanks for answering,
I did what you say, and it worked just as I wanted.
I've seen in the source code that the text is separated in blocks, I'll take a look later.
Cheers.