Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6023917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:04:38+00:00 2026-05-23T04:04:38+00:00

I have one form where i am applying ScrollArea but it is not getting

  • 0

I have one form where i am applying ScrollArea but it is not getting applied properly ?
I want to place the four buttons in Scrollable Area and when buttons gets increased a scroll bar should appear there to scorll down vertically.

Currently when i am trying to add more buttons the buttons overlap with the combobox and does not grow downward.

Here is my code :

 QPushButton *b1 = new QPushButton(strsearch);
           QPushButton *b2 = new QPushButton(strsearch);
           QPushButton *b3 = new QPushButton(strsearch);
           QPushButton *b4 = new QPushButton(strsearch);

 b1->setStyleSheet(

               "background-image: url(:/user.gif);"
               "background-repeat:no-repeat;"
               "background-attachment:fixed;"
               "background-position:left top;"
               "border-style: outset;"
               "background-color : black;"
               "border-width: 2px;"
               "border-radius: 10px;"
               "border-color: black;"
               "font: bold 16px;"
               "color: black;"
               "min-width: 10em;"
               "min-height: 0.75em;"
               "margin: 0 1px 0 1px;"
               "color:rgb(255,255,255);"
               "padding: 6px;"
               );



b2->setIcon(QIcon(":/user.gif"));
           b2->setIconSize(QSize(160, 26));
           b3->setIcon(QIcon(":/user.gif"));
           b3->setIconSize(QSize(160, 26));
           b4->setIcon(QIcon(":/user.gif"));
           b4->setIconSize(QSize(160, 26));

 QGridLayout *layout = new QGridLayout;
 layout->addWidget(b1, 1, 0);
           layout->addWidget(b2, 2, 0);
            layout->addWidget(b3, 3, 0);
            layout->addWidget(b4, 4, 0);
layout->addWidget(scrollArea);
  layout->setAlignment(Qt::AlignBottom);
  setLayout(layout);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:04:39+00:00Added an answer on May 23, 2026 at 4:04 am
    //Create the buttons
    QPushButton *b1 = new QPushButton("Button 1");
    QPushButton *b2 = new QPushButton("Button 2");
    QPushButton *b3 = new QPushButton("Button 3");
    QPushButton *b4 = new QPushButton("Button 4");
    
    //Add the buttons to a vertical layout (faster than grid layout)
    QVBoxLayout *scrollLayout = new QVBoxLayout;
    scrollLayout->addWidget(b1);
    scrollLayout->addWidget(b2);
    scrollLayout->addWidget(b3);
    scrollLayout->addWidget(b4);
    
    //Create a viewport widget that contains the layout with buttons
    QWidget *viewport = new QWidget;
    viewport->setLayout(scrollLayout);
    
    //Add the viewport to the scroll area
    QScrollArea *scrollArea = new QScrollArea;
    scrollArea->setWidget(viewport);
    
    //Add the scroll area to your main window's layout
    mainLayout->addWidget(scrollArea);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one form and two submit buttons. at the moment they are like
I have one form which will not return any error to user. If user
I have one form that has several elements and two submit buttons, one is
I have one form containing one checkbox(not checkbox list)and one textfield. If the checkbox
i have one form after clicking save button form redirecting to another page, but
I have one form with four textbox and every textbox has requirefieldvalidator. One Button
I have one form calling a method in another form. but the method in
I have one form that has an option to open another (dialogue). I want
I have one form with several text fields and one button. When i enter
I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.