Commit e01caf4f authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Set min/max for Y axis range spinboxes to minimum/maximum possible value

Some sensors have a range of gigabytes or terabytes, like memory and
disk. Since the base unit for these is bytes, we end up needing a very
large value in the range, which currently is not possible due to the
spinbox limiting the value. Internally, spinbox seems to use an int so
we can only store a value that fits within the range of an int, so we
use that as min/max value.

Longer term we want to have some ability to choose an actual "maximum"
sensor but that's going to need more work.

BUG: 433007
BUG: 424527


(cherry picked from commit 504dcbd2)
parent aeb7fa9e
......@@ -61,16 +61,16 @@ Kirigami.FormLayout {
QQC2.SpinBox {
id: rangeFromSpin
editable: true
from: -99999
to: 99999
from: Math.pow(-2, 31) + 1
to: Math.pow(2, 31) - 1
Kirigami.FormData.label: i18n("From:")
enabled: !rangeAutoCheckbox.checked
}
QQC2.SpinBox {
id: rangeToSpin
editable: true
from: -99999
to: 99999
from: Math.pow(-2, 31) + 1
to: Math.pow(2, 31) - 1
Kirigami.FormData.label: i18n("To:")
enabled: !rangeAutoCheckbox.checked
}
......
......@@ -90,14 +90,14 @@ Kirigami.FormLayout {
Kirigami.FormData.label: i18n("From (Y):")
enabled: !rangeAutoYCheckbox.checked
editable: true
from: -99999
to: 99999
from: Math.pow(-2, 31) + 1
to: Math.pow(2, 31) - 1
}
QQC2.SpinBox {
id: rangeToYSpin
editable: true
from: -99999
to: 99999
from: Math.pow(-2, 31) + 1
to: Math.pow(2, 31) - 1
Kirigami.FormData.label: i18n("To (Y):")
enabled: !rangeAutoYCheckbox.checked
}
......
......@@ -81,11 +81,13 @@ Kirigami.FormLayout {
editable: true
Kirigami.FormData.label: i18n("From:")
enabled: !rangeAutoCheckbox.checked
from: Math.pow(-2, 31) + 1
to: Math.pow(2, 31) - 1
}
QQC2.SpinBox {
id: rangeToSpin
from: -99999
to: 99999
from: Math.pow(-2, 31) + 1
to: Math.pow(2, 31) - 1
editable: true
Kirigami.FormData.label: i18n("To:")
enabled: !rangeAutoCheckbox.checked
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment