Reg: Open Parent window when push button clicked in child window
-
wrote on 28 Oct 2013, 13:19 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.
-
wrote on 28 Oct 2013, 13:26 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
-
wrote on 12 Nov 2013, 07:21 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 .
-
wrote on 12 Nov 2013, 07:26 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 -
wrote on 21 Nov 2013, 12:43 last edited by
Thanks.. that works for now..
-
wrote on 27 Mar 2014, 12:13 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 -
wrote on 28 Mar 2014, 04:07 last edited by
Hello ndv472.
Can you show your code .
-
wrote on 28 Mar 2014, 05:54 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 -
wrote on 28 Mar 2014, 06:01 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 -
wrote on 28 Mar 2014, 09:48 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.
-
wrote on 5 Apr 2014, 22:31 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.