Results 1 to 3 of 3

Thread: Change column width in a QTreeWidget

  1. #1
    Join Date
    Apr 2006
    Location
    New Zealand
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Change column width in a QTreeWidget

    Hi
    Can anybody tell me how to change the column width in a QTreeWidget? At the moment I'm using resizeColumnToContents ( ) but I'm not entirely happy with it because the text in adjacent columns is too close to each other and I want some extra space. I would prefer if I could specify the column width.
    Thanks a lot

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Change column width in a QTreeWidget

    try header()->resizeSection(int logicalIndex, int size)

  3. The following user says thank you to munna for this useful post:

    mace (27th May 2006)

  4. #3
    Join Date
    Apr 2006
    Location
    New Zealand
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Change column width in a QTreeWidget

    Works! Thanks a lot.
    M

Similar Threads

  1. QTable column stretchable with minimum Width
    By sunil.thaha in forum Qt Programming
    Replies: 0
    Last Post: 24th April 2006, 14:17
  2. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 09:00
  3. How to obtain the width of a QTableWidget?
    By Giel Peters in forum Qt Programming
    Replies: 3
    Last Post: 9th January 2006, 23: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.