Is it able to get the font from the selected text in QTextEdit textCursor()
Unsolved
Qt in Education
-
I'm making a text editor, and I want to know the font I selected. Is it possible for qt to do this? and how?
-
@calcualatexzy
Examine the QTextCharFormat from something like QTextCharFormat QTextCursor::blockCharFormat() const or QTextCharFormat QTextCursor::charFormat() const.You might also see https://stackoverflow.com/questions/70218510/checking-formatting-of-selected-text-in-qtextedit-pyside6 for some ideas. I don't know if that is over-complicated for your needs.
-
@calcualatexzy Dunno, as a beginner I just did it! :)