sgtbash
1st May 2009, 09:34
Hi, i'm new at QT Developing. I read the C++ GUI Programming with C++ but i wasn't able to find the answer to my question.
I want to open my custom QDialog, it's a modeless and i'm not intrested in waiting its execution so i decided to open it with the show() method. This how i open it :
{
if (!dialog) {
dialog = new MyCustonDialog(this);
}
dialog->show();
dialog->raise();
dialog->activateWindow();
}
I have alse setted Qt::WA_DeleteOnClose on the dialog, so it must be destroyed when closed.
The problem is. The first time the dialog is opened it shows up correctly, but the second time, even if the destructor is called the dialog pointer is not NULL and the constructor is not called again causing a Segmentation Fault on the show() method.
How can i solve it?
If you're instrested in, i'm using Mac OS X Leopard with QT 4.5, and GCC 4.2.
I want to open my custom QDialog, it's a modeless and i'm not intrested in waiting its execution so i decided to open it with the show() method. This how i open it :
{
if (!dialog) {
dialog = new MyCustonDialog(this);
}
dialog->show();
dialog->raise();
dialog->activateWindow();
}
I have alse setted Qt::WA_DeleteOnClose on the dialog, so it must be destroyed when closed.
The problem is. The first time the dialog is opened it shows up correctly, but the second time, even if the destructor is called the dialog pointer is not NULL and the constructor is not called again causing a Segmentation Fault on the show() method.
How can i solve it?
If you're instrested in, i'm using Mac OS X Leopard with QT 4.5, and GCC 4.2.