Results 1 to 4 of 4

Thread: Scrollbar in QTreeWidget

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

    Default Scrollbar in QTreeWidget

    Hi,
    I am using QT4.3.0. I have a QTreeWidget in my program and it contain one column. I add amother QTableWidget in my program and i add a QSplitter in my program between these two widget. In my program I create a tree. and it is working. My problem is that, when i expend the tree, then the vertical scrollbar not display, but the horizontal scrollbar is display. I set these two properties as "ScrollBarAsNeeded".
    Please help me...

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollbar in QTreeWidget

    If the contents of the widget are too big to display then it will show the vertical scroll bar. There is no doubt about that.

    You must have been doing something wrong.
    Can you post some code, including the part where you layout the widgets? Maybe the UI too?

    Regards

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Scrollbar in QTreeWidget

    Try:
    Qt Code:
    1. treeWidget->header()->setStretchLastSection(false);
    2. treeWidget->header()->setResizeMode(QHeaderView::ResizeToContents);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    sabeesh (23rd August 2007)

  5. #4
    Join Date
    Jul 2007
    Posts
    166
    Thanks
    25
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollbar in QTreeWidget

    hi,
    Sorry, it is my mistake.
    My problem is that, when i expend the tree, then the vertical scrollbar is display, but the horizontal scrollbar is not display. I set these two properties as "ScrollBarAsNeeded".
    Please help me...

Similar Threads

  1. GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded
    By Pieter from Belgium in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2007, 13:15
  2. about scrollbar style
    By qtopiahooo in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 13:34
  3. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  4. QTreeWidget + ScrollBar
    By raphaelf in forum Qt Tools
    Replies: 12
    Last Post: 1st June 2006, 20:53
  5. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32

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.