Results 1 to 2 of 2

Thread: creating a signal from manually closing a Dialog

  1. #1
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default creating a signal from manually closing a Dialog

    Hi,
    there is an object from QDialog in name of "dlg". it is needed while closing it manually by clicking on close button on top-left, it emits a signal. how is it possible to create a signal for this?

    thanks for any help

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: creating a signal from manually closing a Dialog

    Override the class QDialog::closeEvent() and emit whatever you like before calling the base implementation. You probably already get a rejected() signal if the dialog is closed this way.

  3. The following user says thank you to ChrisW67 for this useful post:

    Alex22 (31st December 2015)

Similar Threads

  1. QML manually emit key press signal
    By mushroom in forum Qt Quick
    Replies: 1
    Last Post: 18th August 2011, 18:02
  2. Replies: 0
    Last Post: 17th March 2011, 20:38
  3. closing child dialog closes parent dialog
    By sparticus_37 in forum Newbie
    Replies: 2
    Last Post: 28th May 2010, 20:46
  4. Creating event manually and using them
    By vajindarladdad in forum Newbie
    Replies: 4
    Last Post: 28th August 2009, 09:02
  5. Manually send signal to slot
    By donmorr in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2006, 16:03

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.