Useful Java System Properties for QtJambi
Following system properties are accepted by QtJambi.
You can specify Java system properties as start argument -Dproperty=value
or in Java code System.setProperty("property", "value")
.
Logging
io.qt.log-messages
- By specifying any combination ofALL
,CRITICAL
,DEBUG
,WARNING
,FATAL
,INFO
andSYSTEM
you can install a message handler forwarding messages of given types to Java logging. In combination with this use following properties to define logging levels. All specified values have to be parsable byLevel.parse(String)
:io.qt.log.debug.level
- Specify level value to define the log level forQtDebugMsg
(defaults toFINEST
)io.qt.log.critical.level
- Specify level value to define the log level forQtCriticalMsg
(defaults toSEVERE
)io.qt.log.fatal.level
- Specify level value to define the log level forQtFatalMsg
(defaults toSEVERE
)io.qt.log.info.level
- Specify level value to define the log level forQtInfoMsg
(defaults toINFO
)io.qt.log.warning.level
- Specify level value to define the log level forQtWarningMsg
(defaults toWARNING
)
io.qt.exceptions-for-messages
- By specifying any combination ofALL
,CRITICAL
,DEBUG
,WARNING
,FATAL
,INFO
andSYSTEM
you can install a message handler causing exceptions to be thrown in the event of a message of given type.
Runtime Diagnostics
io.qt.enable-event-logs
- Specifytrue
to activate logging of all handled events with their receivers.io.qt.enable-method-logs
- Specifytrue
to activate method logging. Caution! This highly decreases performance especially in combination withio.qt.log-messages
or custom message handlers.io.qt.enable-cleanup-logs
- Specifytrue
to log native object cleanup after GC.io.qt.enable-metaobject-logs
- Specifytrue
to log metaobject analysis results.io.qt.enable-dangling-pointer-check
- Specifytrue
to activate dangling pointer checks.io.qt.enable-signal-argument-check
- Specifytrue
to activate signal argument checks where applicable.io.qt.enable-signal-emit-thread-check
- Specifytrue
to activate thread checks on signal emits. If a signal is emitted from a foreign thread a warning is given. Install custom handler withQtUtilities.installSignalEmitThreadCheckHandler
to change this behavior.io.qt.enable-concurrent-container-modification-check
- Specifytrue
to activate concurrent modification checks during container iteration.io.qt.enable-thread-affinity-check
- Specifytrue
to activate thread affinity checks when calling certain thread-affine methods.io.qt.enable-event-thread-affinity-check
- ...the same applying to access checks during event handling.io.qt.disable-thread-affinity-check
- check is disabled by default since QtJambi 6.5.1.io.qt.disable-event-thread-affinity-check
- check is disabled by default since QtJambi 6.5.1.
Library Management
io.qt.library-path-override
- Use this property if you want to force Java to load Qt and QtJambi libraries from other paths than given byjava.library.path
.io.qt.debug
- Specifydebug
to force Java using debug libraries of Qt and QtJambi.io.qt.pluginpath
- Specify list of paths added as plugin search path.
If you don't specify QtJambi's native location in library path QtJambi will extract libraries from native bundles to temporary directory each time at program startup. Typically, it is a process specific directory purged at program termination. This behavior can be adapted with following properties:
io.qt.deploymentdir
- Specifytemp
to let QtJambi extract libraries to temporary directory (default),user
for user's application data directory andcommon
for common program data directory. Specify a target directory (io.qt.deploymentdir=<path>
) to let them be extracted at the specified location.io.qt.keep-temp-deployment
- Specifytrue
to avoid library deletion at program termination. The libraries remain in temporary directory instead.io.qt.no-native-deployment
- Specifytrue
if you want to inhibit the search for native library bundles at all and load QtJambi from library path instead.
Library extraction only takes place if QtJambi does not detect the required libraries elsewhere (e.g. in io.qt.library-path-override
, java.library.path
or system's library path).
Debugging
When using a native debugger to debug your application you need to provide debuginfo along with the native Qtjambi libraries.
This information is available in specific bundles corresponding to native bundles. QtJambi will extract the debug info files if you enable it with io.qt.provide-debuginfo=true
.
The extraction behavior can be adapted by following properties:
io.qt.provide-debuginfo
- Specifytrue
to let QtJambi extract debuginfo files.
Along with debuginfo files, source code files could be extracted. However, this is not done unless you specify a target sources directory:
io.qt.sourcesdir
- Specifytemp
to let QtJambi extract source code files to temporary directory,user
for user's application data directory andcommon
for common program data directory. Specify a target directory (io.qt.sourcesdir=<path>
) to let them be extracted at the specified location.
Development
For development purpose it is possible to let QtJambi extract header files from native bundles.
io.qt.headersdir
- Specifyuser
to let QtJambi extract header files to user's application data directory. Specifycommon
to let them be extracted to common program data directory. Specify a target directory to let them be extracted there.
QtJambi Runtime
io.qt.allow-nonfinal-signals
- Specifytrue
to avoid exception to be thrown when detecting non-final signal declarations.io.qt.allow-nonfinal-qproperties
- Specifytrue
to avoid exception to be thrown when detecting non-final QProperty declarations.io.qt.no-library-shutdown-hook
- Specifytrue
to avoid library shutdown at program termination.io.qt.no-app-deletion
- Specifytrue
if you combine native code with Java code and yourQCoreApplication
instance has been created elsewhere than inside Java.io.qt.no-exception-forwarding-from-meta-calls
- Specifytrue
to avoidQMetaObject
calls (like method invocation and property access) forwarding exceptions to the Qt caller in any case (it is avoided by default in case of Qml-related QObjects).io.qt.no-exception-forwarding-from-virtual-calls
- Specifytrue
to avoid virtual calls (i.e. Java overrides) forwarding exceptions to the Qt caller in any case.io.qt.avoid-jni-global-references
- Specifytrue
to avoid using JNI global references. Instead, QtJambi will use a JavaHashMap
to manage references. (default on Android)io.qt.use-jni-global-references
- Only on Android: Specifytrue
to let QtJambi use JNI global references instead ofHashMap
to manage references.io.qt.disable-thread-purger
- Specifytrue
to not starting a watcher thread for purging Java-related thread data.io.qt.no-classpath-to-resourcepath
- Specifytrue
to not adding Java classpath to Qt resource path. You may neeed to do this manually by usingQResource.addClassPath
.io.qt.no-directories-to-resourcepath
- Specifytrue
to not adding Java classpath directories to Qt resource path (jar files only). This has no effect onQResource.addClassPath
.
QML
io.qt.enable-qml-debugging
- Specifytrue
to allow QML debugging for the entire runtime of the application.io.qt.enabled-qml-debugging
- Specifytrue
to allow QML debugging for the entire runtime of the application.io.qt.enable-qml-debugging-nowarn
- ...also inhibits a security warning.io.qt.enabled-qml-debugging-nowarn
- ...also inhibits a security warning.
Along with this use program argument -qmljsdebugger=...
to enable QML debugging for Qt.
Experimental Features
io.qt.experimental.fast-jni
- Specifytrue
to enable improved gathering of JNI environment during native callsio.qt.experimental.fast-jni-for-overrides
- Specifytrue
to enable improved gathering of JNI environment during native virtual calls
Following properties deal with the improvement of item model performance:
io.qt.experimental.item-model-cached-virtuals
- Specifytrue
to cache the return values of item model'srowCount()
andcolumnCount()
to improve performance of item views.io.qt.experimental.enable-invalid-modelindex-singleton
- Specifytrue
to use one single Java object to represent invalidQModelIndex
instead of copies.io.qt.experimental.enable-ephemeral-modelindexes
- Specifytrue
to call virtual Java methods with an alias for QModelIndex arguments instead of submitting a copies. These alias objects are invalidated after use.