summaryrefslogtreecommitdiffstats
path: root/src/controls/SplitView.qml
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-05-08 17:02:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-10 11:02:38 +0200
commit16558ac71509fe51a4cf18f238e4f61b37323fe4 (patch)
treef7815dd5d3ffa8910ddb1c2c31c283ec093761f8 /src/controls/SplitView.qml
parentcec771589dc0ef98d5d3e1b65641c8c581c4ed55 (diff)
Return infinity instead of -1 as a default value for max sizes
This was a bit inconsistent, because in the case of a Rectangle its Layout.maximumWidth would return -1 by default (which was supposed to be interpreted as infinity) However, since the maximumWidth propagated up to the layout, the layout.Layout.maximumWidth would return 1000000000. Adding two Rectangles to the layout would make layout.Layout.maximumWidth return 2000000000, and adding a third item with Layout.maximumWidth:1 would make layout.Layout.maximumWidth return 2000000001 With this change, since infinity + number = infinity, everything that can grow to infinity will just return infinity. In addition a developer can now more intuitively do comparisons like this: if (value > Layout.minimumWidth && value < Layout.maximumWidth) instead of if ((value == -1 || value > Layout.minimumWidth) && (value != -1 && value < Layout.maximumWidth)) Now, as a bonus, it becomes less consistent to set an attached (min,max) property to -1 in order to reset it to its implicit value. This also fixes a documentation issue with regards to the attached Layout.{min|max}imum{Width|Height} properties. It only told the story correct if the item was not a layout, and updates the docs for the max sizes to mention that it returns Number.POSITIVE_INFINITY Change-Id: Ia638064fd3ed5614d7e496a9b5e4aa8fcb7307f7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/controls/SplitView.qml')
0 files changed, 0 insertions, 0 deletions