Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Run Executable File that Obtained from Makeing Project With Command(QProcess) in QT

    General and Desktop
    run executable make command run qt external make command qt
    2
    3
    225
    Loading More Posts
    • 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.
    • K
      KIMIA last edited by

      Hi.
      I just want to run an external qt project with commands in qt.
      I tried with QProcess.
      I used start method to run qmake & make.I worked well and made that exe file.
      but I couldn't run my exe file with the start method.I tried startDetached also.I couldn't success.

      This is What I did :

      Command = "qmake";
      args<<"window_qmake.pro";
      
      myProcess.start(Command);
      myProcess.waitForFinished();
      
      //**
      
      Command = "qmake";
      
      myProcess.start(Command);
      myProcess.waitForFinished();
      
      //**
      
      Command = "make clean";
      myProcess.start(Command);
      myProcess.waitForFinished();
      
      //**
      
      Command = "make";
      myProcess.start(Command);
      myProcess.waitForFinished();
      
      //**
      
      Command = "./";
      args<<"window_qmake";
      //myProcess.startDetached("window_qmake");
      myProcess.start(Command,args);
      myProcess.waitForFinished();
      

      Is there anyone who can help me with that?
      Thank You

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @KIMIA last edited by

        @KIMIA
        In the final case where you want to run your executable you need to set your Command to that. I don't know why you currently have Command = "./"; but that's not going to work. You want something more like:

        Command = "./window_qmake.exe"; // or whatever is necessary as the path to your .exe file
        myProcess.start(Command);
        

        You only need to set up and pass in any args if your want to pass any command-line parameters to your .exe.

        K 1 Reply Last reply Reply Quote 3
        • K
          KIMIA @JonB last edited by

          @JonB
          Ohh,You're right.
          I made a mistake.
          You are Great.
          Thank you so much.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post