16,216
社区成员
发帖
与我相关
我的任务
分享
import QtQuick 1.0
Rectangle {
width: 400
height: 200
color: "lightblue"
id:aa
Text{
id:bb
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
wrapMode: Text.WordWrap
font.pixelSize: 48
font.italic: true
text:"Press me"
signal buttonClick()
onButtonClick: {
if(mouse.button==Qt.RightButton){
parent.color="blue"
}else {
parent.color="red"
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton|Qt.RightButton
onClicked: buttonClick()
}
}
TextInput {
id:input
x:50;y:150
width: 100
text:"<html><b>Qt Quick</b></html>"
}
Image {
width: 50
height:50
source:"C:/Users/Public/Pictures/Sample Pictures/Chrysanthemum.jpg"
}
}