Skip to content

RangedDynamicProperty cannot set value and range atomically. #473

Description

@pixelzoom

In RangedDynamicProperty:

  /**
   * Convenience function for setting the rangeProperty. Note: be careful using this function, as validation will occur
   * immediately, and if the value is outside of this new Range an error will occur. See this.setValueAndRange() for
   *  way to set both at once without assertion errors.
   */
  public set range( range: Range ) {
    this.rangeProperty.value = range;
  }

Note that the doc says:

See this.setValueAndRange() for way to set both at once without assertion errors.

But there is no setValueAndRange method on this class or its ancestors. Is that an oversight or a documentation copy-paste error from NumberProperty?

In QBS we have a RangedDynamicProperty whose value and range needs to change atomically. How can that be accomplished.

Assigning to @jonathanolson since he is the author of RangedDynamicProperty and is superclass DynamicProperty. High-priority on a response please, since I need to know where this is possible for QBS, or whether I need to use a different approach.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions