ArcGIS for Developers

Process QML Type

Allows your app to run other applications on desktop platforms. More...

Import Statement: import ArcGIS.AppFramework.Desktop 1.0

Properties

Signals

Methods

Detailed Description

The Process component provides tools to allow your app to run other applications on desktop platforms. This component is only supported on Windows, macOS, and Linux.

The following code sample passes a new environment variable to a new application; in this case, a Windows Command Prompt. Be aware that because of the application being opened, this sample will only function on Windows.

Process {
    id: process
    Component.onCompleted: {
        AppFramework.environment.setValue("PASSWORD", "secret!");
        process.start("C:\\Windows\\System32\\cmd.exe", [ "/c start cmd.exe /k set "] );
        process.detach();
    }
}

Enumerations

ProcessState enumeration

Enum describing the potential states of an application. Informs the state property.

NameValue
Process.NotRunning0
Process.Starting1
Process.Running2

ProcessError enumeration

Enum describing potential errors that can be faced by the application. Informs the error property.

NameValue
Process.FailedToStart0
Process.Crashed1
Process.Timedout2
Process.ReadError3
Process.WriteError4
Process.UnknownError5

ExitStatus enumeration

Enum describing the potential ways applications can be exited. Informs the exitStatus property.

NameValue
Process.NormalExit0
Process.CrashExit1

Property Documentation

arguments : QStringList

The command line arguments that the application is going to open with.


bufferedStandardError : bool

If set to true, the standard error will be buffered, and provided one line at a time. If this property is not provided, defaults to false.


bufferedStandardOutput : bool

If set to true, the standard output will be buffered, and provided one line at a time. If this property is not provided, defaults to false.


[read-only] error : ProcessError

The last error faced by this component. Informed by the ProcessError enum.


[read-only] exitCode : int

The exit code of the last application that finished.


[read-only] exitStatus : ExitStatus

The exit status of the last application that finished. Informed by the ExitStatus enum.


[read-only] processId : qulonglong

Returns the native process identifier for the running application, if available. If no application is currently running, 0 is returned.


program : string

The application that was last opened.


[read-only] state : ProcessState

Returns the current state of the application opened by your app. Informed by the ProcessState enum.


workingDirectory : string

The working directory that this component will enter before the application has started. If this property is not provided, your app's current working directory will be used instead.


Signal Documentation

finished()

Signal emitted when the application has finished.


standardError( string error)

Signal emitted when the application returns a standard error. Contains the standard error returned.


standardOutput( string output)

Signal emitted when the application returns a standard output. Contains the standard output returned.


started()

Signal emitted when the application has started.


Method Documentation

bool detach()

Detaches the application from your app, allowing it to operate independently. If the application is not detached, closing your app will also close the application opened through this component.


start(command)

Starts the application set by the program property, executing the provided command.

The command parameter

The command passed to the application you're opening.


start(command, qstringlist arguments)

Starts the application set by the program property, applying the given command line arguments and executing the provided command.

The command parameter

The command passed to the application you're opening.

The arguments parameter

The list of command line arguments to apply to the application you intend to open.


start()

Starts the application set by the program property.