建了一个QML登陆界面,里面建了一个loadButton按钮,在load_in界面里引用了这个按钮,Text却不显示,又新建了一个 quick UI 把loadbutton程序拷进去,却能显示字体,不知道问题出在哪里??
loadbutton.qml
import QtQuick 2.2
Rectangle {
width: 162
height: 38
Image {
id:loadbutton
anchors.centerIn: parent//居中
width:162
height: 38
smooth:true
source:"image/load/button_login_normal.png"
}
Text{
anchors.centerIn: parent
text:qsTr("load in")
smooth: false
antialiasing: false
clip: false
font.bold: true
style: Text.Normal
font.family: "Arial"
font.pixelSize: 17
}
}
load_in.qml
import QtQuick 2.2
import QtQuick.Controls 1.1
ApplicationWindow {
visible: true
width: 376
height: 293
title: qsTr("For mysql")
Item{
id:loadin_png
width: 84
height: 84
anchors.centerIn: parent//居中
anchors.verticalCenterOffset: 35
anchors.horizontalCenterOffset: -119
children: [
Image{
anchors.centerIn: parent
width:84
height: 84
// smooth:true
source: "image/load/image5.png"
},
Image {
anchors.centerIn: parent//居中
width:64
height: 64
smooth:true
source:"image/load/image0.jpg"
}
]
}
Rectangle{
id:passinput
opacity:1
width: 180
height: 84
color: "#00000000" //可以 透明
border.width: 0
clip: false
anchors.verticalCenter: loadin_png.verticalCenter
anchors.left: loadin_png.right
anchors.leftMargin: 10
children: [
ComboBox {
id: name_in
anchors.top:passinput.top
anchors.topMargin: 10
width: 180
height: 25
smooth: true
clip: false
activeFocusOnPress: false
},
TextField{
id:pass_in
anchors.bottom: passinput.bottom
anchors.bottomMargin: 10
width:180
height: 25
font.pixelSize: 14
placeholderText:qsTr("password in")
echoMode: TextInput.Password
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
}
]
}
LoadButton{
anchors.centerIn: parent
anchors.verticalCenterOffset: 110
}
}