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. How to get a QTextBlock bounding QRectF from a QTextEdit
Forum Updated to NodeBB v4.3 + New Features

How to get a QTextBlock bounding QRectF from a QTextEdit

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 529 Views 2 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.
  • N Offline
    N Offline
    Nite Coder
    wrote on last edited by
    #1

    I want to create a QTextEdit widget that supports line numbers and I need something to find a QRectF so I can calculate line number positions

    Basic Info

    • I have Qt 5.11
    • I am using KDE Neon
    raven-worxR 1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      With QTextBlock it is not possible. Just see if you can do some thing by taking QTextLine. Have not tried myself.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • N Nite Coder

        I want to create a QTextEdit widget that supports line numbers and I need something to find a QRectF so I can calculate line number positions

        Basic Info

        • I have Qt 5.11
        • I am using KDE Neon
        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @Nite-Coder
        take a look at the Codeeditor example
        It uses a QPlainTextEdit though, which provides QPlainTextEdit::blockBoundingRect()

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        1

        • Login

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