You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When binding a SpinBox's value to a property, then updating the property from outside of the SpinBox, the internal TextInput's value is not updated in certain circumstances. I've experimented with the issue a bunch and I believe that the issue manifests when the value is updated from within the SpinBox, though I'm unsure if there are any other triggers.
Here are the steps I've found to reproduce the issue (you can follow along with this SlintPad MRE):
Create a SpinBox with a binding to an integer property and some way for that property to be updated, either from another component or from native code.
Try updating the value externally (click one of the 3 buttons on the MRE) and notice that the value changes as expected.
Update the value using the SpinBox, either by editing the text input or by clicking one of the stepper buttons.
Try updating the value externally and notice that the value no longer updates.
Click a stepper button and notice that the SpinBox acts as though its value is what it had been externally updated to. This shows that the value within the SpinBox is indeed changing, but the TextInput is not receiving the new value.
I can reproduce this on the Qt backend (Qt 6, rust MSVC 1.70 stable, Windows 10 22H2 & Qt 5, rust GNU 1.70 stable, Debian 11 on WSL2) and the web backend (SlintPad).
Looking through the implementation for the Fluent-styled SpinBox, it seems that the issue stems from the way that the TextInput's text prop is updated. Whenever the value is updated from within the SpinBox, update-text() is called to update the TextInput to match. However, when this is done, it seems as though some link between root.value and i-text-input.text is removed; perhaps i-text-input.text is set to a constant equivalent to whatever root.value was at the time?
I unfortunately don't know enough about Slint to suggest a good fix for this. My instinct would be to publicize the update-value(int) function but it would be rather weird for one singular standard component to require value updates to be performed through a function.
The text was updated successfully, but these errors were encountered:
ogoffart
added
bug
Something isn't working
a:widgets
Implementation of widgets (from std-widgets.slint) and their styles (mF,bS)
labels
Jul 6, 2023
PR #3101 should fixes the issue for material and fluentSpinBox. For the nativeSpinBox more work needs to been done, because it lacks an TextInput element in the moment. That will be done next.
Is there any workaround for forcing an update on the UI until #112 is implemented? I would like to have a "Reset" button for a SpinBox, but the number in the SpinBox is not updated.
When binding a
SpinBox
'svalue
to a property, then updating the property from outside of theSpinBox
, the internalTextInput
'svalue
is not updated in certain circumstances. I've experimented with the issue a bunch and I believe that the issue manifests when the value is updated from within theSpinBox
, though I'm unsure if there are any other triggers.Here are the steps I've found to reproduce the issue (you can follow along with this SlintPad MRE):
SpinBox
with a binding to an integer property and some way for that property to be updated, either from another component or from native code.SpinBox
, either by editing the text input or by clicking one of the stepper buttons.SpinBox
acts as though its value is what it had been externally updated to. This shows that the value within theSpinBox
is indeed changing, but theTextInput
is not receiving the new value.I can reproduce this on the Qt backend (Qt 6, rust MSVC 1.70 stable, Windows 10 22H2 & Qt 5, rust GNU 1.70 stable, Debian 11 on WSL2) and the web backend (SlintPad).
Looking through the implementation for the Fluent-styled
SpinBox
, it seems that the issue stems from the way that theTextInput
'stext
prop is updated. Whenever the value is updated from within theSpinBox
,update-text()
is called to update theTextInput
to match. However, when this is done, it seems as though some link betweenroot.value
andi-text-input.text
is removed; perhapsi-text-input.text
is set to a constant equivalent to whateverroot.value
was at the time?I unfortunately don't know enough about Slint to suggest a good fix for this. My instinct would be to publicize the
update-value(int)
function but it would be rather weird for one singular standard component to require value updates to be performed through a function.The text was updated successfully, but these errors were encountered: