Results 1 to 2 of 2

Thread: QML Flickable doesn't send all mouse events to unterlaying QGraphicsProxyWidget!

  1. #1
    Join Date
    Jun 2010
    Posts
    31
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QML Flickable doesn't send all mouse events to unterlaying QGraphicsProxyWidget!

    Hi all,

    Im using Qt 4.8.2 / QtQuick 1.1 on Windows with VS2010.

    I want to "show" a complex QGraphicsScene in QML. The goal of the scene is to be like a visual editor where you can select items (e.g. labels) and position them free inside its parent item (circuit board).

    When I "expose" the scene/view through QGraphicsProxyWidget and instantiate it in a QML file and loads it via QDeclarativeView it works - I can select/move the items and the implemented C++ function for pinch/pan gestures are working (transfoming the views matrix).

    But when I use a QML horizontal flickable (flick from left to right and backwards) and puts the "exposed" scene/view on one of flickables pages then the flickable catches all mouse move events. I can select a scene's item to move it up/down but move it to left/right the flickable begins to flick to next page.

    I tried all... overloading QGraphicsScene/View/QGraphicsProxyWidget::mouseMoveEvent(), keyPressEvent(), ... with the result:

    mouseMoveEvent() is called few times before the flickable starts.
    keyPressEvent() never called.

    It seems the flickable doesn't propagate the events to underlaying widgets "exposed" from C++.

    But when you implement a simple image viewer with pinch/pan gestures in QML and you are "pinch" on the image the viewer catches the events and works - the flickable doesn't start to flick to next page.

    I don't know if that is a flickable bug or I understand something wrong. But I think it's typically to implement the programs logical layer, here a complex scene, in C++ and expose it to QML for displaying it.

    Catching all events in QML an sends it explicitly to the "exposed" class needs to much overhead - I can't believe that this is the right solution.

    Any ideas? Attached is my current sample program.
    Thanks a lot.

    GraphTest.zip

  2. #2
    Join Date
    Jun 2010
    Posts
    31
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QML Flickable doesn't send all mouse events to unterlaying QGraphicsProxyWidget!


Similar Threads

  1. Replies: 0
    Last Post: 16th September 2012, 10:28
  2. Replies: 1
    Last Post: 16th November 2011, 00:00
  3. Not possible to send mouse events to QMainWindow??
    By saracaeus in forum Qt Programming
    Replies: 8
    Last Post: 20th September 2011, 13:01
  4. QGraphicsProxyWidget and touch events
    By johnsoga in forum Qt Programming
    Replies: 0
    Last Post: 21st February 2010, 06:53
  5. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.