Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Learning
  3. Qt in Education
  4. Is it able to get the font from the selected text in QTextEdit textCursor()
QtWS25 Last Chance

Is it able to get the font from the selected text in QTextEdit textCursor()

Scheduled Pinned Locked Moved Unsolved Qt in Education
4 Posts 2 Posters 574 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    calcualatexzy
    wrote on last edited by
    #1

    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?

    JonBJ 1 Reply Last reply
    0
    • C calcualatexzy

      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?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @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.

      C 1 Reply Last reply
      0
      • JonBJ JonB

        @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.

        C Offline
        C Offline
        calcualatexzy
        wrote on last edited by
        #3

        @JonB thx a lot! by the way, as a qt beginner, may I ask an efficient way learning and handling qt?

        JonBJ 1 Reply Last reply
        0
        • C calcualatexzy

          @JonB thx a lot! by the way, as a qt beginner, may I ask an efficient way learning and handling qt?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @calcualatexzy Dunno, as a beginner I just did it! :)

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved