Advertisement
TheGringerEye

Untitled

Sep 6th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 2.98 KB | None | 0 0
  1. import QtQuick 2.7
  2. import QtQuick.Controls 2.0
  3. import QtQuick.Layouts 1.3
  4.  
  5. ApplicationWindow {
  6.     visible: true
  7.     width: 640
  8.     height: 480
  9.  
  10.     Rectangle
  11.     {
  12.         anchors.fill: parent
  13.         Rectangle
  14.         {
  15.             anchors.bottom: parent.bottom
  16.             anchors.left: parent.left
  17.             width: 120
  18.             height: 200
  19.             Rectangle
  20.             {
  21.                 id:contollerForce
  22.                 width: 60
  23.                 height: 160
  24.                 color: "lightgray"
  25.                 opacity: 0.2
  26.                 border.color: "black"
  27.                 border.width: 3
  28.                 radius: width*0.5
  29.                 anchors.centerIn: parent
  30.  
  31.                 MouseArea
  32.                 {
  33.                     anchors.fill: parent
  34.                     drag.target: contollerForcePoint
  35.                     drag.axis: Drag.YAxis
  36.                     drag.minimumY: parent.y-contollerForcePoint.height/4-3.5
  37.                     drag.maximumY: parent.height-contollerForcePoint.height-4
  38.                     onReleased: contollerForcePoint.y = 55
  39.                 }
  40.  
  41.                 Rectangle
  42.                 {
  43.                     id:contollerForcePoint
  44.                     x: parent.width/2-width/2
  45.                     y: parent.height/2-height/2
  46.                     width: 50
  47.                     height: 50
  48.                     color: "gray"
  49.                     opacity: 0.5
  50.                     border.color: "black"
  51.                     border.width: 1
  52.                     radius: width*0.5
  53.                 }
  54.             }
  55.         }
  56.  
  57.  
  58.         Rectangle
  59.         {
  60.             anchors.bottom: parent.bottom
  61.             anchors.right: parent.right
  62.             width: 200
  63.             height: 200
  64.             Rectangle
  65.             {
  66.                 id:contollerRotate
  67.                 width: 160
  68.                 height: 60
  69.                 color: "lightgray"
  70.                 opacity: 0.2
  71.                 border.color: "black"
  72.                 border.width: 3
  73.                 radius: width*0.5
  74.                 anchors.centerIn: parent
  75.  
  76.                 MouseArea
  77.                 {
  78.                     anchors.fill: parent
  79.                     drag.target: contollerRotatePoint
  80.                     drag.axis: Drag.XAxis
  81.                     drag.minimumX: parent.x-contollerRotatePoint.width/4-3.5
  82.                     drag.maximumX: parent.width-contollerRotatePoint.width-4
  83.                     onReleased: contollerRotatePoint.x = 55
  84.                 }
  85.  
  86.                 Rectangle
  87.                 {
  88.                     id: contollerRotatePoint
  89.                     x: parent.width/2-width/2
  90.                     y: parent.height/2-height/2
  91.                     width: 50
  92.                     height: 50
  93.                     color: "gray"
  94.                     opacity: 0.5
  95.                     border.color: "black"
  96.                     border.width: 1
  97.                     radius: width*0.5
  98.                 }
  99.             }
  100.         }
  101.  
  102.     }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement