aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/studiowelcome/qml/downloaddialog/MinMaxMapper.qml
blob: fca27969da95cfab475ed53352521f933502f709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0

import QtQuick 2.10

QtObject {
    id: object


    property real input

    property bool minClipped: object.input < object.min
    property bool maxClipped: object.input > object.max
    property bool outOfRage: object.maxClipped ||object.minClipped

    property real value: {
        if (object.maxClipped)
            return object.max

        if (object.minClipped)
            return object.min

        return object.input
    }

    property real min: 0
    property real max: 100
}