Executing application several time from the shell script file ...[SOLVED]

  • Hi All,
    I have developed an application in QT and Sqlite. I have to pass several parameters to it by command line like
    ./myApplication -p1 Au,2,C,2 -p1 2,3 -p3 0.25,0.5 -p4 0.25 ...... soon

    I have to run it thousand of time. Doing this manually is tedious.
    So to execute my application I have crated shell script file to execute it from terminal on Linux (ubuntu) to run application several time.


    echo Start
    ./myApplication -f Au,8,C,18,H,15,N,2,O,6 -z 2,3 -d 0.25,0.1 -a 0.25
    echo 1
    ./myApplication -f Au,9,C,56,H,56,P,11,F,18 -z 2,3 -d 0.25,0.1 -a 0.25
    echo 2
    ./myApplication -f Au,9,C,56,H,56,P,8,B,3,F,12 -z 2,3 -d 0.25,0.1 -a 0.25
    echo End

    The Problem is after execution first time it STOP there and never close (return a.exec). How to close the application once it's done. So that it will run the 2nd, 3rd ... time. I have try a.closeAllWindows() a.quit() but nothing works.


  • Can you show some code? I guess there is something wrong with it and QApplication::exec() maybe never returns..

  • Hi Binary91,
    Thanks Binary91 ... My application code is large any how I have fixed this issue by creating the signal/slot. Once my application done with the all computation will emit signal to close in the slot like this

    void ResolutionCalculationBS::handleCloseAll(bool flag)
    }//end if
    }//end handleCloseAll

    This works fine for me. I think application event loop is ON so i have to kill it forcefully. It may not be the best solution, but in my case it works :).


  • Ok.
    If you're fine with that solution, you can update thread title prepending [SOLVED], so everyone knows that this topic doesn't need attention anymore...

  • OK Done

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.