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

QProcess 6 arguments not working

i am using QProcess in order to connect to a wifi network. But when i try the code with 6 arguments, it fails, no output is returned. If i execute the command in the terminal, it works out of the box: nmcli dev wifi con "myssid" password…
walolinux
  • 531
  • 1
  • 6
  • 20
0
votes
1 answer

qprocess get shell like behaviour

I am using QT in a windows (do not know if that matters) application and want to start some process from my application using QProcess. (actually through a qtscript wrapper that uses QProcess) This seems to work but i have problems when using more…
vlad_tepesch
  • 6,681
  • 1
  • 38
  • 80
0
votes
0 answers

QProcess received sigpipe signal

I have this piece of code which use QProcess to grep output of some Linux command. Like this: QString Info::getUsedHddSize(){ QProcess hddUsedProcess; hddUsedProcess.start("bash"); hddUsedProcess.waitForStarted(1000); …
Tiana987642
  • 696
  • 2
  • 10
  • 28
0
votes
1 answer

QProcess: not receiving finished() signal running Powershell script

I am developing a Qt application that, among other things, converts an Excel spreadsheet in a text delimited with tab file. This is done by running a Windows Powershell script. My problem is that the finished() signal from the QProcess is never…
Laura
  • 193
  • 12
0
votes
1 answer

Call matlab function from Qt using QProcess

I need to call Matlab function from Qt. I know that there are standard way to do it via Engine, but I was not able to connect .lib libraries (I think because I use Mingw compiler). So, as I understand QProcess is the only way to do it. I have…
lnk
  • 593
  • 2
  • 11
  • 27
0
votes
0 answers

Qprocess issue argument is empty but passed current directory

I'm running QProcess from my GUI application (for example "gedit"), but when agruments is empty then argument passed the current directory. QString program = "gedit"; QStringList arguments; arguments << text(); // it's QLIneEdit…
0
votes
2 answers

Qt: How to close application after starting a new process?

I am starting a new process from my application using QProcess::startDetached(). After this new process is started, I want my application to exit. How do I do that?
user2653062
  • 697
  • 1
  • 9
  • 16
0
votes
1 answer

Pressing qpushbutton when qprocessevent waitforfinished

I need to run an external application by pressing a button and freeze the main application. Using the below code when the main application is freezed the button on it seems to enqueue the event (or the main application). When the main application…
SNC
  • 59
  • 2
  • 15
0
votes
0 answers

PyQt QProcess started twice & QProcess: Destroyed while process is still running error

I'm trying to get some pyqt thread pools and process working but have run into a few issues and was wondering if anyone could help. I've simplified the code down and have included it here. When you run the following it seems the started() method…
Tim
  • 1
0
votes
1 answer

Starting/Stoping an application parlally from Unix application

I want to use Qprocess to start other applications from linux c++ application. I want to start and stop another application from my application. How to link Qprocess to my build. Which .so files are required.
nayab
  • 2,332
  • 1
  • 20
  • 34
0
votes
1 answer

how to determine if a main window of detached process is visible or not

I have a tool to run main application - both are QApplications. in the tool I start main app as QProcess::startDetached("myapp.exe", QStringList() << "-arg1" << "-arg2", "C:/myFolder/"); then the tool finishes its work and the main app is still…
Illia Levandovskyi
  • 1,228
  • 1
  • 11
  • 20
0
votes
1 answer

QProcess "\n\r" in git bash.exe does not work?

I am trying to run under QProcess the bash.exe from git. I've checked if the process is running and if the file exists and confirmed these but when trying to write to process a command and after that have "\n\r" it doesn't do anything. Sample…
andreihondrari
  • 5,743
  • 5
  • 30
  • 59
0
votes
0 answers

How to send "Ctrl+Q" event to other app when use QProcess launch it?

I have a app A. In A, have two button : Open and CLose. When I click Open button, it show other App - for example, name :B. When I click Close button, my app send "CTRL+Q" event to close B app. I write code by Qt and VS2010. I use QProcess to…
0
votes
1 answer

running pnputil (or other windows built-in) from qt, as administrator

How to run pnputil from within a Qt C++ application? The following fails with lstderr showing "pnputil is not recognized as an internal or external command." Presumably because pnputil is a built-in (substituting a non-built-in does work). QProcess…
rwhenderson
  • 84
  • 1
  • 6
0
votes
1 answer

Writing to the terminal using Qt

I needed to execute terminal commands by giving input to the terminal through Qt. Also I want to read the output. I found one solution that works on windows (QProcess problems, output of process). Here is the code: #include…
ishan3243
  • 1,870
  • 4
  • 30
  • 49