Results 1 to 4 of 4

Thread: Inconsistent behaviour of QVBoxLayout

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2008
    Posts
    38
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Inconsistent behaviour of QVBoxLayout

    Hi there. I have a QWidget which contains a QScrollArea which contains a MyList which has a QVBoxLayout. MyList has a slot
    Qt Code:
    1. void MyList :: add_new () {
    2. MyWidget * w = new MyWidget (this);
    3. layout () -> addWidget (w);
    4. }
    To copy to clipboard, switch view to plain text mode 

    I can call add_new repeatedly from the MyList constructor and the behaviour is as expected: a new widget is added to the end of the list and eventually a scroll bar appears as the MyList widget grows.

    If I call add_new later as the result of a user action, the height of the MyList widget is fixed and everything is squashed to accomadate the new MyWidget.

    Is this a bug or do I need to change some setting?
    Last edited by spraff; 26th November 2008 at 18:02.

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.