blob: dbc991c7790a64e97cd73b335b2c5c93bc05c82a (
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
|
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick 2.5
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.2
import test.Obj 1.0
Rectangle {
visible: true
required property Obj o
GridLayout {
Button {
id: button
objectName: "button"
text: "sum!"
onClicked: {
o.sum(40, 2)
}
}
Text {
id: sumResultText
}
}
Connections {
target: o
function onSumResult(sum) {
// set the value on the Qml side
sumResultText.text = sum
// set internal Python value from the already
// modified value
o.sendValue(sumResultText.text)
}
}
}
|