qprocess

QX11EmbedContainer and QProcess problem...

Hello folks, I've been trying to put a QX11EmbedContainer in my app, and I need to start a terminal within it (because with konsolepart I can practically do nothing). QX11EmbedContainer* container = new QX11EmbedContainer(this); // with or without "this" I got the same result container->show(); QProcess process(container); QString exec...

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

Hi, 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 continuously pinging in a QTimer to a host(whose one folder i have mounted at client where ...

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", QIODevice::Append); process.start(program, arguments); The Process works just fine, ffmpeg creates a...

What is the recommended way of passing keyboad events to QProcess transparently?

I have a GUI application, which creates a QProcess inside, catches its output and shows it on a form. I need to somehow catch key events from the form to pass them to QProcess (to make it fell as close as possible to real terminal window). So, I suppose, I should process keyReleaseEvent() and somehow transform either event.text() (which...

No output from QProcess

Why does the following print a blank line instead of 'Hello QProcess'? import sys from PyQt4 import QtGui, QtCore proc = QtCore.QProcess() proc.start("echo 'Hello QProcess'") proc.waitForFinished() result = proc.readAll() print result proc.close() I'm on Windows XP, btw. ...

No readyReadStandardOutput signal from QProcess

Why do I never get the readyReadStandardOutput signal when I run the following? import os, sys, textwrap from PyQt4 import QtGui, QtCore out_file = open("sleep_loop.py", 'w') out_file.write(textwrap.dedent(""" import time while True: print "sleeping..." time.sleep(1)""")) out_file.close() def started(): p...

How do I embed a binary executable (to be executed at runtime) in a Qt program?

I'm writing a cross-platform C++ program using Qt and I want to package/embed a number of binary executables within the program. The program should be able to execute these binaries at runtime. I figured, I would need QResource and QProcess using start() and the ":/..." notation, but I don't seem to get the process running. Is there any...

How to fetch output when calling R using Qprocess or system

Hi Experts, I would like to execute a R script simply as R --file=x.R It runs well on the command line. However when I try the system call in C++ by QProcess::execute("R --file=x.R"); or system("R --file=x.R"); the program R runs and quits but I can't see the output the program is supposed to generate. If a program uses no std...

start a process using QProcess

i'm trying to start Microsoft word using QProcess as following: QString program = "WINWORD.EXE"; process->start(program); but nothing happens... winword.exe is on path (so when i type winword.exe word is openning up) is it the right way to do so ? ...

kill process without knowing the full path using QT

i'm trying to retrieve the active processes on my computer and to search for specific one, if it exists then i should kill it. is it possible to do it without knowing the specific path of the execute ? i know the execute process name but not the full path. so in short: 1. get all active processes 2. kill specific process thanks ! ...

get all running processes info using QProcess

few days ago i asked about how to get all running processes in the system using QProcess. i found a command line that can output all processes to a file: C:\WINDOWS\system32\wbem\wmic.exe" /OUTPUT:C:\ProcessList.txt PROCESS get Caption this will create C:\ProcessList.txt file contains all running processes in the system. i wonder how c...

How can I know when QProcess wants to read input?

I'm implementing a compiler in my Compilers class, I'm using Qt & C++. After I have generated the machine code from the source code, I'm executing the virtual machine that will execute the code. I'm facing a problem here, I'm using readyRead() signal to get output from the virtual machine, but how can I know that the virtual machine wa...

Why is QProcess converting the '=' in my arguments to spaces

I've run into a weird error with a Qt program running on Windows. The program uses QProcess to spawn a child process wit two arguments. The program and arguments passed to the QProcess::start() method are of the form: "batchfile.bat" "--option1=some_value" "--option2=some_other_value\with_a\path" For some reason by the time those op...

Open an external program in Qt with an attached file extension

I am making a qt application which allows the user to select a file and then upon clicking ok, start the associated program with the file already loaded. The program I want to start is java based, and I know how to use QProcess to get it to open, I don't know however how to add the file extension which the user is selecting. Any suggesti...

printing unicode through a QProcess

I'm having some trouble handling unicode output from a QProcess. When I run the following example I get ?? instead of 中文. Can anyone tell me how to get the unicode output? from PyQt4.QtCore import * def on_ready_stdout(): byte_array = proc.readAllStandardOutput() print 'byte_array: ', byte_array print 'unicode: ', unicode...

Why is a QProgressDialog doesn't get updated after executing a QProcess?

I am using a QProgressDialog to show the status of a long running operation, which includes a step of running an external executable. I run the external executable using the QProcess::execute() method. QprogressDialog works fine updating the label text till it reaches the QProcess::execute() method, after which it doesn't update the stat...

QT Open default file explorer on *nix

I have the following: QProcess *process = new QProcess(this); QString path = QDir::toNativeSeparators(QApplication::applicationPath); #if defined(Q_OS_WIN) process->start("explorer.exe", QStringList() << path); #elif defined(Q_OS_MAC) process->start("open", QStringList() << path); #endif How I can achieve the same behavior for le...

how to print the real QProcess arguments list as the QProcess excute them

How can i see in QProcess the real argument list it is processing? for debuging , i do print the QStringList before i pass its to myProcess->start(program, arguments); is there build in debugging option? ...

How to get STDOUT from a QProcess?

I thought I was going to get the output from a QProcess using the following code: // Start the process process.start(tr("php-cgi www/test.php"),QIODevice::ReadWrite); // Wait for it to start if(!process.waitForStarted()) return 0; // Continue reading the data until EOF reached QByteArray data; while(process.waitForReadyRead()) ...