Results 1 to 2 of 2

Thread: How to set the sizehint for treeWidget

  1. #1
    Join Date
    May 2007
    Posts
    110
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default How to set the sizehint for treeWidget

    hi

    I m creating one treeWidget inside the DockWidget. By default treeWidget width is 512 so it will open in mainwindow with this width....If i will set the sizehint 100 for this treeWidget then by default it should come 100 width...

    how i Will set the sizehint for this treeWidget....

  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: How to set the sizehint for treeWidget

    The only way to set the size hint is to subclass the widget and reimplement its sizeHint method. But maybe you can use layouts and horizontalStretch to achieve a simmilar effect without subclassing.

Similar Threads

  1. QTextEdit, sizeHint, QWidget
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 08:25
  2. invalid sizeHint()
    By roleroz in forum Qt Programming
    Replies: 2
    Last Post: 25th August 2006, 22:11

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.