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. Can I get the (x,y) coordinates of a character in a QLabel?
Qt 6.11 is out! See what's new in the release blog

Can I get the (x,y) coordinates of a character in a QLabel?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 542 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.
  • A Offline
    A Offline
    AlaaM
    wrote on last edited by AlaaM
    #1

    I have a text in a QLabel and I need to know the absolute (x,y) coordinates of a given character inside it.
    I also have that character selected (by QLabel::setSelection) if that helps.
    I thought of getting the width of the text up until the selection (by QFontMetrics::width()), but duo to some limitations I can't do that.

    Thanks

    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