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. QSA Workbench - Win7 - Starting a .exe

QSA Workbench - Win7 - Starting a .exe

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.5k 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.
  • R Offline
    R Offline
    rodneyjerkins
    wrote on last edited by
    #1

    Hello!

    I am working with QSA Workbench Version 1.1.5 and my OS is Windows 7 64bit. I am writing a little program and I am trying to figure out how to start a external program. I have looked through the 'help' database and I found the 'Process Class Reference' chapter. I have searched through the web and also this forum for my problem but I couldnt find a solution that was really helping me.

    What I want to do:
    All I want to do is start a .exe file with my little program. My problem is that I am not quite sure about the syntax etc... At the moment I am trying the following:
    @ var process = new Process();
    var path = "c:\Users\Blackbox\AppData\Roaming\MATLAB";
    process.workingDirectory = path;
    var arg = path + "\inverse.exe";
    process.start(arg);@

    I just dont know how to call the .exe file. Do I need the process ID (pid) of my .exe in order to start it? As you can see I am helpless right here. I appreciate any type of help...

    Thanks in advance!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Are you sure that the \ in the string doesn't need to be escaped? Usually, literal backslashes need to be doubled. Note that in Qt, you can use forward slashes internally everywhere on every platform.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rodneyjerkins
        wrote on last edited by
        #3

        Hey,

        thanks for your fast reply! Here is what I tried now:

        @var process = new Process();
        var path = "c://Users//Blackbox//AppData//Roaming//MATLAB//";
        process.workingDirectory = path;
        var arg = path + "inverse.exe";
        process.start(arg);@

        And here is the error log:
        @Error: loadflow : 183
        TypeError. No matching overload found. Following overloads are possible:
        start()
        start(QStringList*)
        Callstack:
        loadflow(loadflow:183) (global context)@

        Note that loadflow is the name of my program. What am I doing wrong? I simply want to start the .exe.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Now you're doing both the doubling and the forward slash. It's either... or..., not both.

          I don't know much about QSA, so I can't help you with the actual method call. I have no idea where that is documented. I'd think that the QStringList is a list of arguments, and that you need some other way to set the path of the executable to run in the Process object, but I can't be sure about that without docs.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rodneyjerkins
            wrote on last edited by
            #5

            Finally, I got it.....

            Here is the working code:
            @var process = new Process();
            var arg = new Array();
            arg[0] = "inverse.exe";
            process.arguments = arg;
            process.start();@

            Works just fine. Thanks for your help Andre!

            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