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. Run Executable File that Obtained from Makeing Project With Command(QProcess) in QT
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Solved General and Desktop
run executablemake commandrun qt externalmake command qt
3 Posts 2 Posters 409 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.
  • K Offline
    K Offline
    KIMIA
    wrote on last edited by
    #1

    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

    JonBJ 1 Reply Last reply
    0
    • K KIMIA

      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

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @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
      3
      • JonBJ JonB

        @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 Offline
        K Offline
        KIMIA
        wrote on last edited by
        #3

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

        1 Reply Last reply
        1

        • Login

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