Simulations component press



  • I have two items on my app a joystick and a rectangle with 4 buttons. And i am handling the onPressed events of these items separately and they have their own logic. The problem is i cant press the button when i am moving the joystick. Any idea / suggestions to overcome this issue

    0_1522129727334_Screenshot_2018-03-27-11-15-21-683_org.qtproject.example.png



  • hi @DonBrowny ,
    I think you'll need a multipointtoucharea

    I belive a normal mousearea simulates a mouse event, and you can't click on multiple elements simultaniously with a single mouse :)



  • hi @J-Hilk thx for your suggestion, i went through the documentation of multipointtoucharea but was unable to get how to implement the touchpoint in my scenario. This qtquick-touchinteraction example gave a rough idea about it, will try it and let you know :)



  • Hi @J.Hilk I have used the below sample code to attain multi-touch for two joystick but i ends up with a blank screen.. am i missing something

    Window {
      id: window
      visible: true
      width: 480
      height: 640
      color: "#F26E55"
      title: qsTr("Hello World")
    
      MultiPointTouchArea{
          maximumTouchPoints: 3
          anchors.fill: parent.fill
          touchPoints: [
              TouchPoint{
                  id:leftTumb
                  property QtObject leftstick: Joystick{
                      anchors.top: parent.top
                      anchors.topMargin: 8
                      anchors.left: parent.left
                      anchors.leftMargin: 8
                   }
              },
              TouchPoint{
                  id: rightTumb
                  property QtObject rightstick: Joystick{
                      anchors.bottom: parent.bottom
                      anchors.bottomMargin: 8
                      anchors.left: parent.left
                      anchors.leftMargin: 8
                   }
              }
          ]
      }
    }

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.