Results 1 to 2 of 2

Thread: QtreeWidgetItem size

  1. #1
    Join Date
    Jul 2007
    Posts
    104
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    22
    Thanked 1 Time in 1 Post

    Default QtreeWidgetItem size

    Iam using QTreeWidgetItem->headerItem()-> and I want to expand the size of this widget according to size of text of this?

    I reliazed that there is no expanding column in treeWidgetItem but in TreeWidget.
    I resized column with treeWidget->setCloumnWidth(int column) .Although the size of column is 100 it doesnt show a 100 length.Why?

    I want to expand the column as the longest string length but now I am using 5xlength.
    Last edited by hgedek; 18th August 2007 at 11:35.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QtreeWidgetItem size

    Take a look at QHeaderView::setResizeMode and its ResizeToContents option.

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

    hgedek (18th August 2007)

Similar Threads

  1. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  2. Font size calculation when painting in a QImage
    By Ishark in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 22:22
  3. Restrict size of QLineEdit
    By bruccutler in forum Newbie
    Replies: 2
    Last Post: 19th March 2007, 16:31
  4. Replies: 1
    Last Post: 24th October 2006, 16:40
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

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
  •  
Qt is a trademark of The Qt Company.