Results 1 to 3 of 3

Thread: QTreeWidget, proper resizing of columns

  1. #1
    Join Date
    Jan 2006
    Location
    germany
    Posts
    75
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default QTreeWidget, proper resizing of columns

    I have a QTreeWidget with 3 columns and i want it to behave like this:
    2nd and 3rd columns should be Mininum-size, i.e. the column should be wide enough to show the biggest item completely, but no wider.
    The 1st column should be "Minimun-Expanding", i.e. just like the Widget-behaviour.
    The QTreeWidget should never show vertical scrollbars and hide no textparts of any item in any column.

    I already tried this back in Qt3-times and never could make it work right....

    Thanks for help!!
    Quote Originally Posted by Bertolt Brecht
    What is the robbing of a bank compared to the founding of a bank?

  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: QTreeWidget, proper resizing of columns

    Set the resize mode of sections 1 and 2 to ResizeToContents and resize mode of section 0 to Stretch. Also remember to call setStretchLastSection(false).

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

    soul_rebel (6th November 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    germany
    Posts
    75
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QTreeWidget, proper resizing of columns

    Awesome, it just works the way I want it to!

    Thanks a lot!
    Quote Originally Posted by Bertolt Brecht
    What is the robbing of a bank compared to the founding of a bank?

Similar Threads

  1. Saving/Restoring columns order of QTreeWidget
    By mchara in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2007, 08:43
  2. QTreeWidget - preventing columns from being resized.
    By sternocera in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2007, 16:11
  3. QTreeWidget columns
    By xgoan in forum Newbie
    Replies: 3
    Last Post: 27th February 2007, 20:01
  4. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  5. How to capture resizing of QTreeWidget columns?
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 06:10

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.