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,INFOandSYSTEMyou 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,INFOandSYSTEMyou 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- Specifytrueto activate logging of all handled events with their receivers.io.qt.enable-method-logs- Specifytrueto activate method logging. Caution! This highly decreases performance especially in combination withio.qt.log-messagesor custom message handlers.io.qt.enable-cleanup-logs- Specifytrueto log native object cleanup after GC.io.qt.enable-metaobject-logs- Specifytrueto log metaobject analysis results.io.qt.enable-dangling-pointer-check- Specifytrueto activate dangling pointer checks.io.qt.enable-signal-argument-check- Specifytrueto activate signal argument checks where applicable.io.qt.enable-signal-emit-thread-check- Specifytrueto activate thread checks on signal emits. If a signal is emitted from a foreign thread a warning is given. Install custom handler withQtUtilities.installSignalEmitThreadCheckHandlerto change this behavior.io.qt.enable-concurrent-container-modification-check- Specifytrueto activate concurrent modification checks during container iteration.io.qt.enable-thread-affinity-check- Specifytrueto 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- Specifydebugto 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- Specifytempto let QtJambi extract libraries to temporary directory (default),userfor user's application data directory andcommonfor 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- Specifytrueto avoid library deletion at program termination. The libraries remain in temporary directory instead.io.qt.no-native-deployment- Specifytrueif 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- Specifytrueto 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- Specifytempto let QtJambi extract source code files to temporary directory,userfor user's application data directory andcommonfor 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- Specifyuserto let QtJambi extract header files to user's application data directory. Specifycommonto 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- Specifytrueto avoid exception to be thrown when detecting non-final signal declarations.io.qt.allow-nonfinal-qproperties- Specifytrueto avoid exception to be thrown when detecting non-final QProperty declarations.io.qt.no-library-shutdown-hook- Specifytrueto avoid library shutdown at program termination.io.qt.no-app-deletion- Specifytrueif you combine native code with Java code and yourQCoreApplicationinstance has been created elsewhere than inside Java.io.qt.no-exception-forwarding-from-meta-calls- Specifytrueto avoidQMetaObjectcalls (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- Specifytrueto avoid virtual calls (i.e. Java overrides) forwarding exceptions to the Qt caller in any case.io.qt.avoid-jni-global-references- Specifytrueto avoid using JNI global references. Instead, QtJambi will use a JavaHashMapto manage references. (default on Android)io.qt.use-jni-global-references- Only on Android: Specifytrueto let QtJambi use JNI global references instead ofHashMapto manage references.io.qt.disable-thread-purger- Specifytrueto not starting a watcher thread for purging Java-related thread data.io.qt.resourcepath- (semi)colon-separated list of jar files or directories to be added as Qt resource path at initialization. Skips classpath from being used.io.qt.no-classpath-to-resourcepath- Specifytrueto not adding Java classpath to Qt resource path. You may neeed to do this manually by usingQResource.addClassPath.io.qt.no-directories-to-resourcepath- Specifytrueto not adding Java classpath directories to Qt resource path (jar files only). This has no effect onQResource.addClassPath.io.qt.allow-classfiles-as-resource- Specifytrueto allow.classfiles in jar bundles to be found by Qt resources.io.qt.allow-meta-inf-as-resource- Specifytrueto add the META-INF of jar files to Qt resource path (legacy option).io.qt.resource-cache-timeout- Specify the amount of time in milliseconds a resource is kept alive in cache.
QML
io.qt.enable-qml-debugging- Specifytrueto allow QML debugging for the entire runtime of the application.io.qt.enabled-qml-debugging- Specifytrueto 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- Specifytrueto enable improved gathering of JNI environment during native callsio.qt.experimental.fast-jni-for-overrides- Specifytrueto 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- Specifytrueto cache the return values of item model'srowCount()andcolumnCount()to improve performance of item views.io.qt.experimental.enable-invalid-modelindex-singleton- Specifytrueto use one single Java object to represent invalidQModelIndexinstead of copies.io.qt.experimental.enable-ephemeral-modelindexes- Specifytrueto call virtual Java methods with an alias for QModelIndex arguments instead of submitting a copies. These alias objects are invalidated after use.