Results 1 to 2 of 2

Thread: Insert some text in external exe file.

  1. #1
    Join Date
    Jul 2019
    Posts
    9
    Qt products
    Qt5
    Platforms
    Windows

    Question Insert some text in external exe file.

    I am using qt creator to make UI. I created the push button which i can run external exe file buy clicking, and also i have second push button. I want to insert text "gogo1" in the external exe file using second push button clicked. The external exe program looks like cmd. Can anyone help me?

    This is my code for first push button to run external program

    void MainWindow:n_pushButton_8_clicked()
    {
    QProcess *process = new QProcess(this);
    QString file("D:\\Python_practice\\proto4\\Surface Evolver Code\\F_Passive_for_UI.fe");
    process->execute(file);
    //process->start(file);
    QDesktopServices:penUrl(QUrl("file:///"+file,QUrl::TolerantMode));
    }

    and for second push button.

    void MainWindow:n_pushButton_9_clicked()
    {

    }


    This is the portion of external exe program. Please click to see the image
    3.jpg

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Insert some text in external exe file.

    From QProcess doc : QProcess allows you to treat a process as a sequential I/O device. You can write to and read from the process just as you would access a network connection using QTcpSocket. You can then write to the process's standard input by calling write(), and read the standard output by calling read(), readLine(), and getChar().

Similar Threads

  1. Replies: 6
    Last Post: 26th July 2019, 02:09
  2. Replies: 3
    Last Post: 25th July 2019, 15:28
  3. Replies: 2
    Last Post: 14th June 2015, 21:39
  4. Insert data in a text file
    By korwin in forum Newbie
    Replies: 7
    Last Post: 15th July 2011, 03:48
  5. Replies: 2
    Last Post: 17th November 2006, 12:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.