Results 1 to 2 of 2

Thread: deleting a parent form from a reject() call from a child QDialog

  1. #1
    Join Date
    Jul 2006
    Posts
    79
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default deleting a parent form from a reject() call from a child QDialog

    hello everyone,

    i have this application when the main window (a QWidget) calls a child QDialog that is generated to configure some setting.. the quit button for the application is also on that same QDialog form and i can set things up in such a way that quit button is connected to the QDialog::reject() function (QDialog::accept() just closes the QDialog, saving the seetings and returns focus to the main window). the code on the main window looks like

    Qt Code:
    1. menu =new menuForm(this,"aMenuForm",FALSE,(Qt::WStyle_Customize | Qt::WStyle_NoBorder));
    2. if (menu->exec()==QDialog::Rejected)
    3. {
    4. saveData();
    5. //delete menu;
    6. close(); //closes the main window
    7. }
    8. delete menu;
    To copy to clipboard, switch view to plain text mode 

    so menu is executed and a reject call is sent the program must save the data and CLOSE the main form too...
    ok now this works BUT what does not work is

    Qt Code:
    1. mainForm::destroy()
    2. {saveData();
    3. }
    To copy to clipboard, switch view to plain text mode 

    cause iin the beginning i was trying to get this to work by calling saveData() on mainForm::destroy()... but it did not run... why not?
    thank you in advance for your help.
    nass

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: deleting a parent form from a reject() call from a child QDialog

    Do you use .ui.h files?

Similar Threads

  1. Move child widget along with the parent widget
    By sreedhar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2006, 12:00
  2. Referencing Parent Widget from Child
    By taylor34 in forum Qt Programming
    Replies: 8
    Last Post: 11th April 2006, 15:13

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.