Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Executing application several time from the shell script file ...[SOLVED]

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

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.0k 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.
  • B Offline
    B Offline
    Bittoo
    wrote on 11 Nov 2014, 05:41 last edited by
    #1

    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.

    @
    #!/bin/bash

    clear
    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.

    Thanks
    Manoj

    Regards,
    Manoj Kumar Panwar,

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Binary91
      wrote on 11 Nov 2014, 09:40 last edited by
      #2

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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bittoo
        wrote on 11 Nov 2014, 12:34 last edited by
        #3

        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)
        {
        if(flag){
        //QApplication::aboutToQuit();
        QApplication::quit();
        QApplication::exec();
        }//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 :).

        Thanks

        Regards,
        Manoj Kumar Panwar,

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Binary91
          wrote on 11 Nov 2014, 16:31 last edited by
          #4

          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...

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Bittoo
            wrote on 12 Nov 2014, 04:13 last edited by
            #5

            OK Done

            Regards,
            Manoj Kumar Panwar,

            1 Reply Last reply
            0

            1/5

            11 Nov 2014, 05:41

            • Login

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