Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Reg: Open Parent window when push button clicked in child window

    India
    6
    12
    8651
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Vishva last edited by

      Hi All,
      I am new to QT and manage to make an application with 3 windows. I am able to navigate forward 1->2->3 or 1->3.
      But if i wanna go back i.e from 3->1 window how do i do it??
      How do i connect a pushbutton in 3rd window to show the 1st window.

      Any help would be appreciated. I tried to search the forum but didnt succeed to find soln.

      1 Reply Last reply Reply Quote 0
      • V
        Vishva last edited by

        !http://www.thedazzlersinc.com/source/wp-content/uploads/2012/06/flow.png(img)!

        1 Reply Last reply Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          This sounds like something where you can use "QWizard":http://qt-project.org/doc/qt-5.0/qtwidgets/qwizard.html

          Hope it helps

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply Reply Quote 0
          • IamSumit
            IamSumit last edited by

            When you navigate from 1 to 2 or 2 to 3 ,You close the current window .Don't close these windows, instead of closing them just hide them.
            Solution : "use hide() in place of close()"

            then you can navigate from 3 --->1 .

            Be Cute

            1 Reply Last reply Reply Quote 0
            • K
              kqt-mr-nv6 last edited by

              you can emit signals from each window to target window
              so that you can call hide()/show() in the slots of respective windows

              1 Reply Last reply Reply Quote 0
              • V
                Vishva last edited by

                Thanks.. that works for now..

                1 Reply Last reply Reply Quote 0
                • N
                  ndv472 last edited by

                  i also want the same thing but as i used the show()/hide then it will hide the main window but it will not showing new window.
                  the new window which i want to show that should be having diff .cpp , .h file and different .ui
                  so as we press the push button of main window that new window should open ..
                  please help me out..
                  thanks in advance

                  1 Reply Last reply Reply Quote 0
                  • IamSumit
                    IamSumit last edited by

                    Hello ndv472.

                    Can you show your code .

                    Be Cute

                    1 Reply Last reply Reply Quote 0
                    • N
                      ndv472 last edited by

                      yes sir,
                      i have used 2 3 cases
                      1st case
                      void nn_adc_trial::on_pushButton_clicked()
                      {
                      QWidget *new_window=new QWidget ;
                      new_window->show();
                      hide ();
                      }
                      that will give me 1 new window but same of main window

                      1 Reply Last reply Reply Quote 0
                      • N
                        ndv472 last edited by

                        also one i got from internet
                        the link i will post
                        http://hxr99.blogspot.in/2011/12/how-to-call-ui-design-form-with.html
                        and from theire i got zip file of that
                        link is : http://www.mediafire.com/download/fbim2vlo9rbpf1p/AboutWin.zip
                        but that is also not working

                        1 Reply Last reply Reply Quote 0
                        • IamSumit
                          IamSumit last edited by

                          [quote author="ndv472" date="1395922437"]i also want the same thing but as i used the show()/hide then it will hide the main window but it will not showing new window.
                          void nn_adc_trial::on_pushButton_clicked()
                          {
                          QWidget *new_window=new QWidget ; new_window->show(); hide ();
                          } [/quote]

                          as per your code definitely it will not show the mainwindow due to hide() but would show new window.

                          [quote author="ndv472" date="1395922437"]the new window which i want to show that should be having diff .cpp , .h file and different .ui
                          so as we press the push button of main window that new window should open ..[/quote]

                          Make your own C++ Class(.cpp/.h) for New widget (inherits QWidget ) that you want to show.

                          Edited:- Try to give your code with proper indentation on the forum so it can be readable.

                          Be Cute

                          1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User last edited by

                            [quote author="Vishva" date="1382966771"]!http://www.thedazzlersinc.com/source/wp-content/uploads/2012/06/flow.png(img)![/quote]

                            Why dont you use stack concept in Qt, using push and pop for showing parent and child.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post