Advanced Usage

Integrating the GammaRay Probe into an Application

In some scenarios it might be desirable to not use GammaRay's dynamic injection mechanism, but to build the GammaRay probe into the target application at compile time already. Static linking is one such use-case, as dynamic injection doesn't work then.

There are two ways available to integrate the probe into a target application:

  • Dynamic linking to the GammaRay probe DLL. This is useful for example for use with application bundles on platforms that allow dynamic linking (e.g. on Android). GammaRay provides the probe DLL as link tarket for qmake and CMake based build systems. You need to ensure to deploy all GammaRay DLLs and probe plugins too in this scenario.
  • Static linking to the GammaRay probe and all relevant plugins. This is a more complex setup but your only option when using a statically linked Qt. Compile GammaRay with the -DGAMMARAY_STATIC_PROBE=ON CMake option, add the GAMMARAY_STATIC_INJECT macro to your application code and link the application against the GammaRay probe and all relevant plugins. See tests/manual/staticinjectiontest in the GammaRay source code for an example.

Be sure to review the licensing terms before distributing an application with GammaRay integrated permanently, in particular when using the open source version of GammaRay.

Creating Custom GammaRay Plug-ins

GammaRay can be extended with custom plugins. The main extension points for plugins are:

  • Add entirely new Tools, for example for additional frameworks.
  • Add additional tabs to the Object Inspection view. This is most useful for inspecting aspects of objects shown in multiple tools.
  • Extend the Properties view by additional means to retrieve object properties.

For more details on implementing GammaRay plugins, please refer to the API documentation.

Integrating the GammaRay Client into an IDE

The GammaRay Client can be integrated into integrated development environments (IDE). Such an integration is available for Qt Creator as part of the Qt Automotive Suite.

For more details on how to integrate the GammaRay client with and IDE, please see the API documentation.

© 2016-2018 Klarälvdalens Datakonsult AB (KDAB). Documentation contributions included herein are the copyrights of their respective owners.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.