Results 1 to 4 of 4

Thread: buton text long ?

  1. #1
    Join Date
    Oct 2009
    Posts
    30
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default buton text long ?

    Hi all,
    i am using TOOLBUTTON.My button name is very long.(like "this is my first button").How can ı show the button name like this lower sub.


  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: buton text long ?

    What about
    Qt Code:
    1. QToolButton *toolButton = //...
    2. toolButton->setText("this is my first button \n and in the second line there ist more text \n hey and in the third also!!!");
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Oct 2009
    Posts
    30
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: buton text long ?

    hi Lykurg,

    I want to auto line.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: buton text long ?

    Quote Originally Posted by electronicboy View Post
    I want to auto line.
    For that you have to subclass and do the drawing yourself using QTextDocument with a preferred width. See the class QwwRichTextButton from wwWidgets for inspiration.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. QCheckBox with long text label
    By Ferdous in forum Newbie
    Replies: 5
    Last Post: 29th October 2011, 19:05
  3. Layout long text in QTableWidget
    By Tamtam in forum Newbie
    Replies: 0
    Last Post: 13th February 2009, 15:09
  4. How to trim long text in status bar
    By araglin in forum Newbie
    Replies: 2
    Last Post: 15th January 2009, 21:36
  5. how to srcoll a long text in one line from right to left?
    By deweyjew in forum Qt Programming
    Replies: 3
    Last Post: 21st November 2006, 10:10

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.