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

QProcess failed to start/execute from ProgramFiles

I'm doing a QT app for windows that during the execution I need to start another program that is on the same folder than the executable. The thing is that I have this currently working but it only fails when I copy the folder into "C:/program files…
rul3s
  • 332
  • 1
  • 2
  • 18
0
votes
1 answer

how to pass/send control-c in QProcess

I am trying to mimic what the following command line in QProcess, but I do not know how to pass/send the control-c by using QProcess. Any help would be greatly appreciated: NOTE: Can't use QProcess.kill(),…
cnm
  • 113
  • 11
0
votes
1 answer

how to handle input parameters in QProcess

The following simple python code requires three input arguments for 'test.py' (besides 'python' and 'test.py') in command line: #!/usr/bin/python import sys def main(argv): if (len(sys.argv) < 4): print ('argv must be greater than 4') …
cnm
  • 113
  • 11
0
votes
1 answer

How to limit the buffer size of a pipe (windows)?

I am trying to control and read the output of a 3rd party console application, of which source code I cannot change. I want to use QProcess for this, but this should not matter, as the issue is the same when just using cmd: The 3rd party app seems…
NTG
  • 73
  • 9
0
votes
3 answers

QProcess::Crashed. Avoiding Windows 10 crash message of external program

Suppose that we want to run external command line application, for example "dir" and suppose that it crashes: namespace util { bool execChildProcess(const std::string & cmd, std::string & cmdOutput) { QProcess process; …
sergio campo
  • 190
  • 2
  • 13
0
votes
0 answers

QT QProcess cmd & tptf

I'm trying to run the windows shell from my qt program and, from there, run a tftp command ... I'm documenting a bit 'but I do not understand what is wrong. First of all i want to say that the device connected with my computer is correctly…
Nic
  • 163
  • 3
  • 19
0
votes
1 answer

How can I capture terminal output from a bash script and display it in my Qt UI?

I've written a simple GUI that guides the user through a checkout/checkin procedure, and then runs a bash script when the user clicks a GUI button. I'd like to create a field within the GUI and display the output of the script. Right now I'm using…
Mark
  • 40
  • 3
0
votes
1 answer

QProcess executing python3 script not working properly

I'm having this issue executing a python3 script from QProcess. The python script is printing the time from second to second and it is working fine from command line. In Qt, the signal readyReadStandardOutput() is connected to a slot where…
Ispas Claudiu
  • 1,890
  • 2
  • 28
  • 54
0
votes
2 answers

Exchange data between Qt Application and nodejs server

I have created a web server architecture in nodejs which serves web pages when running. On the other hand I have a Qt GUI application. I need to make an interface between these two. I have already created the connection between these two using…
0
votes
1 answer

Avoid message to stdout/sterr when QProcess aborted

My C++ app launches a QProcess, and after 60 seconds kills the process (if it runs too long). So that part is fine, but on the console I see: QProcess: Destroyed while process ("myapp") is still running. when the QProcess is killed. Is there some…
TSG
  • 4,242
  • 9
  • 61
  • 121
0
votes
0 answers

How do I refresh a Chrome website opened with Qt - QProcess

Starting an instance of the Chrome Browser via Qt / QProcess works fine. (Windows OS) QString program = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"; QStringList arguments; arguments << "http://www.google.com"; QProcess…
LiquiNUX
  • 1
  • 1
0
votes
1 answer

Using curl in QProcess

I have a problem which is quite similar to my last question Ssh command from Qt. But I cannot understand what is wrong with one of the arguments that I pass to cUrl in QProcess. The code is: QStringList params; const double timeout = 8.0; …
Polina Bodnar
  • 171
  • 3
  • 15
0
votes
1 answer

Bring QProcess window to front (running Qt Assistant)

My Qt application starts a QProcess that runs Qt Assistant. I am using Linux (Ubuntu/Neon/KDE) but I want the Qt application to run on Windows and other Linux distributions as well. Now I need a function that allows to bring the Assistant main…
Silicomancer
  • 8,604
  • 10
  • 63
  • 130
0
votes
1 answer

Argument doesn't recognized if passed with QProcess

I have difficult to pass the -vo argument to mplayer using QProcess, Here a minimal example: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); QString program; program =…
Mark
  • 4,338
  • 7
  • 58
  • 120
0
votes
0 answers

How can I send messages from my Qt GUI Window to another process

I want to make an editor for my OpenGL application. The OpenGL application executes by itself and creates its own window using the SDL2 library. I've made a Qt widget GUI, and I start QProcess by clicking a button, which starts the OpenGL…
Zebrafish
  • 11,682
  • 3
  • 43
  • 119