Results 1 to 7 of 7

Thread: Adding widgets to QScrollArea

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Ukraine
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    2

    Question Adding widgets to QScrollArea

    Hi, guys.
    Need some help...
    The task is following: I need to place into QGroupBox some number of widgets - for example, QLabel. After filling this QGroupBox scrollbar must appear.
    Code is next:

    Qt Code:
    1. extGroupLayout = new QVBoxLayout;
    2. groupBoxLayout = new QVBoxLayout;
    3. scrollArea = new QScrollArea(this);
    4.  
    5. groupBox->setLayout(extGroupLayout);
    6. extGroupLayout->addWidget(scrollArea);
    7. scrollArea->setLayout(groupBoxLayout);
    8.  
    9. for(i=0;i<20;i++)
    10. {
    11. // Let's make our checkboxes...
    12. IDCheckbox[i] = new QCheckBox;
    13. groupBoxLayout->addWidget(IDCheckbox[i]);
    14. }
    To copy to clipboard, switch view to plain text mode 

    After executing, checkboxes get minimal possible height, ignoring value, set by setMinimalHeight method; last of them are hiding behind the edge of scroll area, but scrolling is still impossible

    Where is my problem? Don't say it is in my head
    Last edited by ser_bur; 16th May 2007 at 20: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.