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
3
votes
1 answer

Sending Ctrl+C event to a process launched using QProcess on Windows

I have a dialog which acts as a configurator for a console application. The dialog’s job is to offer the user a set of widgets (which mirror the options supported by the console application) and when user clicks on the “Start” button, the dialog…
Bharath
  • 75
  • 8
3
votes
2 answers

Qt create Link between folders

I have to build a small dialog that creates a symbolic link to a folder. In windows I would use mklink /D command. Is there a possibility to create such links in Qt? I have only seen QFile creating links between files and that they need to end with…
Richard
  • 1,543
  • 3
  • 25
  • 49
3
votes
1 answer

QProcess exits the application after calling QProcess.start()

I am using QProcess to run other programs. But when I exit my app after calling QProcess.start() it says in debug console: QProcess: Destroyed while process is still running. and the process closes. But I want to keep this process running after…
iamnp
  • 510
  • 8
  • 23
3
votes
1 answer

Adding Button and Separate Window to Python QProcess Example

I'm trying to use QProcess and read the stdout to a QTextEdit initiated by a button. How can I adapt this example to do so? Do I have to call a separate class for the QProcess? from PyQt4.QtGui import * from PyQt4.QtCore import * import…
nicholaswilde
  • 101
  • 3
  • 10
3
votes
1 answer

QProcess::setStandardOutputFile only creates 0kb File

I'm using a simple QProcess-Project on a WindowsXP-Machine: QString program = "U:\\ffmpeg.exe"; QStringList arguments; arguments << "-i" << "U:\\clock.avi" << "U:\\tmp_jpeg\\foo-%03d.jpeg"; process.setStandardOutputFile("U:\\log.txt",…
Berschi
  • 2,605
  • 8
  • 36
  • 51
3
votes
2 answers

Is it safe to use a QTemporaryFile with a QProcess?

I have to read a script from the user and call a QProcess passing that script as a file. For example, the user insert this, say, Python script import sys print(sys.copyright) and I have to put that script in a file, and call the python interpreter…
AkiRoss
  • 11,745
  • 6
  • 59
  • 86
3
votes
3 answers

get PID of QProcess with python on windows

Is there some way to read the PID of a process started with QProcess.start(...)? QProcess::pid() returns sip.voidptr and there's not much I can do with it (or I don't know how). I want to have the PID to have the possibility to make the window…
middleofdreams
  • 353
  • 3
  • 13
3
votes
1 answer

Why QProcess signal readyReadStandardOutput() emited twice?

I use QProcess and connect it's readyReadStandardOutput to slot. But after starting slot execute twice. Tell me please why is it? { myProcess = new QProcess(parent); myProcess->start("mayabatch.exe -file "+scene); connect(myProcess,…
artberry
  • 791
  • 2
  • 7
  • 18
3
votes
1 answer

How to get the next solution of a SWI-prolog query with QProcess?

I'm trying to combine SWI-prolog with QProcess. So I already can interact with prolog and send questions to it, but I always getting only the first answer. So I tried to send such characters like "n" or "r" which should give me the next answer of my…
Paul
  • 233
  • 2
  • 3
  • 14
3
votes
3 answers

running ping with Qprocess, exit code always 2 if host reachable or not

i am using Qprocess to execute ping to check for a host to be online or not... The problem is that the exit code that i recieve from the Qprocess->finished signal is always 2 no matter if i ping a reachable host or an unreachable one.. I am…
ashishsony
  • 2,537
  • 3
  • 26
  • 38
2
votes
1 answer

Auto Updater Examples

Well i've been looking how to do an auto updater on google, however no success. What i would plan is to create an updater (ANother exe called by QProcess though the principal exe) but here ihave some questions: How do i make the QProcess silent?…
Kazuma
  • 1,371
  • 6
  • 19
  • 33
2
votes
1 answer

Start QProcess on button press

I'm building an application that launches an exe file on button press with QProcess. I have multiple buttons that are created in this way: Program reads from local database the information needed to create buttons (name, exe path) Then for each…
2
votes
1 answer

Dynamically created QImage frames to ffmpeg stdin using QThread

I am trying to create video files with ffmpeg using frames dynamically created on a separate thread. While I can create those frames and store them on disk/memory, I'd like to avoid that passage since the amount/size of the frames can be high and…
musicamante
  • 41,230
  • 6
  • 33
  • 58
2
votes
0 answers

Getting Exitcode from Powershell from within C++ Program with QProcess

I wonder if someone has an Answer for this Problem. I use QProcess to start a Powershell script. The start of the QProcess is initiated from a QThread. This Thread finishes like expected but the QProcess never calls its readyReadStandardOutput()…
k_k
  • 83
  • 7
2
votes
1 answer

How to open cmd when exec jar file (qt QProcess)

I use Windows. I want to use QProcess in a running jar app (java/javaw). After starting that, open the cmd to show me information about working my jar app. My problem is: when I exec my qt code, the Java app starts (in the background), but cmd…
Evendie
  • 149
  • 6