forked from liuleidong/BeautySlash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SLButton.qml
38 lines (31 loc) · 836 Bytes
/
SLButton.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
import QtQuick 2.0
Item {
id:root
property real margin : 0.4
property alias text: text.text
property alias source: img.source
//字体
FontLoader { id: font1; source: "font/huawencaiyun.ttf" }
//变量
property int fontsize: 75
property string fontname: font1.name
Rectangle{
id:btn
anchors.fill: parent
color: "transparent"
Image{
id: img
anchors.fill: parent
source: "qrc:/pics/button-play.png"
}
Text{
id: text
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: parent.width * root.margin
font.family: fontname
font.pixelSize: fontsize
font.weight: Font.Bold
}
}
}