PDA

View Full Version : Navigation between 3 (or more) window ?



djeff77
25th March 2015, 14:56
Hello,

I have a problem to navigate between 3 or more windows.

I have a mainwindow, a window_1 and a window_2.
On each window i have a button to open a new window and hide the actual one, and a button to close the window and access to the previous one.

My problem is when I am on the window_2 and i want to close it, when the program close the actual window and try to access to the previous one, it show me the 2 others ones and crash.

Here is my code to open and close :


void window_1::_pushButton_open_clicked()
{
this->hide();
window_2 *w = new window_2();
w->exec();
this->show();
}

void window_2::_pushButton_close_clicked()
{
this->close();
}

I think my problem come to "this->close" and "this->show()" which is dont take mu previous window.

Thanks for your help, i hope that clear enough.