On this page

Parameter QML Type

Declares a ROS 2 node parameter: named, settable, observable state. More...

Import Statement: import QtRos2.Core
Inherits:

NodeChild

Status: Experimental Extension

Properties

Signals

Detailed Description

Parameter exposes one named value on its node through the standard ROS 2 parameter machinery: it can be read and set with ros2 param get/set, by rqt, or by a RemoteParameter in another process; every change is announced on the global /parameter_events topic; and minimum, maximum and readOnly are enforced by rclcpp itself before any change is accepted.

Node {
    nodeName: "robot"
    Parameter {
        name: "audio.master"
        value: volumeCtl.master
        minimum: 0.0; maximum: 1.0
        description: "Master (default sink) volume"
        onValueEdited: (v) => volumeCtl.master = v
    }
}

The value property works both ways, following the TextField.text / textEdited convention: writes from the application (including bindings) are published as parameter changes, and an external set updates the property and then emits valueEdited. When value is bound, the application is the authority: handle valueEdited and route the new value into the binding's source, which then echoes it back (a no-op when equal). If valueEdited is ignored on a bound value, an external set only holds until the binding re-evaluates.

Property Documentation

declared : bool

Read-only: true while the parameter is declared on the node. false before the node initializes and while an Auto-typed parameter is still waiting for its first valid value.

description : string

Human-readable description, published in the parameter descriptor (visible to ros2 param describe and rqt).

maximum : var

minimum : var

step : var

Range constraint for Integer and Double parameters, published in the descriptor and enforced by rclcpp: an out-of-range set is rejected before the value changes (the CLI reports the allowed range). Leave undefined for no constraint; ignored with a warning for other types.

name : string

The parameter name (e.g. "audio.master"). Changing it after the parameter is declared undeclares and redeclares it.

readOnly : bool

Declares the parameter immutable: every set after declaration — including the application's own writes — is rejected by rclcpp. Useful for publishing constants for introspection.

type : enumeration

The declared ROS parameter type. With the default Parameter.Auto the type is inferred from the first valid value; until then the declaration is deferred (declared stays false). Set an explicit type to declare immediately with that type's default value.

ConstantDescription
Parameter.Autoinfer from the first valid value
Parameter.Bool 
Parameter.Integer 
Parameter.Double 
Parameter.String 
Parameter.ByteArray 
Parameter.BoolList 
Parameter.IntegerList 
Parameter.DoubleList 
Parameter.StringList

Note: Integer parameters are 64-bit on the wire but JavaScript numbers in QML: values beyond 2^53 lose precision.

value : var

The parameter value. Writes are coerced to the declared type and rejected (with setRejected) when not representable or when they violate the declared constraints. External sets update this property and emit valueEdited.

Signal Documentation

setRejected(string reason)

Emitted when a write to value could not be applied — reason describes why (wrong type, or rejected by rclcpp: range violation, read-only). value is restored to the actual parameter value.

Note: The corresponding handler is onSetRejected.

valueEdited(var value)

Emitted when the parameter was set externally (ros2 param set, a RemoteParameter, another node) — after value has been updated. Not emitted for the application's own writes. When value is bound, handle this signal and route value into the binding's source of truth.

Note: The corresponding handler is onValueEdited.

© 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.