Allows your app to run other applications on desktop platforms. More...
Import Statement: | import ArcGIS.AppFramework.Desktop 1.0 |
Properties
- arguments : QStringList
- bufferedStandardError : bool
- bufferedStandardOutput : bool
- createArguments : object
- environment : object
- error : ProcessError
- exitCode : int
- exitStatus : ExitStatus
- processId : qulonglong
- program : string
- state : ProcessState
- systemEnvironment : object
- workingDirectory : string
Signals
- finished()
- standardError(string error)
- standardOutput(string output)
- started()
Methods
- bool detach()
- kill()
- start(string command)
- start(string command, qstringlist arguments)
- start()
- bool startDetached()
- terminate()
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.
Name | Value |
---|---|
Process.NotRunning | 0 |
Process.Starting | 1 |
Process.Running | 2 |
ProcessError enumeration
Enum describing potential errors that can be faced by the application. Informs the error property.
Name | Value |
---|---|
Process.FailedToStart | 0 |
Process.Crashed | 1 |
Process.Timedout | 2 |
Process.ReadError | 3 |
Process.WriteError | 4 |
Process.UnknownError | 5 |
ExitStatus enumeration
Enum describing the potential ways applications can be exited. Informs the exitStatus property.
Name | Value |
---|---|
Process.NormalExit | 0 |
Process.CrashExit | 1 |
Property Documentation
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.
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.
The last error faced by this component. Informed by the ProcessError enum.
The exit status of the last application that finished. Informed by the ExitStatus enum.
Returns the native process identifier for the running application, if available. If no application is currently running, 0 is returned.
Returns the current state of the application opened by your app. Informed by the ProcessState enum.
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
Signal emitted when the application has finished.
Note: The corresponding handler is onFinished
.
Signal emitted when the application returns a standard error. Contains the standard error returned.
Note: The corresponding handler is onStandardError
.
Signal emitted when the application returns a standard output. Contains the standard output returned.
Note: The corresponding handler is onStandardOutput
.
Signal emitted when the application has started.
Note: The corresponding handler is onStarted
.
Method Documentation
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.
Starts the application set by the program property, executing the provided command.
The command parameter
The command passed to the application you're opening.
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.