Results 1 to 4 of 4

Thread: KTitleWidget & word wrap

  1. #1
    Join Date
    Aug 2008
    Posts
    70
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default KTitleWidget & word wrap

    Hi,

    I am using a KTitleWidget and sometimes the test displayed is too long for the screen.

    So, how can I use word wrap on KTitleWidget (like QLabel::setWordWrap) ?

    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: KTitleWidget & word wrap

    Set the text as rich text, not as plain text.
    Qt Code:
    1. widget->setText("<html><body>My long title</body></html>");
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2008
    Posts
    70
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: KTitleWidget & word wrap

    Hi Wysota,

    I tried your proposal but it doesn't work.
    The long test is displayed on only one line, the widget is resized and the main panel is larger than the screen.

    Do you have an other idea ?

    Thank you.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: KTitleWidget & word wrap

    Yes, use QLabel Seriously, if it doesn't work then it's a limitation of KTitleWidget and there is not much we can do about it. I suggest you use some other widget instead. KTitleWidget is a very simple widget, you can emulate it with QLabel and a timer and you'll get wordwrapping for free.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Word wrap of QLabel
    By jimfan in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2008, 04:49
  2. Qt layouting + QLabel's word wrap = bug?
    By dimuz in forum Qt Programming
    Replies: 6
    Last Post: 5th September 2007, 11:15
  3. Word wrap in QListView
    By jiveaxe in forum Qt Programming
    Replies: 33
    Last Post: 1st September 2007, 21:06
  4. QListView word wrap
    By serega in forum Qt Programming
    Replies: 17
    Last Post: 30th August 2007, 03:13
  5. Word wrapping in a QTableWidget cell
    By jcooperddtd in forum Qt Programming
    Replies: 3
    Last Post: 1st May 2007, 03:57

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.