Results 1 to 6 of 6

Thread: How to wrap text in a label?

  1. #1
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question How to wrap text in a label?

    How do i wrap the text (in different lines) in a Qt label? I tried with enter, ALT+Enter, the escape sequences like \n, and html notations, but it doesn't work that way. Can someone help me in writing text in multiple lines?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to wrap text in a label?

    Did you try QLabel::setWordWrap(true) ???

  3. The following user says thank you to aamer4yu for this useful post:

    gkarthick5 (18th August 2011)

  4. #3
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to wrap text in a label?

    Thanks for the reply. But is there a way to set it in the designer (UI form)?

  5. #4
    Join Date
    Apr 2008
    Location
    Russia, Moscow
    Posts
    86
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4

    Default Re: How to wrap text in a label?


  6. The following user says thank you to SABROG for this useful post:

    sasi (29th June 2009)

  7. #5
    Join Date
    Oct 2016
    Posts
    2
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: How to wrap text in a label?

    You can do this in QtDesigner by selecting the label and going to the Property Editor, search for wordWrap and select it.

  8. The following user says thank you to buddhog for this useful post:

    Camryn64 (22nd October 2016)

  9. #6
    Join Date
    Sep 2016
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: How to wrap text in a label?

    fine.. new for me.. thanks for post

Similar Threads

  1. Replies: 15
    Last Post: 31st January 2020, 19:25
  2. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 10:49
  3. QCheckBox with long text label
    By Ferdous in forum Newbie
    Replies: 5
    Last Post: 29th October 2011, 20:05
  4. label with image and text
    By mattia in forum Newbie
    Replies: 1
    Last Post: 7th March 2008, 12:28
  5. Replies: 1
    Last Post: 24th October 2006, 17:40

Tags for this Thread

Bookmarks

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.