import QtQuick 1.0 import org.hildon.components 1.0 Page { id: root title: qsTr("Process page") Process { id: process processEnvironment: { "PATH": "/usr/bin:/usr/local/bin", "USER": "stuart" } workingDirectory: "/home/stuart/Development/QtProjects" onError: resultLabel.text = "<font color='red'>" + qsTr("Error") + "</font>" onFinished: resultLabel.text = process.readAllStandardOutput() } Column { id: column spacing: 10 anchors { left: parent.left right: parent.right top: parent.top margins: platformStyle.paddingNormal } Label { text: qsTr("Working directory") + ": " + process.workingDirectory } Label { text: "PATH: " + process.processEnvironment.PATH + ", USER: " + process.processEnvironment.USER } Label { text: qsTr("Command") + ":" } Row { spacing: platformStyle.paddingNormal TextField { id: commandEdit width: 300 text: "echo hello world" onTextChanged: process.command = text } Button { id: startButton text: qsTr("Start") enabled: process.state === Processes.NotRunning onClicked: process.start() } Button { id: stopButton text: qsTr("Cancel") enabled: process.state === Processes.Running onClicked: process.terminate() } } Label { text: qsTr("Result") + ":" } } Flickable { id: flicker anchors { top: column.bottom left: parent.left right: parent.right bottom: parent.bottom margins: platformStyle.paddingNormal } clip: true contentHeight: resultLabel.height + platformStyle.paddingNormal Label { id: resultLabel width: parent.width wrapMode: Text.WordWrap color: "green" } } ScrollDecorator { flickableItem: flicker } }