Results 1 to 2 of 2

Thread: QScrollView size policy?

  1. #1
    Join Date
    Oct 2006
    Posts
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default QScrollView size policy?

    Hi all,
    I have some parent widget QVBox containing child widget QScrollView. Now the parent needs to shrink sometimes and even become 0 height if there's no more space, but no matter what size policy I set, QScrollView stops shrinkinkg at some 100px. Any ideas what makes QScrollView stop from shrinking?

    Qt Code:
    1. class Parent : public QVBox
    2. {
    3. QScrollView* child;
    4.  
    5. public:
    6. Parent() {
    7. child = new QScrollView( this);
    8. child->setResizePolicy( QScrollView::AutoOneFit); // need this one for sub-child to expand
    9. child->setMinimumHeight( 0); // ignored?
    10. }
    11.  
    12. void Shrink() {
    13. setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum, 1, 0));
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 

  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: QScrollView size policy?

    Does the scroll view have any children? Maybe you should set a minimum size on the viewport?

Similar Threads

  1. Replies: 1
    Last Post: 24th October 2006, 16:40
  2. QTreeView font size not being set
    By forrestfsu in forum Qt Tools
    Replies: 2
    Last Post: 12th October 2006, 13:53
  3. How to find size provided by QScrollView
    By Sarma in forum Qt Programming
    Replies: 1
    Last Post: 7th March 2006, 09:26
  4. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14
  5. QMenuBar size policy
    By krivenok in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2006, 15:13

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.