Results 1 to 11 of 11

Thread: How to Wrap the text in QTableView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: How to Wrap the text in QTableView

    When we are resizing the column in your code, the height of the row is not setting to the content.
    The code I posted does not resize column, it only resizes rows.

    If you want to adjust the height of row after resizing the columns, then you will have to call tableView->resizeRowsToContents(); again

    My requirement is:
    1) Only one column, should be visible which should set to the QTableView
    2) row height should be to the size of content
    3) If the text is big,it should wrap and should be displayed in the next line of the same row.
    The code I posted will do all these
    Last edited by Santosh Reddy; 8th May 2013 at 12:17.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. How to wrap text in a label?
    By sasi in forum Qt Programming
    Replies: 5
    Last Post: 22nd October 2016, 04:14
  2. Replies: 2
    Last Post: 9th April 2013, 06:26
  3. text indent with wrap
    By linuxsong in forum Qt Quick
    Replies: 1
    Last Post: 26th July 2011, 14:14
  4. Custom Delegate and Text Wrap
    By enlightened_j in forum Newbie
    Replies: 2
    Last Post: 17th September 2010, 06:21
  5. Wrap Text in PUSHBUTTON
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 16th September 2009, 13:54

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.