Results 1 to 2 of 2

Thread: QTableWidget columns size

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QTableWidget columns size

    Hi,

    I'm not able to found how to resize the column size to fit the full content of the collumns. When double clicking in the middle of two column header items the column auto resize to fit the column contents. I want to fill some table values by code and resize it automatically.

    Thanks,
    Òscar Llarch i Galán

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget columns size

    QTableView::horizontalHeader
    QHeaderView::setResizeMode(QHeaderView::ResizeToContents)

    Hope you get the idea

  3. The following 3 users say thank you to aamer4yu for this useful post:

    Axtroz (24th October 2012), frankiefrank (8th February 2011), ^NyAw^ (26th March 2010)

Similar Threads

  1. How to rearrange columns in QTableWidget
    By rittchat in forum Qt Programming
    Replies: 0
    Last Post: 23rd December 2009, 11:17
  2. QAbstractItemModel: size of columns
    By kima in forum Qt Programming
    Replies: 0
    Last Post: 24th October 2008, 09:16
  3. Resizing QTableWidget Columns
    By mbrusati in forum Qt Programming
    Replies: 4
    Last Post: 29th September 2008, 22:26
  4. QTableWidget columns to expand to window size
    By bruccutler in forum Newbie
    Replies: 1
    Last Post: 13th April 2007, 16:02
  5. Maximize columns on QTableWidget
    By marcelrc in forum Newbie
    Replies: 1
    Last Post: 21st May 2006, 15:34

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.