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. QLabel sizeHint without images
Qt 6.11 is out! See what's new in the release blog

QLabel sizeHint without images

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

    Hi, everybody
    I have a problem regarding QLabel. I rely on sizeHint() to determine the preferred height of a QLabel with word warp enabled. The problem comes when I try to add image tags (like <img >) to the text. the sizeHint().height() explodes to more than twice the actual required space.
    How can I compute a real measure of the sizehint disregarding img tags?

    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
    ~Napoleon Bonaparte

    On a crusade to banish setIndexWidget() from the holy land of Qt

    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