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

cannot use class QProcess in qt on windows 7

I just used QProcess to execute a exe file in qt on windows XP. It works normally, while not on windows 7. I think it's obviously because of the UAC issue on windows 7(or windows VISTA). Does anyone can help me to solve this problem please? Thanks…
0
votes
1 answer

How to start application(path with space) using QProcess on mac OSX?

It goes well when using QProcess to start a program if its path without space. eg: QProcess app; app.startDetached("open /Users/test/Desktop/MyTest/Hello.app"); But, it doesn't work if the program path containing spaces. eg: QProcess…
winter
  • 43
  • 2
  • 6
0
votes
1 answer

Qt QProcess Complains about QThread::Start , Thread Creation Error

I have an extremely simple app that is supposed to use QProcess to do some systemd control. Then entire program is below. Every time I run the app, it complains with the following: QThread::start: Thread creation error: Resource temporarily…
PhilBot
  • 748
  • 18
  • 85
  • 173
0
votes
1 answer

QProcess call write function failure

I need call QProcess to start up xterm ,after that I should send some data to it . why those code can't run correctly? QProcess…
tangbongbong
  • 195
  • 2
  • 6
0
votes
1 answer

Can't read from stdin in process spawned via QProcess::execute

Example code int main(int, char * argv[]) { QString input = QTextStream(stdin).readLine(); QTextStream(stdout) << input << "\nWe need to go deeper...\n"; return QProcess::execute(argv[0]); } Test run ./test level 1 level 1 We…
bitfield
  • 83
  • 5
0
votes
1 answer

QProcess won't start the requested

I have been trying to get QProcess to start up an application. But I am facing a few problems in doing so. Here's my code: void QOpenApp::open_now() { QString program = "/usr/lib/qt4/examples/widgets/analogclock"; QStringList arguments; …
0
votes
1 answer

QProcess::waitForReadyRead for stderr?

Does QProcess::waitForReadyRead return when there is data in the process's stderr, or does it wait only on stdout? How can I wait for data on stderr without using signals and slots?
sashoalm
  • 75,001
  • 122
  • 434
  • 781
0
votes
2 answers

How to run one qt application from another qt application

I have one Qt application (App1). I want to run App1 from another qt application (App2). I have tried using QProcess but App1 doesnt run. Kindly help me out. I am working on RHEL 6. QProcess process = new QProcess(); QString program =…
Abhishek
  • 338
  • 5
  • 20
0
votes
1 answer

Run a program from Qt

I am working with Qt in Linux. I need to run the "evince" pdf reader from Qt. I have been searching and as I understand I can use Qprocess to make it work. Something like this: QStringList args; args.append("/home/user/presentacion0.pdf"); …
Hermandroid
  • 2,120
  • 4
  • 29
  • 35
0
votes
1 answer

QProcess.readAllStandardOutput() doesn't seem to read anything - PyQt

Here is the code sample: class RunGui (QtGui.QMainWindow) def __init__(self, parent=None): ... QtCore.Qobject.connect(self.ui.actionNew, QtCore.SIGNAL("triggered()"), self.new_select) ... def…
Eugene Sajine
  • 8,104
  • 3
  • 23
  • 28
0
votes
1 answer

Using 1 instance of QProcess in several classes (PyQt)

I have a a Main window wrapper class (Say A) and another class used in the wrapper (say B). B has a method that in turn HAD a subrocess.check_call(command) call. I'm changing it to use QProcess in order to be able to communicate with this process…
Eugene Sajine
  • 8,104
  • 3
  • 23
  • 28
0
votes
1 answer

QProcess: Make the process independent & issues with Windows

Well, i have a QProcess that works as my program updater, but on Windows you CAN'T modify exe files when they're running, but if you close the program that created the Updater process i suppose that the Updater closes too. It's possible to make the…
Blastcore
  • 360
  • 7
  • 19
0
votes
3 answers

How to call an app that expects stdin input from QtGui?

I'm using Ubuntu and Qt Creator 4 I have a .cpp program in the executable form (say abc.out) that I wish to run when I press a button. It contains a number of cin and cout, so I want it to run on a "terminal" (on Ubuntu) so that I am able to input…
user1484717
  • 877
  • 3
  • 9
  • 11
0
votes
1 answer

Starting QProcess from QThread

I was using QThreads in Qt where my need is to launch a command-line executable from within a Qt thread and run the same within the thread's context. I have used the below mentioned code for the same which seems to be running fine. However, I…
Saurabh Gandhi
  • 351
  • 5
  • 21
0
votes
1 answer

Cannot get file output using QProcess in python

I need to: 1. Capture the output of a process in a log file, but 2. Do it detached, since the program can take hours, (or days). Apparently, if you use QProcess.startDetached(command), you lose your StandardOutput, so that launchApp =…
Paul Nelson
  • 1,291
  • 4
  • 13
  • 20