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
2 answers

QProcess saving to QTextEdit

What I'm trying to do is launch a program within another program using QProcess and then save the output from the launched program into a QTextEdit of the launcher program. Every time I launch this program I want it to add more text to the…
Dmon
  • 220
  • 4
  • 15
0
votes
1 answer

launching a program inside another program

I'm trying to get Qt to launch another Qt program when a button is clicked. Here is my code. void Widget::launchModule(){ QString program = "C:\A2Q1-build-desktop\debug\A2Q1.exe"; QStringList arguments; QProcess *myProcess = new…
Dmon
  • 220
  • 4
  • 15
0
votes
2 answers

No output from QProcess

Why does the following print a blank line instead of 'Hello QProcess'? import sys from PyQt4 import QtGui, QtCore proc = QtCore.QProcess() proc.start("echo 'Hello QProcess'") proc.waitForFinished() result = proc.readAll() print…
Jesse Aldridge
  • 7,991
  • 9
  • 48
  • 75
0
votes
1 answer

What is the recommended way of passing keyboad events to QProcess transparently?

I have a GUI application, which creates a QProcess inside, catches its output and shows it on a form. I need to somehow catch key events from the form to pass them to QProcess (to make it fell as close as possible to real terminal window). So, I…
fjarri
  • 9,546
  • 39
  • 49
0
votes
1 answer

QProcess exception QT

I am developing an application that creates and runs another Qprocess. My code is: QProcess myProcess = new QProcess(); connect(myProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this,…
RRR
  • 3,937
  • 13
  • 51
  • 75
0
votes
0 answers

QProcess and setpgid

I've got a Qt GUI application that wraps a console process. I use QProcess to launch it and display its outputs in a QTextEdit. However, I do it in a special way (running a shell) because the process needs to have access to some environment…
wrousseau
  • 311
  • 3
  • 12
0
votes
4 answers

Using $HOME in Qt

I am working on a Qt project and I want the working directories to be dynamically set for the program will be run on different systems. I have enclosed the code for your reference. QProcess Home; Home.start("echo",QStringList() <<…
0
votes
3 answers

get qprocess output in slot

i have a problem with a small program (I am a beginner with c++ and qt). On button press it starts a cli application with qprocess and the output should be displayed in a text field as soon as the cli app writes it to stdout or stderr. i read that…
arkhon
  • 765
  • 2
  • 11
  • 28
0
votes
3 answers

Qprocess and command MSDOS

I want execute a commande line with QProcess : QString elf_path=C:\\files\\file.elf; QString appli = "readelf.exe -a "+elf_path+" >>C:\\work\\essai.txt"; QProcess *process = new QProcess(); process->execute(appli); but QT display this error…
physics
  • 161
  • 9
0
votes
1 answer

Launch console application which uses environment variables from QT Gui application

I am currently making a GUI using QT4.8 which basically needs to launch a console application. However, because this console application tries to fetch some environment variables, I can't seem to manage to make this work. I am using QProcess…
wrousseau
  • 311
  • 3
  • 12
0
votes
1 answer

Parsing output in Qt

I need to parse the output of vol command only to get the id i.e only abcd-1234, that is being used in QProcess. Here is my code to get the Volume Serial Number: QProcess process; process.start("cmd /c vol…
highlander141
  • 1,683
  • 3
  • 23
  • 48
0
votes
0 answers

Why i can't get value form QProcess use readyReadStandardOutput signal

I am working with a clientupdate.exe to update my client,so there is a func "getVersion" to get the latest version number: Execute::Execute(QObject *parent) : QObject(parent) { f=Father::GetInstance(); ftp=new FtpProvider(this); …
Jack
  • 161
  • 1
  • 13
  • 20
0
votes
2 answers

Need to quit a process from inside Qt GUI, just as it is started

I am trying to run C++ executables placed inside SBC6845 [inside /ftest as shown ]. Now these executables are running with while(1){ // around 250-300 lines of code here } infinite loop. Now when I run only the codes from terminal, I can kill them…
rNov
  • 61
  • 1
  • 15
0
votes
0 answers

Ways to use MPI executable in Qt?

I have developed an application which comprises of a frontend Qt-GUI and a solver EXE. As these two are independent module, I could successfully launch EXE in Qt-GUI by using a QProcess like below: QProcess *myProcess = new…
0
votes
4 answers

QProcess, Cannot Create Pipe

I am running a QProcess in a timer slot at 1 Hz. The process is designed to evoke a Linux command and parse it's output. The problem is this: after the program runs for about 20 minutes, I get this error: QProcessPrivate::createPipe: Cannot create…
Tyler Jandreau
  • 4,245
  • 1
  • 22
  • 47