forked from carlonluca/pot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OMX_CrossImage.qml
58 lines (46 loc) · 998 Bytes
/
OMX_CrossImage.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
import QtQuick 2.0
Item {
id: mainItem
property var source1: null
property var source2: null
property var current: image1
Image {
id: image1
source: source1
x: 0
y: 0
width: mainItem.width
height: mainItem.height
opacity: 1.0
Behavior on opacity {
NumberAnimation {
duration: 1000
}
}
}
Image {
id: image2
source: source2
x: 0
y: 0
width: mainItem.width
height: mainItem.height
opacity: 2.0
Behavior on opacity {
NumberAnimation {
duration: 1000
}
}
}
function next() {
if (current === image1) {
current = image2;
image1.opacity = 0.0;
image2.opacity = 1.0;
return;
}
current = image1;
image1.opacity = 1.0;
image2.opacity = 0.0;
}
}