White balance - can't type color temperature without including the comma character

What is your operating system?
Windows 10 20H2

What is your Shotcut version (see Help > About Shotcut)? Is it 32-bit?
21.05.01 and 21.03.21 x64 portable

Can you repeat the problem? If so, what are the steps?
In the White Balance filter, you can’t type a color temperature without entering a comma.

For example, if you wanted to type 6,500K (6500K) and type “65”, it won’t take any more digits. It will only accept “6,500” entry (comma is mandatory).

This existed since the user interface change. I forget how far back that was. It’s affected at least the last two versions.

You should be able to type a value without requiring entry of the thousands separator.

Unfortunately, many of these issues are found in the Qt User Interface library, and are not under the control of the Shotcut developers.


The problem is an error in the logic of the following Shotcut control QML widget:

C:\Program Files\Shotcut\share\shotcut\qml\modules\Shotcut\Controls\DoubleSpinBox.qml

that mishandles the Whitebalance temperature value since it has a minimum value that is greater than 99. The relevant code is:

else {
        var newValue = spinbox.valueFromText(text, spinbox.locale)
        if (isNaN(newValue)) {
           // Assume editing in progress
        else if (newValue >= spinbox.from && newValue <= spinbox.to)
            _lastValidText = text
            spinbox.value = newValue
        else if (text.length > 2)    // <==== THE LINE IN ERROR
            // Forbid out of bounds text except short text that might be in progress
            text = _lastValidText

The fix is to change the value 2 to 4 in the line in error, however, since many filters use this Shotcut control QML widget, I would prefer Dan (@shotcut )confirms this as I have only checked that it works with the White Balance filter and the Size-Position&Rotate filter.

I have made an improvement to this for the next build.

1 Like

Thank you @brian , that’s much appreciated. Could you have a look at the following and see where I’m going wrong please? I’m reasonably sure I’m on the right track, but am applying the code in the wrong place.

@brian, than you