Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QLabel word wrap minimum width inconsistent
Qt 6.12 LTS is out! See what's new in the release blog

QLabel word wrap minimum width inconsistent

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.1k 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.
  • L Offline
    L Offline
    LinW
    wrote on last edited by LinW
    #1

    Hi,

    I'm new to Qt development. I'm trying to display a list of name-value pairs. Each pair is input into 2 QLables separately, which are all in a QGridLayout. What I noticed is that when wordWrap is enabled, QLabel's minimum width is different depending the length of its text.

    Has anyone else run into this issue? Is there way to set a consistent minimum width for every QLabels?

    Thanks,
    Lin

    1 Reply Last reply
    0
    • mzimmersM Offline
      mzimmersM Offline
      mzimmers
      wrote on last edited by
      #2

      You can look into: setColumnMinimumWidth. It's not a perfect answer, but it might be enough for you.

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        We also talked aout word wrap here.

        https://forum.qt.io/topic/128286/qlabel-with-wordwrap-fixed-vertical-policy-and-stretched-for-the-whole-qdialog-s-width-fails-to-resize-height/9

        In any case, why simply not use a tableWidget ?
        Instead of a lot of labels in a layout ?

        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
        • Unsolved