Is it able to get the font from the selected text in QTextEdit textCursor()
-
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?
-
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
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.
@JonB thx a lot! by the way, as a qt beginner, may I ask an efficient way learning and handling qt?
-
@JonB thx a lot! by the way, as a qt beginner, may I ask an efficient way learning and handling qt?
@calcualatexzy Dunno, as a beginner I just did it! :)