Skip to content

Commit

Permalink
Workaround for QTBUG-118544
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Oct 25, 2023
1 parent f81f5f0 commit 3987355
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions source/app/ui/qml/app/graphia/Controls/DoubleSpinBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,19 @@ Control
function doubleValue(i) { return root.from + ((root.to - root.from) / (to - from)) * (i - from); }
function intValue(d) { return from + ((to - from) / (root.to - root.from)) * (d - root.from); }

from: -0x7FFFFFFF
to: 0x7FFFFFFF
from: -0x3FFFFFFF
to: 0x3FFFFFFF
stepSize: root.stepSize * ((spinBox.to - spinBox.from) / (root.to - root.from))

onStepSizeChanged:
{
let wouldUnderflow = (-0x7FFFFFFF + spinBox.stepSize) > spinBox.from;
let wouldOverflow = (0x7FFFFFFF - spinBox.stepSize) < spinBox.to;

if(wouldUnderflow || wouldOverflow)
console.log("DoubleSpinBox.stepSize is set such that under/overflow may occur (QTBUG-118544)");
}

Component.onCompleted:
{
value = intValue(root.value);
Expand Down

0 comments on commit 3987355

Please sign in to comment.