Results 1 to 2 of 2

Thread: Creating H-scroll free sized QTreeWidget/QTreeView inside a layout

  1. #1
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Creating H-scroll free sized QTreeWidget/QTreeView inside a layout

    I have a QTreeWidget inside a QVBoxLayout that I would like to have sized so that all of the columns are visible (e.g. no horizontal scroll bar needed). How do I do this? I tried using

    myTreeWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysO ff)

    or

    myTreeWidget->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::P referred)

    or

    vLayout->setSizeConstraint(QLayout::SetMinimumSize);

    but these didn't help. I'm not sure if the QTreeWidget is providing poor sizeHints() or if the layout is just ignoring them (I'll check into that).

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Creating H-scroll free sized QTreeWidget/QTreeView inside a layout

    Amazing! I myself use QTreeWidget and I can't get any scrollbar even when it's needed...
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. Creating a square sized widget in a layout
    By cboles in forum Qt Programming
    Replies: 5
    Last Post: 22nd September 2008, 23:38

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.