1. 程式人生 > >QTQuick控件基礎(3)視圖

QTQuick控件基礎(3)視圖

view angle inf n) idt adding use 筆記 detail

1、spliteview技術分享圖片2、stackview技術分享圖片

ApplicationWindow {
visible: true
width: 640
height: 480

MouseArea{
anchors.fill: parent
acceptedButtons: Qt.LeftButton|Qt.RightButton|Qt.MiddleButton
onClicked: {
if(mouse.button === Qt.LeftButton ){
stackView.push([blueView,greenView,yellowView]);
}else if(mouse.button === Qt.RightButton){
stackView.pop();
}else
{
stackView.push({item:orangeView,replace:ture})
}
}
}

Rectangle {id:blueView;color: "blue"}
Rectangle {id:greenView;color: "green"}
Rectangle {id:yellowView;color: "yellow"}
Rectangle {id:orangeView;color: "orange"}
StackView{
id:stackView
anchors.fill: parent
initialItem: Item{
id:redView
Rectangle{anchors.fill:
parent;color: "red"}
}
}
}

3、messagedialogApplicationWindow {
visible: true
width: 640
height: 480

Button{
id:window
width: 300
height: 300
anchors.centerIn: parent
onClicked: messageDialog.open()
}

MessageDialog{
id:messageDialog
title:"註意註意"
text: "歡迎使用QTQuick"
detailedText: "這裏是具體文字"
icon:StandardIcon.Question
standardButtons:
StandardButton.Yes|StandardButton.Help|StandardButton.Open
onYes: {}
onHelp: {}
onAccepted: {}
}

}
技術分享圖片


來自為知筆記(Wiz)

QTQuick控件基礎(3)視圖