Results 1 to 2 of 2

Thread: Fail when using Phonon after restarting application programatically.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2012
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Fail when using Phonon after restarting application programatically.

    As a workaround i have changed the way i do programatical restart. I have to use process respawn to keep phonon alive:

    Qt Code:
    1. // Restart Application
    2. void myApp::Restart(bool Abort)
    3. {
    4. // Spawn a new instance of myApplication:
    5. QProcess proc;
    6. #ifdef Q_OS_WIN
    7. proc.startDetached(this->applicationFilePath());
    8. #endif
    9.  
    10. #ifdef Q_OS_MAC
    11. // In Mac OS the full path of aplication binary is:
    12. // <base-path>/myApp.app/Contents/MacOS/myApp
    13. args << (this->applicationDirPath() + "/../../../myApp.app");
    14. proc.startDetached("open", args);
    15. #endif
    16.  
    17. // Terminate current instance:
    18. if (Abort) // Abort Application process (exit immediattely)
    19. ::exit(0);
    20. else
    21. this->exit(0); // Exit gracefully by terminating the myApp instance
    22. }
    To copy to clipboard, switch view to plain text mode 

    Maybe the phonon failure is a QT bug or i am missing some object lifetime nuance. If someone has some thoughts, i will appreciate it.

    Best regards,
    Last edited by airproject; 2nd November 2012 at 08:03.

Similar Threads

  1. Deploying Phonon application
    By illuzmax in forum Installation and Deployment
    Replies: 1
    Last Post: 10th November 2011, 15:45
  2. How to setFocus to QMenuBar programatically?
    By ticvitanic in forum Qt Programming
    Replies: 0
    Last Post: 2nd July 2010, 15:58
  3. Can I Programatically Overlap Dock Widgets?
    By bieber in forum Qt Programming
    Replies: 0
    Last Post: 29th June 2010, 19:42
  4. Replies: 19
    Last Post: 21st January 2008, 09:13

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.