I am making a QT mobile app (Sailfish Os, it's made with Linux) and I need to run some processes with commands which could be run only with command line/terminal. Can I do this using QT/C++ code or I am talking about something impossible? :)
Asked
Active
Viewed 254 times
0
-
2Related: [https://stackoverflow.com/questions/17344807/read-qprocess-output-to-string](https://stackoverflow.com/questions/17344807/read-qprocess-output-to-string) – drescherjm Dec 17 '20 at 14:36
-
2have a look at [`QProcess`](https://doc.qt.io/qt-5/qprocess.html). – G.M. Dec 17 '20 at 14:37
1 Answers
0
Yes it's possible, you can run Linux commands in Qt app by using QProcess. This is a small example:
QProcess *system_command = new QProcess();
system_command->start("/bin/bash");
system_command->waitForFinished(500);
system_command->write("ls -a\n");

Farshid616
- 1,404
- 1
- 14
- 26
-
-
1(sorry for the off) About [this](https://stackoverflow.com/review/suggested-edits/27887342): the probability of the acceptance of your edit suggestions could be hugely improved if you read and keep [this](https://meta.stackoverflow.com/questions/291362/advice-for-non-native-english-speakers/291370#291370). – peterh Dec 19 '20 at 19:16