Questions tagged [qprocess]

The QProcess class, part of the Qt framework, provides a way to start external programs and to communicate with them.

The QProcess class is used to start external programs and to communicate with them.

To start a process, pass the name and command line arguments of the program you want to run as arguments to start(). Arguments are supplied as individual strings in a QStringList.

Alternatively, you can set the program to run with setProgram() and setArguments(), and then call start() or open().

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

675 questions
0
votes
1 answer

Better way to strip leading character, new line, cr from QBytearray

If I only convert the QBytearray to str then the output looks like this: b'Enter an input A,B,C:\r\n' I can get rid of the \r\n by using QBytearray.simplified() then the output looks like this :b'Enter an input A,B,C:' In order to remove the last…
kaminsknator
  • 1,135
  • 3
  • 15
  • 26
0
votes
1 answer

cmd.exe to open pdf and print it

I am using Qt4.8, What I want is open a pdf and print that pdf automatically through cmd.exe, without clicking on print button in pdf reader by using QProcess: I have two different code that do two different task: Opne Pdf QString scmd=…
0
votes
3 answers

QProcess:startDetached open application but does not find argument

I'm trying to run Evince to read a pdf file from my Qt program, using QProcess::startDetached method : QProcess myProcess = QProcess(); myProcess.startDetached("evince", "~/mypath/doc.pdf"); Evince is well launched, but in its HMI I get the…
0
votes
0 answers

Running .bat file show Error findstr not recognized from QProcess Qt

I am trying to execute a *.bat file from QProcess with some argument. While running from Command line it show the log as desired but running from QProcess after running the *.bat file it show : 'findstr' is not recognized as an internal or…
P Kumar
  • 105
  • 1
  • 2
  • 12
0
votes
2 answers

QProcess ReadAllStandardError()

I need to connect a QProcess to an error handler, but I'm unsure how to pass the error string to the slot. What's below compiles, but doesn't work. QString MainWindow::RunProcess(QString cstring) { QProcess *process = new QProcess(this); …
Alan
  • 1,265
  • 4
  • 22
  • 44
0
votes
1 answer

Get output from Python script in QT

I want to run script written in Python and get all output from that. This is my cpp code QProcess process; process.setProcessChannelMode(QProcess::MergedChannels); QString exe = "python…
Tatarinho
  • 754
  • 2
  • 11
  • 31
0
votes
0 answers

Running C-Shell Script with QProcess

I want to run the commands contained in setup.csh concurrently using QProcess. The deneme variable is a command in the setup.csh file: alias deneme "ls -la" My purpose is to run a command guide in that setup.csh. QProcess *process1=new…
elif mutlu
  • 83
  • 5
0
votes
0 answers

How can I run many concurrent commands using QProcess with c ++

I edited the code, The "deneme" variable is a command in the setup.csh file. In the setup.ssh "deneme" command: alias deneme "ls -la". My purpose is to run a command guide in that setup.csh. Termainal command: [intern2atlas SETUP]$ source…
elif mutlu
  • 83
  • 5
0
votes
0 answers

Using QProcess or QDesktopService to open excel sheets

I want to write a programm that opens a file with the standard application of the System (only for windows I think) and closes itseft if the process in which the file is opened is closed. QDesktopServices::openUrl can be used to open a test.xls file…
b.holz
  • 237
  • 3
  • 17
0
votes
1 answer

Monitor running qprocess and return value when qprocess is finished

I want to run a qprocess (the program adb) and when the process is finished return the results to the calling function. However, there's every possibility that adb could find itself in a loop, printing error messages such as "ADB server didn't ACK"…
Alan
  • 1,265
  • 4
  • 22
  • 44
0
votes
0 answers

QT communicate through QProcess with Notepad.exe

I would like to start notepad.exe from QT and then for example write "Hello Notepad" to the input-area of Notepad from QT! What I managed to do, is starting notepad from QT. But what ever I try I can't fill in the text in the Notepad-textedit…
F-Kae
  • 155
  • 1
  • 2
  • 14
0
votes
0 answers

QProcess and firefox

I have an issues trying to launch firefox through QProcess. Here is the function I used to launch commands (such as firefox, mkdir, ...) double launch_nowait(string cmd, bool display) { string command_name = ""; string command_param = ""; …
Gleipnir
  • 53
  • 6
0
votes
2 answers

QProcess exe does not close if program finished

My problem is that I am starting an executable in a QProcess like the following: QProcess Work; Work.start(program.exe); This executable runs since it has been started in background and I can send requests to it. If I have finished I am closing the…
Lehtim
  • 125
  • 1
  • 12
0
votes
1 answer

Qt Release QProcess Signal Slot Issue

Using Qt 5.6.0 & MSVC2015 I have an app which upon start-up, using QProcess and ssh/plink/cat, shall attempt to read the hostname of a remote server and capture the contents of a specific file on a remote server. This works when run from Qt Creator…
IanC
  • 1
0
votes
0 answers

Why does reading from stdout using QProcess break my Windows application?

I have a cross-platform (Windows 8/OSX 10.10) test application which, as part of the test, needs to spawn a child process which will listen on a port (can be dynamic or specified). The child process (call it MockServer), upon startup, will send to…
Steve Broberg
  • 4,255
  • 3
  • 28
  • 40