Results 1 to 2 of 2

Thread: I am not able to resize the table widget column to it's contents

  1. #1
    Join Date
    May 2011
    Posts
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question I am not able to resize the table widget column to it's contents

    Hi,
    I have created one QWidget which contains one QTableWidget having 3 columns.
    The last column is "Description". I want the description column to expand depending on the length of the description provided by the user.
    I tried to use
    TableWidget->resizeColumnsToContents();
    TableWidget->setWordWrap(true);

    but still the texts are truncated or scrolled.
    But one thing I observed, when i click on the header of the table then one very small triangle icon is coming on the header and the row is resizing to fit the contents.

    Please provide me some inputs how can I fix this problem. I want it should automatically re-size the column, not user will have to click on the header.

    please.........please..........

  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: I am not able to resize the table widget column to it's contents

    Disable stretchLastSection property of the table header and adjust its resize 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.


Similar Threads

  1. Column/Row no of ComboBox Widget in Table
    By ankurjain in forum Qt Programming
    Replies: 13
    Last Post: 6th December 2011, 11:03
  2. Replies: 1
    Last Post: 1st May 2010, 23:03
  3. Replies: 0
    Last Post: 28th May 2009, 22:38
  4. Table Column Problem
    By kenny_isles in forum Newbie
    Replies: 1
    Last Post: 5th March 2007, 23:35
  5. Resize QTreeWidget columns to contents
    By FaS in forum Qt Programming
    Replies: 9
    Last Post: 2nd July 2006, 20: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.