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

  • Home
  • SEARCH
  • 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 8030283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:42:59+00:00 2026-06-05T00:42:59+00:00

I am trying to make a GUI so when you increase the "Article" count,

  • 0

I am trying to make a GUI so when you increase the "Article" count, then more of the article inputs show up. For example, if I change the Articles count to 2, I would want another group of inputs to show up for Article 2, and if the Articles count changes to three, there would be three groups of inputs, but since that would use up more space than the window has, it would begin to scroll.

I was thinking of using one of the tree, list, or table widgets, but I am not sure if that is even the right direction I am supposed to be going to. Can anyone push me in the right direction?

Here is a picture, since my description is not good.

Picture goes here

  • 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-06-05T00:43:00+00:00Added an answer on June 5, 2026 at 12:43 am

    You should put all the widgets needed for one article into one single custom widget. Whenever the spin box is changed (code in slot) you can add / remove one instance of such a custom widget to a scroll area.

    Within the constructor of this custom widget class (let’s call it ArticleWidget), you should define signals in your custom widget which notify about changes made in its child widgets. Connect these within your custom widget:

    ArticleWidget::ArticleWidget(QWidget *parent) :
            QWidget(parent)
    {
        ui->setupUi(this); // when you use QtDesigner to design the widget
    
        // propagate signals from my inner widgets to myself:
        connect(ui->title, SIGNAL(textChanged(QString)),
                SIGNAL(titleChanged(QString)));
    }
    

    In the outer widget, whenever creating such a custom widget, connect its signals to your processing slots:

    void OuterWidget::articleCountChanged(int)
    {
        ...
        if(/*increased*/)
        {
            ArticleWidget *article = new ArticleWidget(this);
            connect(article, SIGNAL(titleChanged(QString)),
                    SLOT(art_titleChanged(QString)));
            ui->scrollAreaViewport->layout()->addWidget(article);
        }
        ...
    }
    

    You can access the article widget using sender():

    void OuterWidget::art_titleChanged(QString)
    {
        ArticleWidget *articleWidget = qobject_cast<ArticleWidget*>(sender());
        Q_ASSERT(articleWidget); // make sure the signal comes from an ArticleWidget
    
        // if you want to store articles in a vector of custom types,
        // you could give this type a pointer to the widget, so you can
        // find the index if you have the widget pointer:
        foreach(Article *article, articles)
            if(article->widget == articleWidget)
                article->title = title; // make some changes
    }
    

    This code assumes that you hold all your articles in a struct similar to this:

    struct ArticleData
    {
        ArticleWidget *widget;
        QString title;
        ...
    };
    

    and have a vector of them in your outer widget class:

    QVector<ArticleData*> articles;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a gui with Glade 3 (gtk) and ruby but
I'm trying to make a GUI program with the Android SDK, using their Lunar
Hey guys I'm trying to make a GUI which can navigate through JTextAreas when
I am trying to learn to use the wx packages to make GUI programs
im currently trying to make a simple IRC Gui Client. Im using the SmartIrc4net
I'm making a GUI from Hell, and I'm trying to make the JFrame flash
i'm trying to make a simple GUI with QT 4.6. i made a separete
I'm currently trying to make a TextBox for my GUI with XNA, and I
I'm trying to make a GUI for a small program I wrote with the
I am trying to make a GUI in Tkinter and am wondering how 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.