The properties view is the most general way of inspecting a selected objects, and is available for all types of objects.
The view consists of four columns:
- The name of the property.
- The current value of the property. If change notifications are available for a property, this value is updated live when the property value changes. When looking at a QMetaObject instead of an object instance (for example in the Meta Object Browser, this column is not available.
- The data type of the property value.
- The source of the property. This is typically a class name, but may also indicate dynamic QObject properties, QML attached or context properties.
Depending on the source of the property, additional information are available in a tooltip, as seen in the above screenshot. Depending on the type of the property value, object navigation actions are available in the context menu, typically for properties containing references to other objects.
Properties containing container or object values can often be expanded to inspect their content in more detail.
Properties are taken from the following sources, based on the type of the object you have selected:
- Static QObject properties, that is properties introspectable via QMetaProperty.
- Dynamic QObject properties.
- QML attached properties, if the selected object has been created via QML.
- QML context properties, if the selected object is a QQmlContext.
- A set of non-introspectable but well-known properties of Qt classes built into GammaRay.
Additionally the following container types are supported, and exapanded depending on their content:
- QSequentialIterable, which covers most sequential containers like QVector and QList.
- QAssociativeIterable, which covers most associative containers like QHash and QMap.
As far as supported by a specific property, property values can be edited, with immediate effect on the application. This can generally been done by double-clicking into the value column. For some complex types, an extended editing dialog is available, reachable via the "..." button on the right side of the value editing field.
The following types can be edited:
- standard numeric and boolean types
- Qt's vector and matrix math types
- most of Qt's geometry types
- some of Qt's graphic types such as QFont and QColor
- enum and flag types introspectable via QMetaEnum
Additionally it is possible to add dynamic properties to a QObject instance with the controls at the bottom of the property view. Existing dynamic properties can be edited as any other property, and can be removed via the context menu.
The following examples make use of the properties view:
© 2016-2020 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.