PDA

View Full Version : Displaying QWidget from a function.



raghvendramisra
19th January 2008, 07:21
hi,

I have an application in which there are two windows(QWidget) The first contains a button and on clicking that button the second window should appear.

I have used QWidjet::show() in the function of the button to display the second windpw.

but my problem is that when i click the button the seconds Window's init() funtion is called but te window is not displayed.

What can be the problem.???????????

marcel
19th January 2008, 07:59
Probably you are creating the second window on the stack and it gets destroyed as soon as the current scope ends.
Create it on the heap(with new) and make sure to delete it when you close it.

raghvendramisra
23rd January 2008, 04:02
Thanks

my problem is solved by this solution :)

Regards