Results 1 to 6 of 6

Thread: Sending signal to parent window and problem with closing parent.

  1. #1
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Sending signal to parent window and problem with closing parent.

    Quote Originally Posted by ic3 View Post
    Should I post code?
    Yes that would be helpful. Best you make a small executable example.

  3. #3
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sending signal to parent window and problem with closing parent.

    I will prepare minimal example today evening.

  4. #4
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default 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.

  6. #6
    Join Date
    Apr 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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. :-)

Similar Threads

  1. Show parent window
    By Qt Coder in forum Qt Programming
    Replies: 7
    Last Post: 8th June 2009, 10:19
  2. Parent window over child
    By neolol in forum Qt Programming
    Replies: 4
    Last Post: 15th May 2009, 22:15
  3. QGLFrameBUfferObject with parent window
    By xerionn in forum Qt Programming
    Replies: 5
    Last Post: 9th January 2009, 00:57
  4. How to close parent window from child window?
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 14th October 2008, 12:40
  5. Replies: 11
    Last Post: 4th June 2008, 08:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.