zoukankan      html  css  js  c++  java
  • QTQuick控件基础(3)视图

    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、messagedialog
    ApplicationWindow {
    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: {}
    }

    }





  • 相关阅读:
    Go语言专题
    计算机网络专题
    分布式系统理论专题
    Scala语言专题
    Zookeeper专题
    Java虚拟机专题
    Java并发编程专题
    git使用指南
    Oracle查询今天、昨天、本周、上周、本月、上月数据
    python3 装饰器
  • 原文地址:https://www.cnblogs.com/jsxyhelu/p/8449228.html
Copyright © 2011-2022 走看看