Results 1 to 4 of 4

Thread: Connecting signal to form that is closing

  1. #1
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Connecting signal to form that is closing

    Hi,

    This is probably very simple, just would like to know what the signal is when a form is going to close, I want attach this to my main form.

    Regards,
    Steve

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Connecting signal to form that is closing

    It is not a signal but an event handler, namely QWidget::closeEvent().
    Reimplement this in your form, and it will get called when you close the form.

    Regards

  3. #3
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Connecting signal to form that is closing

    Hi,

    Thanks for that, but I want it to tell the main form which created this form that it is closing, guess I could emit a signal from the closeEvent method?

    Regards,
    Steve

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Connecting signal to form that is closing

    Yes, you can.

  5. The following user says thank you to marcel for this useful post:

    steg90 (18th May 2007)

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.