Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Get font in QTextEdit where cursor is?
Forum Updated to NodeBB v4.3 + New Features

Get font in QTextEdit where cursor is?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 228 Views 1 Watching
  • 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
    clarify
    wrote on last edited by
    #1

    I'm able to determine full font info in a QTextEdit only when a section of text is selected.
    How can I get the full font info when the cursor is between two characters?
    I can read the font family but not the font size...

    Pl45m4P 1 Reply Last reply
    0
    • C clarify

      I'm able to determine full font info in a QTextEdit only when a section of text is selected.
      How can I get the full font info when the cursor is between two characters?
      I can read the font family but not the font size...

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @clarify

      Dont these functions work for you?

      • https://doc.qt.io/qt-6/qtextedit.html#fontPointSize

      • https://doc.qt.io/qt-6/qtextedit.html#currentFont


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      C 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @clarify

        Dont these functions work for you?

        • https://doc.qt.io/qt-6/qtextedit.html#fontPointSize

        • https://doc.qt.io/qt-6/qtextedit.html#currentFont

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

        @Pl45m4
        Yes what I came to realize is that sometimes I have to read out the pixel size and sometimes the point size. It's almost unpredictable which one will be valid at any given point. It seems like a bug.

        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