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

QProcess started from a QMainWindow freezes window

I have a simple QMainWindow in which user can set some parameters. I have three buttons which, when clicked, create a new QProcess displaying a QMainWindow. For example, main window's button A starts QProcess A, main window's button B starts process…
Michael
  • 876
  • 9
  • 29
0
votes
0 answers

Is QObject or subclassing QThread better for executing and monitoring an external process?

I have subclassed QThread and added to it some functionality such as starting a user-defined external process, monitoring its behaviour (has it started?, has it stopped, what is its exit code etc.) and reporting back to the main thread (that is…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
0
votes
0 answers

Can't start process in Qt

I have inside the output folder a folder called foo with an executable a.exe that I would like to call. Unfortunately it isn't opening and whatever is the directory I pass to setWorkingDirectory, I get an error output. The code: QProcess…
Jack
  • 16,276
  • 55
  • 159
  • 284
0
votes
1 answer

Why is a QProgressDialog doesn't get updated after executing a QProcess?

I am using a QProgressDialog to show the status of a long running operation, which includes a step of running an external executable. I run the external executable using the QProcess::execute() method. QprogressDialog works fine updating the label…
Sulla
  • 7,631
  • 9
  • 45
  • 71
0
votes
2 answers

Qt - How to redirect QProcess' stdout to TextEdit

I'm trying to print the process output of downloading a website using wget in a widget (textEdit) , but it prints nothing , however in terminal it works. Example Command : wget --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U…
mariuss
  • 1,177
  • 2
  • 14
  • 30
0
votes
3 answers

Properly using Qt QProcess

I'm considering to use QProcess to call a command line app (gpio) multiple times. Every time user clicks a button then a command is issued. And the app output will be monitored and redirected to screeen. The code looks like the following. void…
KcFnMi
  • 5,516
  • 10
  • 62
  • 136
0
votes
1 answer

QProcess returns exit code yet doesn't exit?

I was planning using QProcess to execute a program(.exe) in my computer and process a file which already exists, then output a new file and continue the next step, the whole process takes about 3 to 5 seconds. However, although the process screen…
APU
  • 239
  • 2
  • 17
0
votes
2 answers

How to destroy QProcess when it finishes and the class than contaed the slot

I start a QProcess in member function of a class but that object (Pdf object below) will soon get destroyed after creating the process. I obviously want the slot function to be available and called when QProcess finishes. I pass QProcess pointer so…
zar
  • 11,361
  • 14
  • 96
  • 178
0
votes
1 answer

Spawn Async QProcess from Dynamic Library, Peek Output Until Done

In Qt/C++, from a dynamic library (Qt C++ Class Project), I need to spawn a new process for a command line command (dir /s is a good example) without locking up the GUI that calls this library function. Then, I need to peek at this standard output…
Volomike
  • 23,743
  • 21
  • 113
  • 209
0
votes
0 answers

QProcess: how to know a command send to a shell has finished

Consider the following code (for Windows platforms): // Function called lots of times. void showText(QString str, QString filename, bool open = false) { static QProcess* myProcess = new QProcess(); if (myProcess->state() ==…
ABu
  • 10,423
  • 6
  • 52
  • 103
0
votes
0 answers

How do I fix segfault error 4 in a shared library from Qt?

So heres my issue.... I have my application1 where I start up another application2 through a QProcess. Application2 has dependencies on Qt shared libraries, so before I start up the QProcess, I set the QProcess system environment to the current…
0
votes
1 answer

PyQt4 QProcess state always 0, various slots not working too

I am trying to figure out the way QProcess (Linux!) works because I'm going to need it for a project of mine (Note: suprocess or multithreading is not to be used! The process also has to be detached from the main application!). Here is a small code…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
0
votes
1 answer

QProcess failed to start: the file name or extension is too long

I have a problem, this is my code QProcess *process = new…
GunHalcon
  • 31
  • 5
0
votes
2 answers

Can't launch correctly mysqldump in QProcess of Qt4

i'm trying to download sql dump from distant host in Qt4 application (Debian 6). QProcess process_one(this), process_two(this); QStringList args1, args2; args1 << "--host=192.168.0.1" << "--user=root" << "--password=root" << "nfc tag"; …
r_spb
  • 75
  • 1
  • 14
0
votes
2 answers

QProcess Mac OS , Cant launch executable with arguments

/usr/local/bin/rdesktop launched from terminal connects me to host following launches rdesktop without arguments: QString program = "/usr/local/bin/rdesktop"; QStringList args; QProcess *process = new QProcess(this); args <<…
brucen
  • 35
  • 1
  • 5