2019独角兽企业重金招聘Python工程师标准>>>
controls
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4Rectangle {color: "green"Button {id:buttontext: qsTr("Second page")anchors.centerIn: parentproperty string url: "qrc:/bg.png"style: ButtonStyle {id:button_stylebackground: Image {id: button_imagesource: button.url}}MouseArea{anchors.fill: parentonPressed: {parent.state = "focus"}onExited: parent.state = "namol"}states: [State {name: "focus"PropertyChanges {target: buttonurl:"qrc:/on.png"}},State {name: "namol"PropertyChanges {target: buttonurl:"qrc:/bg.png"}}]}
}
controls2
import QtQuick 2.7
import QtQuick.Controls 2.0Rectangle {color: "green"Button {id:buttontext: qsTr("Second page")anchors.centerIn: parentproperty string url: "qrc:/bg.png"contentItem: Text {text: button.textfont: button.fontcolor: "black"horizontalAlignment: Text.AlignHCenterverticalAlignment: Text.AlignVCenterelide: Text.ElideRight}background: Image {id: button_imagesource: button.url}MouseArea{anchors.fill: parentonPressed: {parent.state = "focus"}onExited: parent.state = "namol"}states: [State {name: "focus"PropertyChanges {target: buttonurl:"qrc:/on.png"}},State {name: "namol"PropertyChanges {target: buttonurl:"qrc:/bg.png"}}]}}