Apr-18-2022, 06:40 PM
Thanks @deanhystad
I have reflected on the approach I am taking and the problem I am trying to solve and believe there is probably a more elegant way of doing what I am trying to do. My original idea was to use the formating information to derive the significance of certain text in the editor, for example: if a word was underlined in red it would denote that it was misspelt, but if it was underlined in blue it would indicate that it was grammatically wrong.
I do not think I should be using the syntax characters attributes as the identifier of certain properties pertaining to a word or a piece of text. I think instead I should be using metadata in the document itself, perhaps with something like QTextBlockUserData. So, I have begun to look in that direction now.
I appreciate you taking the time to answer my question though; it was helpful in making me reflect on what I wanted to do.
I have reflected on the approach I am taking and the problem I am trying to solve and believe there is probably a more elegant way of doing what I am trying to do. My original idea was to use the formating information to derive the significance of certain text in the editor, for example: if a word was underlined in red it would denote that it was misspelt, but if it was underlined in blue it would indicate that it was grammatically wrong.
I do not think I should be using the syntax characters attributes as the identifier of certain properties pertaining to a word or a piece of text. I think instead I should be using metadata in the document itself, perhaps with something like QTextBlockUserData. So, I have begun to look in that direction now.
I appreciate you taking the time to answer my question though; it was helpful in making me reflect on what I wanted to do.