aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/argumentConversion.qml
blob: 654810d767dbcfb58ad79f3506cdae95c40eab82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pragma Strict
import QML

QtObject {
    function coerceToNumber(a: var) : real {
        return a - 1;
    }

    property real a: coerceToNumber("true")
    property real b: coerceToNumber("false")
    property real c: coerceToNumber(4)
    property real d: coerceToNumber(null)
    property real e: coerceToNumber(undefined)
    property real f: coerceToNumber("11")
}