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;
}
}
}
}
}
}