Sending signal to parent window and problem with closing parent.
Hi all,
I'm begginer in Qt :-) and I've already have some problems. The most painful for me now is:
I have a class derived from QMainWindow, from there I am creating window (derived from QWidget). I also have a menu item calling show() slot of this child window. This window have two buttons, one of them is closing it and another is sending (emitting) signal back to parent window and calls close(). After clicking this button which sends back signal to parent I can't close parent window any more. I've reimplemented closeEvent of parent to see if it receive close events and of couse it can't get any.
I'm sure that I'm making a terrible mistake somwhere but code looks ok. Is it know issue or just my mistake? Should I post code?
Br
Re: Sending signal to parent window and problem with closing parent.
Quote:
Originally Posted by
ic3
Should I post code?
Yes that would be helpful. Best you make a small executable example.
Re: Sending signal to parent window and problem with closing parent.
I will prepare minimal example today evening.
Re: Sending signal to parent window and problem with closing parent.
Hi,
what's strenge I've copy my project to other location and I've removed all references to my external library (which don't use Qt) to reduce code and paste it here. But after removing those things, window suddenly starts behaving normally. Is it possible that non-Qt code disturbs this framework in such a way?
Br
Re: Sending signal to parent window and problem with closing parent.
Try to use Q_SIGNALS and Q_SLOTS instead of signals and slots. You can also try "CONFIG += no_keywords" in your *.pro file.
Re: Sending signal to parent window and problem with closing parent.
I doesn't work. It seems that I have a terrible bug in my library and Qt works fine. I underestimate power of Qt. :) Now it will be simpler, maybe it's some thread deadlock in my lib, I'll focus on it.
Anyway, thank you for interest. :-)