Public Member Functions
|virtual Property *||subProp (const QString &sub_name)|
|Return the first child Property with the given name, or the FailureProperty if no child has the name. |
|virtual Property* rviz::FailureProperty::subProp||(||const QString &||sub_name||)||
If no child is found with the given name, an instance of a special Property subclass named FailureProperty is returned and an error message is printed to stdout. FailureProperty::subProp() always returns itself, which means you can safely chain a bunch of subProp() calls together and not have a crash even if one of the sub-properties does not actually exist. For instance:
float width = prop->subProp( "Dimenshons" )->subProp( "Width" )->getValue().toFloat();
If the first property
prop has a "Dimensions" property but not a "Dimenshons" one,
width will end up set to 0 and an error message will be printed, but the program will not crash here.
This is an Order(N) operation in the number of subproperties.
Reimplemented from rviz::Property.