Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Execute qml->build execute file from Another qml gui
QtWS25 Last Chance

Execute qml->build execute file from Another qml gui

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qml qprocessqtqmlqmlbuild
3 Posts 2 Posters 355 Views
  • 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 Offline
    J Offline
    Joshika_Namani
    wrote on 19 Aug 2022, 04:58 last edited by
    #1

    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.

    O 1 Reply Last reply 20 Aug 2022, 18:21
    0
    • J Joshika_Namani
      19 Aug 2022, 04:58

      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.

      O Offline
      O Offline
      ODБOï
      wrote on 20 Aug 2022, 18:21 last edited by
      #2

      @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
      0
      • J Offline
        J Offline
        Joshika_Namani
        wrote on 23 Aug 2022, 05:05 last edited by
        #3

        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
        0

        1/3

        19 Aug 2022, 04:58

        • Login

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