aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/numbersInJsPrimitive.qml
blob: ec848429e85754f8707252b9f1b9eb4ff2d53e54 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
pragma Strict
import QtQml
import TestTypes

QtObject {
    function writeValues() {
        Druggeljug.myInt8 = 35
        Druggeljug.myUint8 = 36
        Druggeljug.myInt16 = 37
        Druggeljug.myUint16 = 38
        Druggeljug.myInt = 39
        Druggeljug.myUint = 40
        Druggeljug.myInt32 = 41
        Druggeljug.myUint32 = 42
    }

    function negateValues() {
        Druggeljug.myInt8   = -Druggeljug.myInt8;
        Druggeljug.myUint8  = -Druggeljug.myUint8;
        Druggeljug.myInt16  = -Druggeljug.myInt16;
        Druggeljug.myUint16 = -Druggeljug.myUint16;
        Druggeljug.myInt    = -Druggeljug.myInt;
        Druggeljug.myUint   = -Druggeljug.myUint;
        Druggeljug.myInt32  = -Druggeljug.myInt32;
        Druggeljug.myUint32 = -Druggeljug.myUint32;
    }

    function shuffleValues() {
        Druggeljug.myInt8   = Druggeljug.myUint8;
        Druggeljug.myUint8  = Druggeljug.myInt16;
        Druggeljug.myInt16  = Druggeljug.myUint16;
        Druggeljug.myUint16 = Druggeljug.myInt;
        Druggeljug.myInt    = Druggeljug.myUint;
        Druggeljug.myUint   = Druggeljug.myInt32;
        Druggeljug.myInt32  = Druggeljug.myUint32;
        Druggeljug.myUint32 = Druggeljug.myInt8;
    }

    function readValueAsString(i: int) : string {
        switch (i) {
            case 0: return Druggeljug.myInt8;
            case 1: return Druggeljug.myUint8;
            case 2: return Druggeljug.myInt16;
            case 3: return Druggeljug.myUint16;
            case 4: return Druggeljug.myInt;
            case 5: return Druggeljug.myUint;
            case 6: return Druggeljug.myInt32;
            case 7: return Druggeljug.myUint32;
            default: return "";
        }
    }

    function storeValues() {
        Druggeljug.storeMyInt8(1330)
        Druggeljug.storeMyUint8(1331)
        Druggeljug.storeMyInt16(1332)
        Druggeljug.storeMyUint16(1333)
        Druggeljug.storeMyInt(1334)
        Druggeljug.storeMyUint(1335)
        Druggeljug.storeMyInt32(1336)
        Druggeljug.storeMyUint32(1337)
    }
}