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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:13:52+00:00 2026-05-23T21:13:52+00:00

I am new to QT Creator. I did create a menu: Login || Open.

  • 0

I am new to QT Creator. I did create a menu: Login || Open. When login is clicked I would like to see a line edit and a press button. When Open is clicked I would like to see a picture in the window. Can I change the interface of the same window depending on what I click in the menu bar? How can I do that?

  • 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-23T21:13:52+00:00Added an answer on May 23, 2026 at 9:13 pm

    I did something similar to this – an app with several major areas, toggled by an icon bar at the top.
    I used a QStackWidget to stack the different application areas on top of each other, a set of QActions that I created using the designer, and a QActionGroup to implement the toggling.
    When the actions are marked as “checkable” and grouped in a QActionGroup, theQToolBar only lets one be active at the time.

    Here’s a simplified extract of my code:

    // MyApp.h
    #include <QMainWindow>    
    class QAction;
    class QActionGroup;
    
    namespace Ui {
        class MyApp;
    } 
    
    class MyApp: public QMainWindow
    {    
        Q_OBJECT
    
    public:
        explicit MyApp(QWidget *parent = 0);
        ~MyApp();
    
    public slots:
        void showSection(QAction* a);
    
    private:
        Ui::MyApp *ui;
        QActionGroup* sections;
    };
    

     

    //MyApp.cpp
    #include "structureapp.h"
    #include "ui_structureapp.h"
    
    #include <QActionGroup>
    
    MyApp::MyApp(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MyApp),
        sections(new QActionGroup(this)),
    {
        ui->setupUi(this);
    
        /* Populate section list */
    
        /* Page indices for the stack widget*/
        ui->actionSectionOne->      setData(0);
        ui->actionSectionTwo->      setData(1);
        ui->actionSectionThree->    setData(2);
    
        sections->addAction(ui->actionSectionOne);
        sections->addAction(ui->actionSectionTwo);
        sections->addAction(ui->actionSectionThree);
    
    
        ui->mainToolBar->addSeparator();
    
        connect(sections, SIGNAL(triggered(QAction*)), this, SLOT(showSection(QAction*)));
    
        /* Show the default section */
        ui->actionContentSection->trigger();
    }
    
    MyApp::~MyApp()
    {   
        delete ui;  
    }
    
    void MyApp::showSection(QAction *a)
    {
        ui->mainArea->setCurrentIndex(a->data().toInt());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I can add the creator_id like this in my controller: @entry = Entry.new(params[:entry].merge(:creator
I would like to use Qt creator and Cmake together (please, don't ask me
I came across something like ArgProcessor argProcessor = runWebApp.new ArgProcessor(options); This line is from
I want to do something like this: Creator method = new Creator(); method.addSubject(example); class
In javascript, I often use something like this object creator var o = new
namespace MyOldService { public MyNewService.AddressList ToPrivateAddressList() { MyNewService.AddressList privAddrList = new MyNewService.AddressList(); privAddrList.creator =
There is no default file encoding option in my qt creator. Therefore, every new
i have a Reply class: class Reply(models.Model): reply_to = models.ForeignKey(New) creator = models.ForeignKey(User) reply
I'm new to Qt Creator and I have several questions regarding multiple build configurations.
I'm using XDocument to create a RSS same below code: var document = new

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.