mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 15:15:56 +08:00
Add comments
This commit is contained in:
parent
9c2d370e72
commit
3a74417e6e
@ -4,6 +4,11 @@
|
|||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
|
|
||||||
|
// This component extends the funtionality of QtControls 2.x Spinboxes to
|
||||||
|
// - be able to contain fractional values
|
||||||
|
// - hava a "prefix" and a "suffix". A validator is added that recognizes this pre-, suf-fix combo. When adding a custom
|
||||||
|
// validator the pre-, suf-fix should be added (e.g. new RegExp("^" + prefix + \regex\ + suffix + "$")
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: base
|
id: base
|
||||||
@ -33,13 +38,16 @@ Item
|
|||||||
{
|
{
|
||||||
id: spinBox
|
id: spinBox
|
||||||
anchors.fill: base
|
anchors.fill: base
|
||||||
|
editable: base.editable
|
||||||
|
|
||||||
|
// The stepSize of the SpinBox is intentionally set to be always `1`
|
||||||
|
// As SpinBoxes can only contain integer values the `base.stepSize` is concidered the precision/resolution
|
||||||
|
// increasing the spinBox.value by one increases the actual/real value of the component by `base.stepSize`
|
||||||
|
// as such spinBox.value * base.stepSizes produces the real value of the component
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
|
|
||||||
value: Math.floor(base.value / base.stepSize)
|
value: Math.floor(base.value / base.stepSize)
|
||||||
from: Math.floor(base.from / base.stepSize)
|
from: Math.floor(base.from / base.stepSize)
|
||||||
to: Math.floor(base.to / base.stepSize)
|
to: Math.floor(base.to / base.stepSize)
|
||||||
editable: base.editable
|
|
||||||
|
|
||||||
valueFromText: function(text)
|
valueFromText: function(text)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user