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
Forum Updated to NodeBB v4.3 + New Features

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 410 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 28 Sept 2018, 10:38 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

    J 1 Reply Last reply 28 Sept 2018, 10:47
    0
    • K KIMIA
      28 Sept 2018, 10:38

      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

      J Offline
      J Offline
      JonB
      wrote on 28 Sept 2018, 10:47 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 28 Sept 2018, 11:17
      3
      • J JonB
        28 Sept 2018, 10:47

        @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 28 Sept 2018, 11:17 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

        3/3

        28 Sept 2018, 11:17

        • Login

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