You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Kuba Orlik 84306dcca0 Simplify syntax by a lot 1 year ago
README.md Simplify syntax by a lot 1 year ago
SimpleProcess.js Simplify syntax by a lot 1 year ago
SimpleProcess.qml Simplify syntax by a lot 1 year ago
process.h Add readAllstandardoutput method 1 year ago

README.md

Inspired by http://www.xargs.com/qml/process.html

Setup

Add to project.pro:

HEADERS += \
        ../../qml-process/process.h

Add to main.cpp

#include <QtQml>
#include "../../qml-process/process.h"

// in main:
qmlRegisterType<Process>("Process", 1, 0, "Process");

also, add the SimpleProcess.qml and SimpleProcess.js files to your project.

The simplest way to use it is to call the callProcess function:

import "SimpleProcess.js" as SimpleProcess

Item {
     Component.onCompleted {
           SimpleProcess.callProcess("echo", ["Hello",  "World"], (_, stdout)=>console.log(stdout))
     }
}