Can't launch a new instance of a dialog-widget from inside it.
Maybe it can't be done....
I have a Widget-dialog based. Depending of a parameter I show a Qframe or another.
I can create two instances of this from the main window but I can't show an instance of 'myself' ....
I dont see anything or the dialog close itself....
The initial dialog is modal, showed from mainwindow with 'exec()'.
This is pseudo code for MY_WIDGET class.
I have a private var :
MY_WIDGET * my_instance_of_myself ; ( because i'm going to make some conection later )
I have a pushbutton click with:
my_instance_of_myself = new MY_WIDGET("the_option_i_want");
my_instance_of_myself.exec(); - this one shows an empty dialog.
my_instance_of_myself.show(); - this one 'auto-close' the initial dialog
Any quick idea to solve this ?
Thanks
Re: Can't launch a new instance of a dialog-widget from inside it.
Quote:
Any quick idea to solve this ?
Post the code because "this one shows an empty dialog" is a direct consequence of the code in MY_WIDGET.
Re: Can't launch a new instance of a dialog-widget from inside it.
Solved:
An initial problem was the next:
As I wrote, depending on some parametersI show one or another Qframe.
I have 'do_things' function, that receive the frame I want to use as main widget
Inside this function I search the top_parent, to move my frame to there. By last, I adjust the size of the top_parent to the Qframe choosed.
Code:
{
top_parent=w;
do { top_parent=top_parent->parentWidget() ; }
while (top_parent->parentWidget()!=0);
}
The problem was originated by the create method I use, I was passing the my_widget first instantiated as a parent of the second.
The top_parent detected in this second case was the parent of the first instance not the actual.
Thanks...