Advertisement
Guest User

Untitled

a guest
May 31st, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.76 KB | None | 0 0
  1. import QtQuick 2.12
  2. import QtQuick.Window 2.12
  3.  
  4. Window {
  5.     visible: true
  6.     width: 640
  7.     height: 480
  8.     title: qsTr("Hello World")
  9.  
  10.     Rectangle {
  11.         anchors.fill: parent
  12.         color: "green"
  13.         MouseArea {
  14.             anchors.fill: parent
  15.             propagateComposedEvents: true
  16.             onClicked: {
  17.                 console.log("clicked green")
  18.                 mouse.accepted = false
  19.             }
  20.         }
  21.     }
  22.  
  23.     Rectangle {
  24.         color: "blue"
  25.         width: 50; height: 50
  26.  
  27.         MouseArea {
  28.             anchors.fill: parent
  29.             propagateComposedEvents: true
  30.             onClicked: {
  31.                 console.log("clicked blue")
  32.                 mouse.accepted = false
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement