1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 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{
- anchors.fill: parent
- onClicked: {
- rect.grabToImage(function(result) {
- img.source = result.url
- ++txt.counter
- imageManager.get(result.image)
- })
- }
- }
- }
- 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()
- }
- }
- }
|