Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Unsolved Execute qml->build execute file from Another qml gui

    QML and Qt Quick
    qml qprocess qtqml qmlbuild
    2
    3
    93
    Loading More Posts
    • 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.
    • J
      Joshika_Namani last edited by

      Hi everyone,
      I'm trying to figure out, how to qml build run file from another qml gui button, when onclicked event happened, it should execute another qml build exe file, I have tried with QProcess, but I'm unable to figure out QProcessEnvironment for qml build.

      QString filepath="/QML TYPES/build-Task-Desktop_Qt_5_15_0_GCC_64bit-Debug/Task";
      QProcess process;
      QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
      env.insert("TMPDIR", "/home/ubuntu/Qt/5.15.0/gcc_64/bin/qml"); // Add an environment variable
      env.insert("COMPILER", env.value("Compiler") + "/usr/lib/ccache/x86_64-linux-gnu-g++");
      process.setProcessEnvironment(env);
      process.start(filepath);
      

      But, Unfortunately above code is not working, so, please help to get out of this issue.
      Thanks in advance.

      ODБOï 1 Reply Last reply Reply Quote 0
      • ODБOï
        ODБOï @Joshika_Namani last edited by

        @Joshika_Namani hi
        can you see any messages or errors in your 'application output' tab in QtCreator ?
        also you can connect a slot to void QProcess::errorOccurred signal

        1 Reply Last reply Reply Quote 0
        • J
          Joshika_Namani last edited by

          No, After adding below line.
          process.waitForFinished(-1).
          but nothing happening. no error , no output.
          And, my doubt is that process environment is correct or not.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post