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

How can I create a process in C++ or Qt?

hello people a need your help, can be with qt or c++, i want to create a process BUT a process that use a function of my program not an external program, something like this .... sorry for the example and forgive my english thanks void…
0
votes
0 answers

Moving worker children to the QThread -> QObject: Cannot create children for a parent that is in a different thread

I have a QProcess handler class (processHandler) that is called inside my GUI class as follows: this->thread = std::make_shared(); this->proc =…
QuestionMark
  • 412
  • 1
  • 4
  • 16
0
votes
1 answer

GUI Freezes using QProcess during data acquisition

PROBLEM DEFINITION: I have an external application called runSensor that communicates with a sensor. The sensor sends its data over UDP. Using the terminal, runSensor has two arguments to communicate with the sensor for data acquisition:start and…
0
votes
1 answer

PyQt4: QProcess readyRead does not always emit correctly

When I use pyqt to run a program I cannot get the output correctly every time. Here is an example: from PyQt4 import QtCore, QtGui import sys class MainWindow(QtGui.QMainWindow): def __init__(self): QtGui.QWidget.__init__(self) …
u09
  • 449
  • 1
  • 3
  • 11
0
votes
1 answer

Communicating with QProcess Python program

I'm trying to get a Qt application to communicate with a python program. The most logical solution seemed to be to run a QProcess in the Qt app containing the Python code. I want to send commands using std input and if applicable read via the std…
0
votes
1 answer

Why can't I pass arguments with QProcess when launching blender?

Trying to run this code in the main function of a console app in QT but it only starts up the Blender GUI. These arguments should be starting a background render. I tested the arguments to be correct and they work fine on CMD. This seems to be a…
0
votes
0 answers

Getting confusing error when using Qprocess.start(programname, ListofStringArguments) Need some clarity

Some odd reaction with PyQt5.8 on windows 10. I'm making this because I want to try to understand why I get this problem, as it's easily solved. (Shown below) I try to do: Command =''' testurl -x --audio-format "mp3" --audio-quality…
Thomasedv
  • 382
  • 4
  • 22
0
votes
1 answer

get pid of finished QProcess

I'm trying to get the PID of a finished QProcess, something like this: proc = QProcess.start() proc.finished.connect(self.finished) def finished(self): self.sender().pid() QProcess.pid() will return 0 if the process is closed however, and…
Spencer
  • 1,931
  • 1
  • 21
  • 44
0
votes
0 answers

How to Plot from QProcess output in qt

I have C Program , I want to display output from this program in Textbrowser in mainwindow and plot in a widget . #include void main() { int i,j; while(1) { for(i=0;i<6;i++) { printf("%d\n",i); if(i==5) { for(j=i-1;j>0;j--) …
0
votes
1 answer

Custom QProcess object to wait for output before returning

note: the title does not convey the question exactly, feel free to edit as is necessary Info on classes and descriptions Problem Code examples, etc TL;DR 1. Info: I have created a custom QProcess class called m_Proc. #include "misc_serv" using…
CybeX
  • 2,060
  • 3
  • 48
  • 115
0
votes
1 answer

Determine if QProcess has finished executing or is awaiting user input (or response)

I have 2 bash scripts One script not requiring user input, it displays info The other requires some user input, and displays some info too Problem: When creating a QProcess, I am unable to differentiate if the QProcess is finished or is hanging…
CybeX
  • 2,060
  • 3
  • 48
  • 115
0
votes
1 answer

Qt code to display the output of a shell script dynamically on TextBrowser

I have a script which echos "Hello world" 5 times on the console with an interval on 1 sec. When i use the same script in Qt, the behavior is not the same. QProcess *process = new QProcess; //Step1 - create a new process process->start("/bin/sh",…
Learner
  • 67
  • 7
0
votes
1 answer

How to launch and terminate a python script from a QT GUI app created in QT Creator 4.2.0

I've created a simple app in QT Creator 4.2.0, i.e., QT Widgets Application, used all defaults. Added one button. I've tried to mimic multiple posts I've found around web, but can not get a python script to launch correctly. I keep getting this…
hokiebird
  • 280
  • 1
  • 5
  • 15
0
votes
1 answer

launching script within gui with qprocess works in 3.4 not 2.7 hanging on raw_input?

I did all of the developing of a gui application in the anaconda IDE and in python 3.4 and using a simple test script I thought it was working well within 3.4 displaying output in realtime and waiting for input. The end goal of the application was…
kaminsknator
  • 1,135
  • 3
  • 15
  • 26
0
votes
1 answer

Error in processing command in QProcess

I am trying to execute following command and trying to get the output however I am getting output as null. QProcess process; process.start("cmd /c \"ipconfig\""); process.waitForFinished(-1); QByteArray out = process.readAll(); …
sk110
  • 77
  • 2
  • 9