Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProcess::startDetached deprecated in 4.6.3?

QProcess::startDetached deprecated in 4.6.3?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gpazo
    wrote on last edited by
    #1

    I'm writing a piece of code to download and launch a particular file outside of my application and have been running into an issue with Qt 4.6.3. I have the code tested and working on my local Qt 4.8.1 and 4.8.4 builds but when I have built the executables using 4.6.3 I do not see the same behavior of the QProcess::startDetached launching. Code snippet below, any tips?

    @QStringList options;
    QProcess *installer = new QProcess(this);
    #ifdef Q_WS_MACX
    QProcess sh;
    sh.start("tar -xvf " + filename);
    sh.waitForFinished();
    QByteArray output= sh.readAll();
    sh.close();
    filename = "file.app";
    QFileInfo *path2 = new QFileInfo(filename);
    QString filepath = path2->absoluteFilePath() + "/Contents/MacOS/osx-intel";
    installer->startDetached(filepath, options);
    #endif@

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      What should happen and what is happening ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gpazo
        wrote on last edited by
        #3

        I appreciate the quick response, the behavior that I am seeing is when executing the code in 4.8.4 the process starts the file.app/Contents/MacOS/osx-intel and continues on it's way. When I build on qt 4.6.3 (external build machine) the code downloads the file into the tar.gz format and does not execute the untar step at line 5. This whole code snippet is trying to deal with the mac .app format for an application. Note: seeing same behavior with linux build with the following code:
        @#ifdef Q_OS_LINUX
        QFile launch(filename); launch.setPermissions(QFile::ReadOwner|QFile::WriteOwner|QFile::ExeOwner|QFile::ReadGroup|QFile::WriteGroup|QFile::ExeGroup|QFile::ReadOther|QFile::WriteOther|QFile::ExeOther);
        QFileInfo *path = new QFileInfo(filename);
        installer->startDetached(path->absoluteFilePath(), options);
        if(installer->startDetached(filename))
        reject();
        #endif@

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Did you check the output standard out/error from QProcess to see if it complained about something ? i.e. invalid file location etc...

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved