Results 1 to 2 of 2

Thread: Qlabel size string too long

  1. #1
    Join Date
    Sep 2007

    Default Qlabel size string too long

    Hi ppls,

    I have a statusbar on which I add three Qlables. I set the string on these three lables. Sometimes i have too long strings. This is really ugly because the other two lables would not be seen. How can i break such long strings in order to let the other two qlables seen.??

    Thanx in advance.

  2. #2
    Join Date
    Sep 2007
    Rome, GA
    Thanked 41 Times in 35 Posts
    Qt products
    MacOS X Windows

    Default Re: Qlabel size string too long

    not sure what your ultimate intention is, but here are some pointers:

    If you want the text of a QLabel to wrap to the next line, call label->setWordWrap(true);

    Are you using layouts to position the labels in the status bar? Or are you hard-coding the positions? With layouts they would adjust to accomodate the size.

    Call label->adjustSize() whenever you set new text to a QLabel to make sure the label is large enough to fit the new text.
    Last edited by JimDaniel; 10th June 2008 at 16:08.

Similar Threads

  1. QLabel size, for image display
    By C167 in forum Qt Programming
    Replies: 13
    Last Post: 25th October 2013, 16:09
  2. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57
  3. QLabel, large, rich text, font size
    By TheKedge in forum Qt Programming
    Replies: 3
    Last Post: 5th February 2007, 11:56
  4. How to get size (length, width ....) of string or char
    By Krishnacins in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2006, 09:55
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.