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 897481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:53:39+00:00 2026-05-15T14:53:39+00:00

I need the way to setup widgets inside other widget with different layouts… it

  • 0

I need the way to setup widgets inside other widget with different layouts…

it is something like we have widget divided by one layout into two parts with labels, and
this widget have other widget inside with layout like on attached image alt text

and we have only 4 widgets: main widget, label one widget, label two widget, button widget, and for button use one vertical and two horizontal stretch

Can some body point me to right way do it? Thanks.

  • 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-15T14:53:39+00:00Added an answer on May 15, 2026 at 2:53 pm

    Create QVBoxLayout, then add two QHBoxLayouts to it. In top QHBoxLayout add labels, in bottom one add stretch, button, stretch.

    window example

    #include <QString>
    #include <QApplication>
    #include <QWidget>
    #include <QPushButton>
    #include <QVBoxLayout>
    #include <QHBoxLayout>
    #include <QLabel>
    #include <QLocale>
    
    int main(int argc, char** argv){
        QApplication app(argc, argv);
    
        QWidget widget;
    
        QVBoxLayout* vLayout = new QVBoxLayout(&widget);
        QHBoxLayout* topLayout = new QHBoxLayout();
        QHBoxLayout* bottomLayout = new QHBoxLayout();
        QLabel* label1 = new QLabel(QObject::tr("Label1"));
        QLabel* label2 = new QLabel(QObject::tr("Label2"));
        label1->setAlignment(Qt::AlignCenter);
        label2->setAlignment(Qt::AlignCenter);
        QPushButton* btn1 = new QPushButton(QObject::tr("The Button!!!!"));
        topLayout->addWidget(label1);
        topLayout->addWidget(label2);
        bottomLayout->addStretch();
        bottomLayout->addWidget(btn1);
        bottomLayout->addStretch();
        vLayout->addLayout(topLayout);
        vLayout->addLayout(bottomLayout);
    
        widget.show();
    
        return app.exec();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to setup subdomains udner Xp Pro IIS for something like
In my API, I'd like to have routes like GET /api/v1/widgets/1,2,3 and GET /api/v1/widgets/best-widget,major-widget,bob-the-widget
I need to setup a 2 way SSL communication channel between a .NET/WCF application
The way my site is setup, I need to manually visit two URLs to
What I'm trying to do is have a clock widget of different sizes (i.e.
I need advise on what can be best way to setup/configure SHAREPOINT 2010 Environment
I need a way to change the specific value of a column of a
I need a way in my Chrome extension to know when the browser is
I need a way to take text from a EditText as soon as the
it need a way to call function whose name is stored in a string

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.