Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Wacom and Qt Quick 2

Wacom and Qt Quick 2

Scheduled Pinned Locked Moved QML and Qt Quick
9 Posts 3 Posters 3.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Korchkidu
    wrote on last edited by
    #1

    Hi,

    I want to retrieve events from a Wacom Bamboo and use them for Zoom, Pan and Rotate behavior in a Qt Quick 2 application.

    Looking at photosurface example, it seems they are doing something like:

    @ MouseArea
    {
    id: dragArea
    hoverEnabled: true
    anchors.fill: parent

        onWheel:
        {
          if (wheel.modifiers & Qt.ControlModifier)
          {
             ...
          }
          else
          {
             ...
          }
        }
      }@
    

    However, wheel event does not provide enough information to determine the gesture performed. And photosurface example does not work correctly with Wacom Bamboo. So, what is the correct way to integrate Wacom device with a Qt Quick 2 application?

    ADDITIONAL INFORMATION

    PAN

    !http://i.stack.imgur.com/D79FX.png!

    The events I get are (changing values are surrounded by "<< >>", specific values with respect to other gestures are surrounded by "== =="):

    @ wheel.buttons: 0
    wheel.modifiers: == 0 ==
    wheel.pixelDelta: QPoint(0, 0)
    wheel.angleDelta: QPoint(0, << 21 >>)
    wheel.x: 205
    wheel.y: 279@

    Here, only one value changed for both vertical and horizontal pan.

    ZOOM

    !http://i.stack.imgur.com/ZyL3A.png!

    The events I get are (changing values are surrounded by "<< >>", specific values with respect to other gestures are surrounded by "== =="):

    Here, the same value is changing. Note that zoom gesture is sent as a "Ctrl + mouse wheel" event

    @ wheel.buttons: 0
    wheel.modifiers: == 67108864 ==
    wheel.pixelDelta: QPoint(0, 0)
    wheel.angleDelta: QPoint(0, << 40 >>)
    wheel.x: 323
    wheel.y: 291@

    ROTATE
    I get the exact same values as for the ZOOM gesture...

    Thanks for any help and best regards.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3685
      wrote on last edited by
      #2

      Have you tried looking at this:

      http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-pincharea.html#details

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Korchkidu
        wrote on last edited by
        #3

        I tried this with no success (no output):

        @import QtQuick 2.2

        Rectangle
        {
        width: 360
        height: 360
        PinchArea
        {
        id: pinchArea
        anchors.fill: parent
        enabled: true

        onPinchUpdated: console.log("PIIIIIIIIINCH")
        onPinchStarted: console.log("PIIIIIIIIINCH")
        onPinchFinished: console.log("PIIIIIIIIINCH")
        

        }
        }
        @

        1 Reply Last reply
        0
        • A Offline
          A Offline
          agocs
          wrote on last edited by
          #4

          The wheel event is not useful here, that is for mouse wheels only.

          In theory PinchArea and MultiPointTouchArea should work with finger touch on the Bamboo, but there might be some platform specific glitches. Which platform are you on?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Korchkidu
            wrote on last edited by
            #5

            In the photosurface example, they are using the mouse wheel. I believe that Wacom converts touch events into mouse wheel events...

            I already tried using PinchArea (see my previous post) with no success.

            I just tried using MultiPointTouchArea with no success (no output):

            @import QtQuick 2.2

            Rectangle
            {
            width: 360
            height: 360

            MultiPointTouchArea
            {
            id: multiPointTouchArea
            anchors.fill: parent
            enabled: true

            onCanceled: console.log("PIIIIIIIIINCH")
            onGestureStarted: console.log("PIIIIIIIIINCH")
            onPressed: console.log("PIIIIIIIIINCH")
            onReleased: console.log("PIIIIIIIIINCH")
            onTouchUpdated: console.log("PIIIIIIIIINCH")
            onUpdated: console.log("PIIIIIIIIINCH")
            

            }
            }
            @

            I am using Windows 7 + Wacom Bamboo with Qt 5.2.1 for MSVC2012. I need to implement Zoom, Rotate and Pan in a Qt Quick 2 application. I could also, while not optimal, live with a solution using C++ Qt Widgets integrated into a Qt Quick 2 application;)

            I just tested the same QML script on a Mac Pro (Mac OSX 10.9) and still no success...;(

            Thanks for your help and best regards.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Korchkidu
              wrote on last edited by
              #6

              Hi,

              I am still looking for a solution. Even if it involves using the C++ Qt API instead of Qt Quick.

              Best regards.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                agocs
                wrote on last edited by
                #7

                You are right, the Bamboo sends mouse wheel events and control key events for zooming.

                The photosurface example works in fact with the Bamboo but not out of the box. If you check photosurface.qml, there's a MouseArea that handles the wheel events. The problems are that

                1. it rotates for ctrl+wheel which is somewhat unintuitive and does not play well with what the Bamboo and other apps are doing. (Ctrl+wheel should zoom instead)

                2. the angleDelta values are much higher for real mice

                Changing the code to something like
                @
                onWheel: {
                if (!(wheel.modifiers & Qt.ControlModifier)) {
                ...
                } else {
                photoFrame.rotation += wheel.angleDelta.x * 10 / 120;
                ...
                image.scale += image.scale * wheel.angleDelta.y * 10 / 120 / 10;
                ...
                }
                }
                @

                makes at least zoom working with the Bamboo.

                Pan should just work. Not sure about rotate however. That does not seem to send any wheel events.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Korchkidu
                  wrote on last edited by
                  #8

                  Thanks for your help.

                  The main problem is that ROTATE and ZOOM gestures are sent "the same way". So there is no way to differentiate them. For the pan, horizontal values are missing unfortunately.

                  It seems that Wacom QML support is lacking somehow. Any idea if a pure C++ solution is working somewhere?

                  UPDATE: after double check, it seems that nothing is sent for ROTATE indeed, you are right.
                  Thanks and best regards.

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    Korchkidu
                    wrote on last edited by
                    #9

                    Any update on this with the new Qt 5.3?

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved