-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathField.qml
40 lines (33 loc) · 975 Bytes
/
Field.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
import QtQuick 2.9
import "board.js" as BoardJS
Item
{
property int magicIndex
property color magicColor
function magicCenter() { return Qt.point(x + width / 2, y + height / 2); }
function magicSize() { return Qt.size(width, height); }
function magicValue() { return m_value; }
function magicSetValue(a)
{
m_value = a;
var l_filepath = BoardJS.imageFilepath(m_value);
id_image.source = l_filepath;
id_image.visible = l_filepath != "";
}
function magicSetMask(a) { id_image.visible = !a; }
//------------------------------------------------------------------------------
Rectangle
{
anchors.fill: parent
color: magicColor
}
Image
{
id: id_image
anchors.fill: parent
sourceSize.width: 256
sourceSize.height: 256
}
//------------------------------------------------------------------------------
property string m_value: "0"
}