Execute qml->build execute file from Another qml gui
-
wrote on 19 Aug 2022, 04:58 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. -
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.wrote on 20 Aug 2022, 18:21 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 -
wrote on 23 Aug 2022, 05:05 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.
3/3