PDA

View Full Version : Sending signal to parent window and problem with closing parent.



ic3
20th April 2010, 22:39
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

Lykurg
21st April 2010, 06:05
Should I post code?
Yes that would be helpful. Best you make a small executable example.

ic3
21st April 2010, 07:36
I will prepare minimal example today evening.

ic3
21st April 2010, 17:22
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

Lykurg
21st April 2010, 17:34
Try to use Q_SIGNALS and Q_SLOTS instead of signals and slots. You can also try "CONFIG += no_keywords" in your *.pro file.

ic3
21st April 2010, 21:36
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. :-)