Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to run ts_calibrate in qt application?



  • Hi. I have friendly arm and I want to play ts_calibrate inside my qt app.I do not need the output of the program. I just run calibrate application from my app and after it finished, it closed and my app continue .
    I wrote these code but it does not work:

    QProcess *process=new QProcess;
    //        QString file = QDir::homepath + "file.exe";
            QString file ="/usr/local/bin/ts_calibrate";
            process->start(file, QStringList() << "");
    //        process.start(file);
            process->waitForFinished(-1);
    

    could any one help me please?


  • Qt Champions 2019

    @MhM93 If you say "it does not work" you should say what exactly does not work or what happens.
    Does /usr/local/bin/ts_calibrate exist? Is it executable?
    Why do you pass an empty string as parameter:

    process->start(file, QStringList() << "");
    

    ?
    Change it to:

    process->start(file, QStringList());
    

    Why do you wait for the process to finish?



  • If you say "it does not work" you should say what exactly does not work or what happens.

    when I clicked on my button to run these codes,my app hanging and nothing work on my device. I pressed ctrl+c to quit the app.

    Does /usr/local/bin/ts_calibrate exist? Is it executable?

    yes. Its run with ./ts_calibrate

    thank you, its worked, but last touch suddenly come back to my app and another widget open. but it not a big problem. thanks in advance


Log in to reply