fieldType QML Value Type
Represents the type of a field and related meta-data. More...
| Import Statement: | import QtRos2.TypeDescriptionInterfaces |
| Status: | Experimental Extension |
Properties
- capacity : uint64_t
- nestedTypeName : string
- stringCapacity : uint64_t
- typeId : uint8_t
Detailed Description
A constant for each type supported according to: http://design.ros2.org/articles/legacy_interface_definition.html and: http://design.ros2.org/articles/idl_interface_definition.html Order is loosely coupled to the order of appearance in the IDL 4.2 spec: https://www.omg.org/spec/IDL/4.2
Layout of constants across the 0-255 decimal values in the uint8:
- 000 : Reserved for "not set" - 001-048: Primitive types, strings, and reserved space for future primitive types - 049-096: Fixed sized array of primitive and string types - 097-144: Bounded Sequences of primitive and string types - 145-192: Unbounded Sequences of primitive and string types - 193-255: Reserved space for future array/sequence-like types
fieldType is a structured value type usable in QML. It maps directly to the type_description_interfaces::msg::FieldType ROS 2 message type.
Construct a fieldType in QML by assigning a JavaScript object whose keys are its component properties, or by setting those properties individually.
See also FieldTypePublisher and FieldTypeSubscriber.
Property Documentation
capacity : uint64_t
Only used when the type is an array or a bounded sequence.
In the case of an array, this is the fixed capacity of the array. In the case of a bounded sequence, this is the maximum capacity of the sequence. In all other cases this field is unused.
nestedTypeName : string
Only used when the type is a nested type or array/sequence of nested types.
This is limited to 255 characters. TODO(wjwwood): this 255 character limit was chosen due to this being the limit for DDSI-RTPS based middlewares, which is the most commonly used right now. We lack a ROS 2 specific limit in our design documents, but we should update this and/or link to the design doc when that is available.
stringCapacity : uint64_t
Only used when the type is a fixed or bounded string/wstring, or a array/sequence of those.
In the case of a fixed string/wstring, it is the fixed length of the string. In the case of a bounded string/wstring, it is the maximum capacity of the string. In the case of an array/sequence of fixed string/wstring, it is the fixed length of the strings. In the case of an array/sequence of bounded string/wstring, it is the maximum capacity of the strings. It is not currently possible to have different string capacities per element in the array/sequence.
typeId : uint8_t
Identifying number for the type of the field, using one of the above constants.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.