Results 1 to 3 of 3

Thread: Wrap Text in PUSHBUTTON

  1. #1
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Wrap Text in PUSHBUTTON

    hi,
    how to wrap the text in QPUSHBUTTON?

    Thanks
    Bala

  2. #2
    Join Date
    Jun 2007
    Posts
    1
    Thanked 1 Time in 1 Post

    Default Re: Wrap Text in PUSHBUTTON

    try this:
    QPushButton("123\n456")

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

    BalaQT (16th September 2009)

  4. #3
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Wrap Text in PUSHBUTTON

    thanks,
    it works
    i coded manually. but is there anyother ways to do it automatically?

    Qt Code:
    1. int wrapLen=30;
    2. if(strCaption.length()>wrapLen)
    3. {
    4. strCaption=strCaption.left(wrapLen)+"\n"+strCaption.mid(wrapLen,strCaption.length()-wrapLen+1);
    5. }
    To copy to clipboard, switch view to plain text mode 

    Thnks
    Bala

Similar Threads

  1. vertical pushbutton text
    By eric in forum Qt Programming
    Replies: 11
    Last Post: 18th April 2019, 20:17
  2. How to wrap text in a label?
    By sasi in forum Qt Programming
    Replies: 5
    Last Post: 22nd October 2016, 05:14
  3. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 10:49
  4. how can I make a balloon to wrap the editable text?
    By learning_qt in forum Qt Programming
    Replies: 9
    Last Post: 20th January 2009, 16:09
  5. Match the text beetween two string
    By dreamer in forum Qt Programming
    Replies: 4
    Last Post: 20th May 2008, 15:48

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.