• OctoMY API
  • OctoMY API Reference
  • C++ Classes
  • OctoMY
  • BuildInfo
  • BuildInfo Class

    Reports the build-time metadata compiled into the binary: git state, version, toolchain and feature flags. More...

    Header: #include <BuildInfo>

    Detailed Description

    The build passes the git branch, commit, commit date and dirty state, the package version, the build variant, the toolchain and the qbs profile as preprocessor defines. BuildInfo turns them into accessors, most of them static. A build outside qbs gets fallback values, such as the version 0.0.0-dev, so it is identifiable as such and does not look like a real release.

    The feature accessors, such as hasBluetooth() and hasLlvm(), give the effective state: the feature was wanted and the system had it. Runtime accessors add the Qt version, the operating system, the CPU architecture and the compiler.

    fields() returns all of this as a list of BuildInfoField rows, each with a stable machine key, a translated display key, a value and a BuildInfoGroup, so a consumer does not have to list the fields again. Machine consumers read the stable keys. windowTitleSuffix(), versionString() and fullVersionString() give ready-made strings for the UI, and AboutActivity reads the accessors for its Build tab.

    instance() returns the one shared object.