Open rscarson opened 3 hours ago
value.round() works as expected in preview mode, but the compiler reports main.slint:95: Cannot access the field 'round' of float
value.round()
main.slint:95: Cannot access the field 'round' of float
export component LabeledSlider inherits LabeledField { in-out property <string> units; in-out property <int> value; in-out property <int> minimum; in-out property <int> maximum; callback changed(int); label: value + " " + units; v := Slider { minimum: root.minimum; maximum: root.maximum; width: root.width; changed => { root.value = v.value.round(); } } }
That .round() was added in Slint 1.8. What version of the preview do you use and what version of Slint library used by the compiler. You may need to change the version number in your Cargo.toml
value.round()
works as expected in preview mode, but the compiler reportsmain.slint:95: Cannot access the field 'round' of float