Python Forum
[PyQt] Determining the format attributes on text in a QTextEdit object
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Determining the format attributes on text in a QTextEdit object
#8
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.
Reply


Messages In This Thread
RE: Determining the format attributes on text in a QTextEdit object - by DrakeSoft - Apr-18-2022, 06:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] AttributeError: 'NoneType' object has no attribute 'text' speedev 9 11,604 Sep-25-2021, 06:14 PM
Last Post: Axel_Erfurt
  [Tkinter] Glow text of clickable object on hover with transition andy 6 6,254 May-11-2021, 07:39 AM
Last Post: andy

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020