|
@@ -1,68 +1,180 @@
|
|
-import QtQuick 2.11
|
|
|
|
-import QtQuick.Window 2.11
|
|
|
|
|
|
+//import QtQuick 2.11
|
|
|
|
+//import QtQuick.Window 2.11
|
|
|
|
+//import QtGraphicalEffects 1.0
|
|
|
|
+
|
|
|
|
+//Window {
|
|
|
|
+// id: window
|
|
|
|
+// visible: true
|
|
|
|
+// width: 640
|
|
|
|
+// height: 480
|
|
|
|
+// title: qsTr("App")
|
|
|
|
+
|
|
|
|
+// QtObject{
|
|
|
|
+// id: d
|
|
|
|
+
|
|
|
|
+// property var images: []
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// Rectangle{
|
|
|
|
+// id: rect
|
|
|
|
+// width: parent.width
|
|
|
|
+// height: 240
|
|
|
|
+// x: 0
|
|
|
|
+// y: 0
|
|
|
|
+// color: "lightblue"
|
|
|
|
+
|
|
|
|
+// Text{
|
|
|
|
+// id: txt
|
|
|
|
+
|
|
|
|
+// property int counter: 0
|
|
|
|
+
|
|
|
|
+// anchors.centerIn: parent
|
|
|
|
+// font.pointSize: 30
|
|
|
|
+// color: "black"
|
|
|
|
+// text: counter
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// MouseArea{
|
|
|
|
+// property int counter: 0
|
|
|
|
+// anchors.fill: parent
|
|
|
|
+// onClicked: {
|
|
|
|
+// rect.grabToImage(function(result) {
|
|
|
|
+//// img.source = result.url
|
|
|
|
+// ++txt.counter
|
|
|
|
+//// imageManager.get(result.image)
|
|
|
|
+// result.saveToFile("C://Documents/%1.png".arg(counter))
|
|
|
|
+// })
|
|
|
|
+// ++counter
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// Image{
|
|
|
|
+// id: img
|
|
|
|
+// width: parent.width
|
|
|
|
+// height: parent.height - rect.height
|
|
|
|
+// x: 0
|
|
|
|
+// y: 240
|
|
|
|
+// asynchronous: true
|
|
|
|
+// mipmap: true
|
|
|
|
+
|
|
|
|
+// MouseArea{
|
|
|
|
+// anchors.fill: parent
|
|
|
|
+// onClicked: imageManager.saveAll()
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+//}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import QtQuick 2.0
|
|
|
|
+import QtQuick.Window 2.0
|
|
|
|
+import QtQuick.Controls 2.0
|
|
import QtGraphicalEffects 1.0
|
|
import QtGraphicalEffects 1.0
|
|
|
|
|
|
-Window {
|
|
|
|
|
|
+ApplicationWindow {
|
|
id: window
|
|
id: window
|
|
visible: true
|
|
visible: true
|
|
width: 640
|
|
width: 640
|
|
height: 480
|
|
height: 480
|
|
title: qsTr("App")
|
|
title: qsTr("App")
|
|
|
|
|
|
- QtObject{
|
|
|
|
- id: d
|
|
|
|
|
|
|
|
- property var images: []
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
+ footer: TabBar{
|
|
|
|
+ width: parent.width
|
|
|
|
+ TabButton {
|
|
|
|
+ icon.source: "qrc:/images/stop.png"
|
|
|
|
+ icon.width: 48
|
|
|
|
+ icon.height: 48
|
|
|
|
+ width: window.width / 3 - 2
|
|
|
|
+ onClicked: {
|
|
|
|
+// imageManager.saveAll()
|
|
|
|
+// imageManager.createVideo()
|
|
|
|
+ videoManager.makeVideo("C://Documents/", timer.counter)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ TabButton {
|
|
|
|
+ icon.source: "qrc:/images/start.png"
|
|
|
|
+ icon.width: 48
|
|
|
|
+ icon.height: 48
|
|
|
|
+ width: window.width / 3 - 2
|
|
|
|
+ onClicked: {
|
|
|
|
+ anim.start()
|
|
|
|
+ timer.start()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ TabButton {
|
|
|
|
+ icon.source: "qrc:/images/pause.png"
|
|
|
|
+ icon.width: 48
|
|
|
|
+ icon.height: 48
|
|
|
|
+ width: window.width / 3 - 2
|
|
|
|
+ onClicked: {
|
|
|
|
+ anim.stop()
|
|
|
|
+ timer.stop()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
Rectangle{
|
|
Rectangle{
|
|
- id: rect
|
|
|
|
|
|
+ id: area
|
|
width: parent.width
|
|
width: parent.width
|
|
- height: 240
|
|
|
|
- x: 0
|
|
|
|
- y: 0
|
|
|
|
- color: "lightblue"
|
|
|
|
-
|
|
|
|
- Text{
|
|
|
|
- id: txt
|
|
|
|
|
|
+ height: parent.height
|
|
|
|
+ color: "black"
|
|
|
|
|
|
- property int counter: 0
|
|
|
|
|
|
+ Rectangle{
|
|
|
|
+ id: rect
|
|
|
|
+ width: 30
|
|
|
|
+ height: 30
|
|
|
|
+ radius: 5
|
|
|
|
|
|
- anchors.centerIn: parent
|
|
|
|
- font.pointSize: 30
|
|
|
|
- color: "black"
|
|
|
|
- text: counter
|
|
|
|
|
|
+ x: 10
|
|
|
|
+ y: 10
|
|
|
|
+ color: "lightblue"
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
+ MyLoader{
|
|
|
|
+ id: loaderIndicator
|
|
|
|
+ barCount: 3
|
|
|
|
+ anchors.centerIn: parent
|
|
|
|
+ width: parent.width * 0.5
|
|
|
|
+ height: parent.height / 4
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- MouseArea{
|
|
|
|
- anchors.fill: parent
|
|
|
|
- onClicked: {
|
|
|
|
- rect.grabToImage(function(result) {
|
|
|
|
- img.source = result.url
|
|
|
|
- ++txt.counter
|
|
|
|
- imageManager.get(result.image)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ SequentialAnimation{
|
|
|
|
+ id: anim
|
|
|
|
+ loops: Animation.Infinite
|
|
|
|
+ PropertyAnimation{target: rect; properties: "x"; to: area.width - rect.width - 10; duration: 1000}
|
|
|
|
+ PropertyAnimation{target: rect; properties: "y"; to: area.height - rect.height - 10; duration: 1000}
|
|
|
|
+ PropertyAnimation{target: rect; properties: "x"; to: 10; duration: 1000}
|
|
|
|
+ PropertyAnimation{target: rect; properties: "y"; to: 10; duration: 1000}
|
|
}
|
|
}
|
|
|
|
|
|
- Image{
|
|
|
|
- id: img
|
|
|
|
- width: parent.width
|
|
|
|
- height: parent.height - rect.height
|
|
|
|
- x: 0
|
|
|
|
- y: 240
|
|
|
|
- asynchronous: true
|
|
|
|
- mipmap: true
|
|
|
|
|
|
|
|
- MouseArea{
|
|
|
|
- anchors.fill: parent
|
|
|
|
- onClicked: imageManager.saveAll()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ Timer{
|
|
|
|
|
|
|
|
+ property int counter: 0
|
|
|
|
+
|
|
|
|
+ id: timer
|
|
|
|
+ interval: 40
|
|
|
|
+ repeat: true
|
|
|
|
+ running: false
|
|
|
|
+ onTriggered: {
|
|
|
|
+ area.grabToImage(function(result) {
|
|
|
|
+ result.saveToFile("C://Documents/%1.png".arg(counter++))
|
|
|
|
+// imageManager.append(result.image)
|
|
|
|
+ })
|
|
|
|
+ ++counter
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|