-
Notifications
You must be signed in to change notification settings - Fork 76
/
qml_ex.qml
78 lines (69 loc) · 1.51 KB
/
qml_ex.qml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.0
import org.julialang
ApplicationWindow {
id: mainwindow
title: "hexbin Demo Application"
width: 600
height: 450
visible: true
// QTBUG-77958: QtQuick applications don't work on macOS 10.15 Beta 7/8
// see https://bugreports.qt.io/browse/QTBUG-77958
//Timer {
// interval: 50
// repeat: true
// running: true
// onTriggered: if (mainwindow.active) mainwindow.raise();
//}
Text {
id: xy
font.pointSize: 12
font.family: "Courier New"
x: 5
y: 5
text: ""
}
ColumnLayout {
id: root
spacing: 6
anchors.fill: parent
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
Text {
text: "Number of bins:"
}
Slider {
id: nbinsSlider
implicitWidth: 100
implicitHeight: 30
value: 30
from: 10
to: 60
stepSize: 1
onValueChanged: {
parameters.nbins = nbinsSlider.value;
painter.update()
}
}
}
JuliaPaintedItem {
id: painter
paintFunction: paint_cfunction
Layout.fillWidth: true
Layout.fillHeight: true
MouseArea {
anchors.fill: parent
hoverEnabled: true
onPositionChanged: {
xy.text = Julia.mousePosition(mouse.x, mouse.y, 0);
}
onWheel: {
Julia.mousePosition(wheel.x, wheel.y, wheel.angleDelta.y);
painter.update()
}
}
}
}
}