ApplicationObject QML Type

The handle for an application known to the application manager. More...

Import Statement: import QtApplicationManager.SystemUI 2.0

Properties

Signals

Methods

  • bool debug(string debugWrapper, string document)
  • bool start(string document)
  • stop(bool forceKill)

Detailed Description

Each instance of this class represents a single application known to the application manager.

Most of the read-only properties map directly to values read from the application package's info.yaml file - these are documented in the Manifest Definition.

Items of this type are not creatable from QML code. Only functions and properties of ApplicationManager and ApplicationModel will return pointers to this class.

Make sure to not save references to an ApplicationObject across function calls: packages (and with that, the applications contained within) can be deinstalled at any time, invalidating your reference. In case you do need a persistent handle, use the id string.

Property Documentation

alias : bool [read-only]

This method is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This was used to distinguish between application aliases, which have been replaced by the intents mechanism.

Always returns false.


applicationProperties : object [read-only]

All user-defined properties of this application as listed in the private and protected sections of the applicationProperties field in the manifest file.


blocked : bool [read-only]

This method is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use PackageObject::version.


builtIn : bool [read-only]

This method is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use PackageObject::builtIn


capabilities : list<string> [read-only]

A list of special access rights for the application - these capabilities can later be queried and verified by the middleware via the application manager.


categories : list<string> [read-only]

A list of category names the application should be associated with. This is mainly for displaying the application within a fixed set of categories in the System UI. If the application does not specify a categories list, this will return the same as the containing PackageObject::categories.


codeDir : string [read-only]

The absolute path to the application's installation directory.


description : string [read-only]

Returns the localized description of the application - as provided in the info.yaml file - in the currently active locale.

This property uses the same algorithm as the name property, but for the description.


descriptions : var [read-only]

Returns an object with all the language code to localized description mappings as provided in the applications's info.yaml file. If the application does not specify a descriptions object, this will return the same as the containing PackageObject::descriptions.


documentUrl : string [read-only]

This was used to distinguish between application aliases, which have been replaced by the intents mechanism.

Always returns an empty string.


icon : url [read-only]

The URL of the application's icon - can be used as the source property of an Image. If the application does not specify an icon, this will return the same as the containing PackageObject::icon.


id : string [read-only]

This property returns the unique id of the application.


lastExitCode : int [read-only]

This property holds the last exit-code of the application's process in multi-process mode. On successful application shutdown, this value should normally be 0, but can be whatever the application returns from its main() function.


lastExitStatus : enumeration [read-only]

This property returns the last exit-status of the application's process in multi-process mode.

  • Am.NormalExit - The application exited normally.
  • Am.CrashExit - The application crashed.
  • Am.ForcedExit - The application was killed by the application manager, since it ignored the quit request originating from a call to ApplicationManager::stopApplication.

See also ApplicationInterface::quit and ApplicationInterface::acknowledgeQuit.


name : string [read-only]

Returns the localized name of the application - as provided in the info.yaml file - in the currently active locale.

This is a convenience property, that takes the mapping returned by the names property, and then tries to return the value for these keys if available: first the current locale's id, then en_US, then en and lastly the first available key.

If no mapping is available, this will return the id.


names : var [read-only]

Returns an object with all the language code to localized name mappings as provided in the application's info.yaml file. If the application does not specify a names object, this will return the same as the containing PackageObject::names.


nonAliased : ApplicationObject [read-only]

This method is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This was used to distinguish between application aliases, which have been replaced by the intents mechanism.

Always returns the ApplicationObject itself.


package : Package [read-only]

Returns the Package object that contains this application.


runState : enumeration [read-only]

This property holds the current run state of the application. It can be one of:

  • Am.NotRunning - the application has not been started yet.
  • Am.StartingUp - the application has been started and is initializing.
  • Am.Running - the application is running.
  • Am.ShuttingDown - the application has been stopped and is cleaning up (in multi-process mode this state is only reached, if the application is terminating gracefully).

runtime : Runtime [read-only]

Will return a valid Runtime object, if the application is currently starting, running or shutting down. May return a null object, if the application was not yet started.


runtimeName : string [read-only]

This property holds the name of the runtime, necessary to run the application's code.


runtimeParameters : object [read-only]

This property holds a QVariantMap that is passed onto, and interpreted by the application's runtime.


state : enumeration [read-only]

This method is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use PackageObject::state.


supportedMimeTypes : list<string> [read-only]

An array of MIME types the application can handle.


version : string [read-only]

This method is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Use PackageObject::version.


Signal Documentation

activated()

This signal is emitted when the application is started or when it's already running but has been requested to be brought to foreground or raised.

Note: The corresponding handler is onActivated.


Method Documentation

bool debug(string debugWrapper, string document)

Same as start() with the difference that it is started via the given debugWrapper. The optional argument document will be supplied to the application as is - most commonly this is used to refer to a document to display.

Please see the Debugging page for more information on how to setup and use these debug-wrappers.

Returns a bool value indicating success. See the full documentation at ApplicationManager::debugApplication for more information.


bool start(string document)

Starts the application. The optional argument document will be supplied to the application as is - most commonly this is used to refer to a document to display.

Returns a bool value indicating success. See the full documentation at ApplicationManager::startApplication for more information.


stop(bool forceKill)

Stops the application. The meaning of the forceKill parameter is runtime dependent, but in general you should always try to stop an application with forceKill set to false first in order to allow a clean shutdown. Use forceKill set to true only as a last resort to kill hanging applications.

QML applications and native applications that support the ApplicationInterface will be notified via ApplicationInterface::quit(). All other applications will be sent the Unix TERM signal.

See also ApplicationManager::stopApplication.


© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.