blob: a7a9cd01cceb1c9f4add7f7ca723d2b0ce96f11b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// 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 real value: {
var slope = (object.outputMax - object.outputMin) / (object.inputMax - object.inputMin)
return object.outputMin + slope * (object.input - object.inputMin)
}
property real inputMin: 0
property real inputMax: 100
property real outputMin: 0
property real outputMax: 100
}
|