Forums

OverviewV-Play 2 Support (Qt 5) › Qt Quick Pointer Handlers in V-Play Live Web Editor

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18835

    Javier

    The V-Play live web editor is really cool and useful, great work!

    I checked that Qt Quick pointer handlers are not supported. Are there any plans to support this feature?.

    Thanks,
    Javier.

    #18900

    Günther
    V-Play Team

    Hi Javier,

    it is not supported at the moment as it’s still in tech preview. The V-Play Live Client does not yet support it, but we update it regularly to make new features of V-Play and Qt available. I’ll note your suggestion to add the feature, it will definitely be part of V-Play Live once it moves from tech-preview to stock libs.

    Best,
    Günther

    #18914

    Javier

    Hi Günther,

    Thank you for the information. The reason why I am interested in this feature it is because in case of having an item that can be moved and zoomed at the same time, something that it is common when working with pictures.

    This can be currently done with a Flickable + PinchArea. However, this does not work well with the latest Qt version. This is really an issue in Qt/QML than a V-Play issue. Let’s take this example, that I copied from http://www.qtcentre.org/threads/66562-Flickable-and-PinchArea-interoperability.

    In this post, it is mentioned that the example works fine if the target is inside the pinch area, but I checked that with the latest Qt version, it does not work well in any kind of combination. The reason is that when you hit the item with one finger the Flickable captures the event for dragging. If you want to zoom in or out you have to hit the item with two fingers at the same time, which is quite difficult and presents a bad fluid UI experience.

    import VPlayApps 1.0
    import VPlay 1.0
    import QtQuick 2.0
    import QtGraphicalEffects 1.0
    
    App {
    
        Rectangle
        {
            width: 400; height: 400
    
            Flickable {
                id: f1
                anchors { fill: parent; margins: 2 }
                contentWidth: 700
                contentHeight: 700
                clip: true
                boundsBehavior: Flickable.StopAtBounds
    
                PinchArea {
                    width: Math.max(f1.contentWidth, f1.width)
                    height: Math.max(f1.contentHeight, f1.height)
    
                    property real initialWidth
                    property real initialHeight
    
                    onPinchStarted: {
                        initialWidth = f1.contentWidth
                        initialHeight = f1.contentHeight
                    }
    
                    onPinchUpdated: {
                        f1.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale, pinch.center)
                    }
    
                    Rectangle {
                        width: f1.contentWidth
                        height: f1.contentHeight
                        color: "white"
    
                        RadialGradient
                        {
                            anchors.fill: parent
                            gradient: Gradient{
                                GradientStop { position: 0.0; color: "blue" }
                                GradientStop { position: 0.25; color: "cyan" }
                                GradientStop { position: 0.5; color: "green" }
                                GradientStop { position: 0.75; color: "red" }
                                GradientStop { position: 1; color: "orange" }
                            }
                        }
                    }
                }
            }
        }
    }
    

    The good news is that this issue is solved with Qt Quick pointer handlers, a component called FakeFlickable + PinchHandler are used in this example, http://code.qt.io/cgit/qt/qtdeclarative.git/tree/tests/manual/pointer/photosurface.qml. It works as expected we can drag with one finger and when another finger hits the item it can be zoom in or out fluently.

    This is already working in V-Play and great if it will be also supported in the V-Play live client and web editor in the future.

    #18915

    Javier
    #18963

    Alex
    V-Play Team

    Hi Javier,

    thanks for the great examples. We will add support for pointer handlers in V-Play Live very soon, as they are a great addition indeed. You can already use them with normal deployment of course.

    Cheers,
    Alex

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support