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 does not work with "wget"

I am trying to execute command like this: wget --user=abc --ask-password https://xxxxx.com/file.zip then I have to deliver password. This code should handle it: connect(&checkFW, SIGNAL(readyReadStandardOutput()), this,…
RobertLT
  • 41
  • 6
0
votes
0 answers

QProcess setStandardOutputFile to nullDevice does not work (win)

I have a QProcess where I am not able to discard the Output on a Windows Machine: QProcess * pingProcess = new QProcess; arguments "google.com" << "-n" <<…
nop_0x00
  • 33
  • 7
0
votes
2 answers

How can I use a queue with QProcess?

I have a slot that is called passing some arguments used in a QProcess. I execute a external program with some of this arguments. The problem is that I want to have a queue for these processes, waiting until the previous process is finished to…
legami
  • 1,303
  • 6
  • 22
  • 31
0
votes
1 answer

piping standard output into QLabel in Qt 4.7

I am trying to wrap a colleges c++ code in a Qt widget. However, his programs std output necessarily needs to be viewed. As of now I am assuming I will build a GUI and open a QProccess that will run his program (then send commands over that pipe).…
CasualScience
  • 661
  • 1
  • 8
  • 19
0
votes
0 answers

Unable to run shell script from Qt GUI

I am facing some trouble in running a shell script in my Ubuntu 16.04 from a Qt GUI application. onClick() for the push button is given below, which i found from How to start a Shell Script with QProcess? void…
Rahul Raj
  • 1
  • 1
0
votes
1 answer

Kill a QProcess running in a different QThread

I have a class that inherits QThread and I reimplemented the run() method. In this run method, there's a QProcess (declared in run) that starts a program. Now if I close my application while that process is still running, it actually won't close…
nmud
  • 175
  • 14
0
votes
2 answers

osx: external program (qprocess) crash if parent run with open, but works fine if parent run directly

I faced the strange situation on MacOS 10.13 and can't find what is the root of it. I have 32-bit Qt application packed in a bundle. Because of MacOS limitation for one of the operations I need to start small 64-bit console binary that does a trick.…
johngull
  • 819
  • 6
  • 22
0
votes
1 answer

Can two QProcesses communicate via signals and slots?

I want to communicate from 1 QProcess to another. So do I need some IPC mechanism or can I do it with signal and slots also.
0
votes
1 answer

QProcess freeze GUI

This is a code snippet for a QNX target. It works fine when I run it on system and when I do the next ignition cycle/ restarting my system, the GUI is freezes/hangs. If possible, please tell me what is wrong in this code. I tried with…
Arun Kumar
  • 151
  • 3
  • 10
0
votes
0 answers

QProcess::readyReadStandardError() signal not emit until the process closed?

I'm trying to redirect other process's stdout and stderr to my Qt GUI app. But I notice that QProcess::readyReadStandardError() signal only emitted (once) when the other process is closing. Is there something wrong in my code? void…
ricky
  • 2,058
  • 4
  • 23
  • 49
0
votes
0 answers

Using openUrl() to Open a .qrc Resource File

I have found a few post regarding this topic, but the code used in verbatim and slightly modified gives me an error. I have a .docx file named COPYING stored in a / prefix inside a resources folder. I would like to open this file with whatever…
CrippledTable
  • 784
  • 5
  • 20
0
votes
1 answer

Executing the shell command in QProcess.Piping the input

I am trying to pipe the commands and execute it, but I am not able to figure how to pipe it. I am trying to copy multiple files at once using the shell command for %I in (source) do copy %I (destination) QString files = "for %I in (source) do…
Vikrant singh
  • 433
  • 1
  • 7
  • 25
0
votes
0 answers

How show unicode (emoji) filenames "explorer.exe /select" using QProcess?

I using explorer for show files and "select" in Windows 7 and Windows 8, like this: explorer /select,c:\foo\bar\baz.txt In Qt I tried use: const QString filepath = a.applicationDirPath() + "\\.txt"; QStringList params = QStringList() << "/select,"…
Protomen
  • 9,471
  • 9
  • 57
  • 124
0
votes
2 answers

QProcess can launch programs but not python (command line)

The following code is failing to launch the python command line. QProcess *myProcess = new QProcess(this); myProcess->start("\"C:\\Program Files\\Python27\\python.exe\""); If I replace python27 with (for example) myProcess->start("\"C:\\Program…
t020608
  • 333
  • 2
  • 3
  • 12
0
votes
0 answers

QProcess causes "R6016 - not enough space for thread data"

Launching ipconfig using QProcess causes a crash with an error dialog Runtime error! c:\Windows\SysWOW64\ipconfig.exe R6016 not enough space for thread data on some machines (it is not everywhere that the problem occurs), see image. Am I…
Protomen
  • 9,471
  • 9
  • 57
  • 124