-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMonsterCollectionItem.qml
44 lines (37 loc) · 1.05 KB
/
MonsterCollectionItem.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
import QtQuick 2.0
Item {
width: 100
height: 100
Column {
anchors.horizontalCenter: parent.horizontalCenter
Image {
id: idIcon
y: 20;
fillMode: Image.PreserveAspectFit
source: icon
width: 75
height: 75
}
Text {
text: name;
anchors.horizontalCenter: parent.horizontalCenter
}
}
MouseArea {
anchors.fill: parent
onClicked: {
if(parent.GridView.view.currentIndex == index)
{
var component = Qt.createComponent(infopage);
console.log(component.errorString());
console.log(name);
if(component.status == Component.Ready)
{
component.createObject(root, {x: 0, y: 0, width: root.width, height: root.height, name: name, icon: icon})
console.log("Created")
}
}
parent.GridView.view.currentIndex = index
}
}
}