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

Implementing a frontend for a c++ console application using QProcess

I am trying to implement GUI for a simple C++ using Qt to understand how it works. The C++ program and the GUI are in seperate projects in the same solution in VS 2015. The Qt program will call the C++ program using QProcess' start() function. The…
0
votes
2 answers

How to start a process in Windows using QT?

I'm trying to start a console application on Windows using QProcess's method 'start'. Official documentation says I can do it like this: QProcess process; process.start("C:/Windows/System32/cmd.exe"); I expect that a standard greeting message will…
0
votes
1 answer

QProcess won't emit errorOccurred on VBScript failure

I have a VBScript that converts Excel files to Tab delimited text files: format = -4158 Set objFSO = CreateObject("Scripting.FileSystemObject") src_file = objFSO.GetAbsolutePathName(Wscript.Arguments.Item(0)) dest_file =…
Dillydill123
  • 693
  • 7
  • 22
0
votes
1 answer

Qt QProcess startDetached can't end process (bash session)

I'm trying to call a shell script from a Qt GUI, but after running the script, the bash session stays open when it should finish. Having this code: QString s = "./script.sh " + argument; qint64 *pid = NULL; QProcess…
lpares12
  • 3,504
  • 4
  • 24
  • 45
0
votes
1 answer

Checking whether qprocess has finished

I have to check whether my process has finished and I need to convert it to bool because I want to you if. In MainWindow.h I have created an object QProcess *action; In mainwindow.cpp void MainWindow:: shutdown() { action=new…
0
votes
1 answer

pass arguments from Qt to a shell script file

I want to pass a string value from Qt codes to my shell script file called 'part1_4_md'. This is my codes from Qt: void MainWindow::on_pushButton_clicked() { QString path = ui->lineEdit->text(); QProcess *process = new QProcess; …
Marco
  • 141
  • 4
  • 14
0
votes
0 answers

How to make sure QProcess external launched App stays on top

I have a menu that, when toggled, starts a QProcess that lauches an external app. How to make sure that the launched upp stays on top since I can't use the QT Window flag?
alkah
  • 1
  • 2
0
votes
1 answer

QProcess start process (blender.exe) with multiple arguments

I try to start blender.exe from inside my program (FaceModifier.exe) using QProcess (on Windows). The command follows this structure: 'path-to-blender' --background 'path-to-blend-file' --python 'path-to-python-script' --…
Gunnar B.
  • 2,879
  • 2
  • 11
  • 17
0
votes
0 answers

Why do sometimes two scripts are being launched at the same time?

Explanations: I'm trying to create a daemon-script that will be watching the Watch folder and if I drop some files there - it should run the script. Problem: sometimes after I drop the file - nothing happens Script: the script is working with files…
user3027198
  • 183
  • 3
  • 11
0
votes
0 answers

QProcess launches plink.exe with batch script but killing QProcess doesn't stop PLink

I'm developing an application in Qt. First, I created a QProcess object : process = new QProcess(this); // launching plink by script process->start(plinkLauncherScriptPath, arguments); Script looks like this: @echo off echo y | "%~dp0/plink.exe"…
MyWay
  • 1,011
  • 2
  • 14
  • 35
0
votes
1 answer

How to use QProcess with a variable in it's argument?

I want to use QProcess to run a Linux command in my Qt project. My process has some arguments so I used the following code: QString _strFileName = "/root/a.o"; QStringList _strListArguments; _strListArguments << "-c" << "file " << _strFileName << "…
s.m
  • 209
  • 2
  • 7
  • 17
0
votes
1 answer

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?
user63898
  • 29,839
  • 85
  • 272
  • 514
0
votes
0 answers

Convert *.xls to *csv with C++

I'm trying to convert a xls(x) file to csv in C++ using QProcess::start() QProcess *myProcess = new QProcess(); myProcess->start("path/xls2csv.exe fileName.xlsx > fileName.csv"); There is no error message, but nothing happens. When I start the…
PlaZm0
  • 25
  • 1
  • 5
0
votes
0 answers

Use QProcess to unzip .Z file with 7z.exe, No Errors but also No output

I am using Qt 5.2.1 with MSVC 2010 on my Windows 8.1 computer. I am using QProcess to unzip a file. (Specifically a file I have downloaded from here ftp://cddis.gsfc.nasa.gov/gps/data/daily/2015/015/15n/ and the file is brdc0150.15n.Z) I am…
user1216527
  • 145
  • 1
  • 1
  • 11
0
votes
1 answer

setpriority impact on QProcess

I have a C++/Qt5 program that sets the priority of the process using setpriority(). That process launches several executable programs using QProcess. Will the programs launched by QProcess run at the NEW priority of the main process? Or does…
TSG
  • 4,242
  • 9
  • 61
  • 121