Results 1 to 2 of 2

Thread: Why my application quit?

  1. #1
    Join Date
    Dec 2009
    Location
    Shenzhen,China
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Why my application quit?

    I meet an problem in mac, after i run an model dialog, the application quit!, I note that i have set the parent of the dialog to NULL, maybe it's the reason that why the application quit, because if i set the parent to some widget, it won't. so i want to know the exact reason. and it work good on Window, althought the parent is NULL.

    QFileDialog *pImportDlg = new QFileDialog;
    QDesktopWidget* desktop = QApplication::desktop();
    pImportDlg->move((desktop->width() - pImportDlg->width())/2, (desktop->height() - pImportDlg->height())/2);
    pImportDlg->setFileMode(QFileDialog::ExistingFiles);

    if (QDialog::Accepted == pImportDlg->exec())
    {
    // do something
    }

    Appreciate for any point!

  2. #2
    Join Date
    Dec 2009
    Location
    Shenzhen,China
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Why my application quit?

    I have solve it by my self.
    The key is that tha application will quit when the last window closed!, i have call setQuitOnLastWindowClosed and set it to false.
    Thank you for concern!

Similar Threads

  1. QThread quit() issue.
    By rokkamraja in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2009, 16:34
  2. Quit, Exit qApp (program) if error?
    By Arsenic in forum Newbie
    Replies: 13
    Last Post: 30th September 2008, 12:59
  3. Quit action in MainWindow
    By Backslash in forum Newbie
    Replies: 9
    Last Post: 31st July 2007, 21:21
  4. why teminate only works with quit() and not any other
    By srikpen in forum Qt Programming
    Replies: 2
    Last Post: 28th January 2007, 12:37
  5. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38

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.