Application
Description
The Application object is the root object for all other objects and represents the application instance. It provides properties for global settings such as country, language, timeZone and measurementSystem. The application also has meta data properties such as name, description and version.
- › Inherits:
Overview
Properties
Methods
Signals
Enumerations
Properties
commandLineArguments
This property holds the arguments passed to the application when run manually at the command line. This can be used to implement simple CLI applications, e.g. for testing purposes.
This property was introduced in InCore 1.1.
- › Type:
StringList
- › Signal:
commandLineArgumentsChanged()
- › Attributes:
Readonly
country
This property holds the country the application is configured for. This information is used for localization purposes and influences how numbers and dates are formatted.
- › Type:
- › Default:
- › Signal:
countryChanged()
- › Attributes:
Writable
customCaCertificates
This property holds a list of paths to custom CA certificate files which to use in addition to the list of default CAs installed provided by the operating system. Use this if you have to establish encrypted network connections to services which use SSL/TLS certificates generated by an internal CA. Important: all certificate files have to be in PEM format.
This property was introduced in InCore 2.5.
- › Type:
StringList
- › Signal:
customCaCertificatesChanged()
- › Attributes:
Writable
debug
This property holds whether to log internal debug messages to the console. When enabled additionally all errors occurring in any object are logged to the console automatically.
- › Type:
Boolean
- › Default:
false- › Signal:
debugChanged()
- › Attributes:
Writable, Optional
description
This property holds a description for the application. It currently does not serve any special purposes but can be used to document and describe the application in a program-accessible manner.
- › Type:
String
- › Signal:
descriptionChanged()
- › Attributes:
Writable, Optional
language
This property holds the language the application is configured for. Changing this property from Application.English to a different language may - depending on the current translation and language support state - make the individual InCore objects return translated messages and error strings.
- › Type:
- › Default:
- › Signal:
languageChanged()
- › Attributes:
Writable
measurementSystem
This property holds the measurement system the application is configured for. Objects derived from the Measurement object may depend on this setting and return values converted for the appropriate measurement system. For example a temperature object could provide the formatted temperature in the Measurement.displayString property. It is converted to °F if measurementSystem is set to Measurement.ImperialUSSystem.
- › Type:
- › Default:
- › Signal:
measurementSystemChanged()
- › Attributes:
Writable
messageLoggingFilterRules
This property holds rules for filtering log messages based on their respective logging category. To disable all debug messages but e.g. networking-related ones, set this property to *.debug=false
foundation.network=true. The logging categories of a message can be found at the beginning of a message per default. It can be changed through the messageLoggingPattern property.
This property was introduced in InCore 2.0.
- › Type:
String
- › Signal:
messageLoggingFilterRulesChanged()
- › Attributes:
Writable, Optional
messageLoggingPattern
This property holds a pattern including placeholders which can be used for customizing the log message format and content. See the Qt documentation on message patterns for details and all supported placeholders.
This property was introduced in InCore 2.0.
- › Type:
String
- › Default:
%{if-category}%{category}.%{type}: %{endif}%{message}- › Signal:
messageLoggingPatternChanged()
- › Attributes:
Writable, Optional
name
This property holds the name of the application. This property is used to determine settings and storage paths and should therefore consist of alphanumeric characters only.
- › Type:
String
- › Default:
Default App- › Signal:
nameChanged()
- › Attributes:
Writable
processEnvironment
This property holds the environment variables for the current process set by the system.
This property was introduced in InCore 2.5.
- › Type:
Map
- › Signal:
processEnvironmentChanged()
- › Attributes:
Readonly
standardInput
This property holds the standard input channel for the current process.
This property was introduced in InCore 2.5.
- › Type:
- › Signal:
standardInputChanged()
- › Attributes:
Readonly
system
This property holds a global instance of a System object. It’s available for convenience so that no separate instances have to be defined manually.
- › Type:
- › Signal:
systemChanged()
- › Attributes:
Readonly
timeZone
This property holds the timezone for the location at which the application or device is running. Setting this property affects all DateTime objects which do not have the DateTime.timezone property set explicitely.
- › Type:
String
- › Default:
UTC- › Signal:
timeZoneChanged()
- › Attributes:
Writable
trace
This property holds whether to log internal trace messages to the console. This allows analysing internal function call sequences more closely.
- › Type:
Boolean
- › Default:
false- › Signal:
traceChanged()
- › Attributes:
Writable, Optional
translate
This property holds whether to load a translation file based on the language setting. When enabled, the file <TWO-LETTER-ISO-639-LANGUAGE-CODE>.qm is loaded from the application directory.
This property was introduced in InCore 2.4.
- › Type:
Boolean
- › Default:
false- › Signal:
translateChanged()
- › Attributes:
Writable
translators
This property holds a list of Translator objects which to load translation data from.
This property was introduced in InCore 2.8.
- › Type:
- › Signal:
translatorsChanged()
- › Attributes:
Readonly
trapErrors
This property holds whether to immediately exit the application on any occurring error. This can ease debugging in case a huge number of messages are printed to the console during runtime.
This property was introduced in InCore 2.5.
- › Type:
Boolean
- › Default:
false- › Signal:
trapErrorsChanged()
- › Attributes:
Writable
url
This property holds a URL of the application or the application vendor. It currently is not evaluated within the InCore framework.
- › Type:
String
- › Default:
https://inhub.de- › Signal:
urlChanged()
- › Attributes:
Writable, Optional
vendor
This property holds the name of the application vendor. It may be formatted arbitrarily and currently is not evaluated within the InCore framework.
- › Type:
String
- › Default:
in.hub GmbH- › Signal:
vendorChanged()
- › Attributes:
Writable, Optional
version
This property holds a version string for the application. It may be formatted arbitrarily and currently is not evaluated within the InCore framework.
- › Type:
String
- › Signal:
versionChanged()
- › Attributes:
Writable, Optional
Methods
dumpInternalBacktrace()
This method dumps an internal function call backtrace to the console. Except for troubleshooting in contact with the InCore developers you’ll never need to call this function.
dumpStackTrace()
This method dumps a QML function call stack trace to the console which can be used for debugging purposes.
This method was introduced in InCore 2.5.
Signals
translatorsDataChanged(SignedInteger index)
This signal is emitted whenever the List.dataChanged() signal is emitted, i.e. the item at index in the translators list itself emitted the dataChanged() signal.
Enumerations
Country
This enumeration is used to specify a country.
Name |
Value |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Language
This enumeration is used to specify a language.
Name |
Value |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
import InCore.Foundation 2.5
Application {
id: app
// populate metadata
name: "example"
version: "1.2.3"
description: "Simple application example"
url: "https://incore.readthedocs.io"
vendor: "in.hub GmbH"
// global settings
country: Application.Germany
language: Application.German
timeZone: "Europe/Berlin"
// print message when finished loading
onCompleted: console.log("Example app ready")
}