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

Rectangle
{
    id
: base
    width:640
    height:480

    property int current: 0

    ColumnLayout
    {
        anchors.fill:parent
        anchors.margins: 6
        spacing: 4

        Image
        {
            id:image
            Layout.fillWidth: true
            Layout.fillHeight: true
            source:"2436.png"
        
}

        ProgressBar
        
{
            id
:progresBar
            visible: false
            Layout.fillWidth: true
            value:0.0
        
}

        Slider
        
{
            id
:slider1
            Layout.fillWidth: true
            orientation: Qt.Horizontal
            onValueChanged:
            {
                base.current = Math.floor(2560*value)
                var filename = "images/"+base.current+".png"
;
                image.source = filename
            
}
        }

        Timer
        
{
            interval
: 40
            running: true
            triggeredOnStart: true
;
            repeat
: true

            onTriggered:
            {
                base.current = base.current + 1
                if(base.current > 2560)
                    base.current = 0
;

                image.source = "images/" + base.current + ".png";
            
}
        }

        RowLayout
        
{
            Rectangle
            {
                Layout.fillWidth
: true
            
}

            Button
            
{
                text
:"预览"

                onClicked:
                {
                    if(progresBar.visible)
                    {
                        progresBar.visible = false
;
                    
}
                    else
                    
{
                        progresBar.visible = true;
                    
}
                }
            }

            Button
            
{
                text
:"剪切"

                onClicked:
                {
                    if(progresBar.visible)
                    {
                        progresBar.visible = false
;
                    
}
                    else
                    
{
                        progresBar.visible = true;
                    
}
                }
            }
        }
    }
}
posted on 2019-08-14 14:34 ccsdu2009 阅读(307) 评论(0)  编辑 收藏 引用 所属分类: QT编程

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