aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qml/holistic/data/scopeSwitching/JsToCppNine.qml
blob: 45157f264e70c4dae9f66c17bca82bc99ecf911e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQuick 2.0
import Qt.test 1.0

Item {
    id: arbitraryVariantConsumer
    property MyArbitraryVariantProvider a: MyArbitraryVariantProvider { id: arbitraryVariantProvider }
    property variant someVariant;
    property int sideEffect: 10

    function callCppFunction() {
        // in this case, we call a const CPP function with variant return value and integer arguments.
        arbitraryVariantConsumer.sideEffect = arbitraryVariantConsumer.sideEffect + 3;
        someVariant = arbitraryVariantProvider.possibleVariant(sideEffect, sideEffect * 2, sideEffect * 5);
    }
}