Results 1 to 5 of 5

Thread: Scrollbar covers Labels in ScrollArea

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2015
    Posts
    50
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Scrollbar covers Labels in ScrollArea

    Hi,

    I have a ScrollArea with many groupboxes which contain Checkboxes. But it seems like the size of the ScrollArea does not adapt to the layout.
    Qt Code:
    1. QVBoxLayout* verticalLayout[NumberOfAvailableTypes];
    2. QVBoxLayout* verticalLayoutForWidget = new QVBoxLayout(ui->AvailableDataScrollArea);
    3. ui->scrollAreaWidgetContents->setLayout(verticalLayoutForWidget);
    4.  
    5. QGroupBox *TypeGroupBox[NumberOfAvailableTypes];
    6.  
    7. for (int i = 0; i < NumberOfAvailableTypes; i++){
    8. TypeGroupBox[i] = new QGroupBox(ui->AvailableDataScrollArea);
    9. TypeGroupBox[i]->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
    10. TypeGroupBox[i]->setTitle(AllData.at(i)->NameWithoutNumber());
    11. verticalLayout[i] = new QVBoxLayout(TypeGroupBox[i]);
    12.  
    13. QCheckBox *DataCheckbox[AllData.at(i)->quantity()];
    14. QHBoxLayout* horizontalLayout[AllData.at(i)->quantity()];
    15.  
    16. for (int j = 1; j <= AllData.at(i)->quantity(); j++){
    17. DataCheckbox[j] = new QCheckBox(TypeGroupBox[i]);
    18. DataCheckbox[j]->setText(AllData.at(i)->NameWithNumber());
    19.  
    20. horizontalLayout[j] = new QHBoxLayout();
    21. horizontalLayout[j]->addWidget(DataCheckbox[j]);
    22. verticalLayout[i]->addLayout(horizontalLayout[j]);
    23. }
    24. }
    25. verticalLayoutForWidget->addWidget(TypeGroupBox[i]);
    26. }
    27. verticalLayoutForWidget->addSpacerItem(new QSpacerItem(40,20,QSizePolicy::Minimum, QSizePolicy::Expanding));
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

Similar Threads

  1. Replies: 0
    Last Post: 4th August 2015, 09:12
  2. How to control scrollbar in scrollarea ?
    By lwz in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2014, 14:18
  3. Filling area covers curve。
    By lwz in forum Qwt
    Replies: 6
    Last Post: 24th August 2014, 08:57
  4. Replies: 0
    Last Post: 14th April 2010, 22:26
  5. Get covers from amazon.com like in Amarok
    By jiveaxe in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2008, 08:29

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.