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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:14:03+00:00 2026-06-07T05:14:03+00:00

I have two classes both define under QDialog class. Both classes individually are working

  • 0

I have two classes both define under QDialog class.

Both classes individually are working properly and opening their respective window but what i want is that from one window there is an action in the menubar ,which on clicking open the other window.
codes for the classes defined are
class 1

class Box : public QDialog
{
        Q_OBJECT

        public:
                Box(QWidget *parent=0);

        private slots:
                void refresh();

        signals:
                void itemChanged(QStandardItem *);

        private:
                void create_frame();
                void create_menu();

                QGroupBox *tablegroup;
                QDialogButtonBox *buttonbox;
                QAction *help;
                QAction *exit;
                QAction *idseacrh;
                QAction *idsearch;
                QMenu *file;
                QMenu *search;
                QMenuBar *menubar;
                QTableView *table;
};

CLASS 2

class Box1 : public QDialog
{
        Q_OBJECT

        public:
                Box1(QWidget *parent=0);

        private:
                QLineEdit *text;
                QLabel *searchh;
                QDialogButtonBox *buttonboxx;
                QTableView *tablee;
                QGroupBox *tableegroup;
                QGroupBox *searchgroup;
};

The action will be there in Box which will open Box1.
_I HAVE IMAGE ALSO FOR BOTH THE _ window which i have created and tried to upload but it says i need 10 reputations to do this,so i wasnt able to do it.

  • 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-07T05:14:05+00:00Added an answer on June 7, 2026 at 5:14 am

    I don’t get it. If i understood the question, you just need to connect QAction from your QMenuBar to function which will correspond for creating new window with Box1 widget. Here you are simple example of how to do it:

    void Box::newDialog()
    {
        QVBoxLayout* lay = new QVBoxLayout;
    
        Box1* temp = new Box1(this);
        lay->addWidget(temp);
    
        QDialog dialog(this);
        dialog.setModal(true);
        dialog.setLayout(lay);
        dialog.setWindowTitle("Box1");
    
        dialog.exec();
    }
    

    And

    connect(Box1Action, SIGNAL(triggered()), this, SLOT(newDialog()));
    

    or simpler:

    myMenu->addAction(tr("Create Box1 Window"), this, SLOT(newDialog()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two frameworks in my Xcode project that both define a class with
I have two threads One and Two. defined by their respective classes in the
I have two classes and both of them uses some of the other class,
If I have two classes that both implement an interface, but also inherit, do
Suppose I have two classes that both contain a static variable, XmlTag. The second
I have two classes generated by LINQ2SQL both from the same table so they
Say you have two classes, A and B. Is it possible to instantiate both
I have two classes (MVC view model) which inherits from one abstract base class.
I have two classes Foo and Bar that Bar extends Foo as below: class
I have two classes, one that inherits from the other. The base class is

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.