Ubuntu Pastebin

Paste from dubstar_04 at Tue, 23 Jun 2015 10:22:16 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
      MouseArea {
        id: mouseSpace
        anchors.fill:parent
        hoverEnabled: true
        acceptedButtons: Qt.LeftButton | Qt.RightButton
        onPositionChanged: {
            //var pos = mapToItem(canvas, mouse.x, mouse.y)
           // console.log("Canvas Size: " + canvas.canvasWindow)
           // console.log("X: " + mouse.x + " Y: " + mouse.y + " PosX: " + pos.x + " PosY: " + pos.y);

        }
        onClicked:{

            if (mouse.button == Qt.RightButton){
               //console.log("right click")
               Scene.addItem("Line", canvas)

            }
            if (mouse.button == Qt.LeftButton){
            //console.log(mouse.x,mouse.y);
            //var pos = mapToItem(null, mouse.x, mouse.y)
            Scene.handleClick(mouse.x,mouse.y);
            //Scene.handleClick(pos.x,pos.y);
            }

            }

        onWheel: {

            console.log(wheel.angleDelta.y)
         }

        }
Download as text