Results 1 to 2 of 2

Thread: Automatically adjust width of columns in QTableWidget

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Automatically adjust width of columns in QTableWidget

    I have one of those, with 4 columns . 2 checkboxes in the left most ones, and then the next columns will be filled with strings. Isthere a way to get Qt to automatically resize columnwidths and set suitable widths of the columns? The checkbox columns could be narrow, the other ones, well, wider.

    Or how do you set these widths?

    Edit:
    Sorry, just found this!
    resizeColumnsToContents()

    works fine!
    Last edited by Morea; 18th September 2007 at 23:00. Reason: Problem solved!

  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: Automatically adjust width of columns in QTableWidget

    It's always best to solve your problems yourself

Similar Threads

  1. Maximize columns on QTableWidget
    By marcelrc in forum Newbie
    Replies: 1
    Last Post: 21st May 2006, 15:34
  2. Replies: 6
    Last Post: 5th March 2006, 21:05
  3. How to obtain the width of a QTableWidget?
    By Giel Peters in forum Qt Programming
    Replies: 3
    Last Post: 9th January 2006, 22: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.