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

Execute qml->build execute file from Another qml gui

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qml qprocessqtqmlqmlbuild
3 Posts 2 Posters 357 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 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.

    ODБOïO 1 Reply Last reply
    0
    • J Joshika_Namani

      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ïO Offline
      ODБOïO Offline
      ODБOï
      wrote on 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 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

        • Login

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