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

Wobbling effect in a QLabel

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.7k 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.
  • J Offline
    J Offline
    JulienMaille
    wrote on last edited by
    #1

    I have a problem with a QLabel displaying the processing time of my program. When the times changes between a 2 or 3 numbers values, it produce a wobbling label.
    @Processing time 95 msec.
    Processing time 105 msec.@
    I tried to use tab and also padding with spaces:
    @QString("Processing took\t%1\tmsec.").arg(elapsedTime)
    QString("Processing took %1 msec.").arg(elapsedTime, -3)@
    But it is still wobbling. I would avoid using a constant width font, so is there any way to avoid this wobbling effect?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      HuXiKa
      wrote on last edited by
      #2

      I would put the "XY msec" text in another label, and set it's alignment to Qt::AlignRight.

      If you can find faults of spelling in the text above, you can keep them.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JulienMaille
        wrote on last edited by
        #3

        I had this idea in mind but found it a bit dirty :p

        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