Cpper
C/C++高级工程师 Android高级软件工程师 IT集成工程师 音频工程师 熟悉c,c++,java,c#,py,js,asp等多种语言 程序猿
import QtQuick 2.5
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle 
{
    width
: 640
    height: 480
    color: "#333333"

    Button {
        id: button
        text: "Button"
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: parent.top
        anchors.topMargin: 6

        onClicked: {
            var count = layout.count
            if(layout.currentIndex == count - 1)
                layout.currentIndex = 0
            else
                layout.currentIndex ++
        
}
    }

    StackLayout 
{
        id
: layout
        anchors.top: button.bottom
        anchors.topMargin: 6
        anchors.horizontalCenter: parent.horizontalCenter
        width: 480
        height: 320
        currentIndex: 1
        Rectangle {
            color: 'teal'
            implicitWidth: 200
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'plum'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: '#c90909'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'green'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'grey'
            implicitWidth: 300
            implicitHeight: 200
        
}
    }
}
posted on 2019-09-18 11:49 ccsdu2009 阅读(637) 评论(0)  编辑 收藏 引用 所属分类: QT编程

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理