Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: QGraphicsView mouse events

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsView mouse events

    You are calling the base class implementation so the view forwards events to the scene which forwards them to the item.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #22
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView mouse events

    I thought the logic was the other way around. The most specific item is called first, which would be the graphics item, and then the event is propagated up until some object accepts it.

    But anyhow, I HAVE to call the base implementation in order to use the functionality provided by the Graphics View Framework. And I also have to remimplement the mouse events in the view and the scene to do custom things. So how can I for example detect the the item is being dragged and not the view, if view and item both react to the mouse move event?

  3. #23
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsView mouse events

    Quote Originally Posted by Cruz View Post
    I thought the logic was the other way around. The most specific item is called first, which would be the graphics item, and then the event is propagated up until some object accepts it.
    You click on the view so it is the first one to get the event.

    But anyhow, I HAVE to call the base implementation in order to use the functionality provided by the Graphics View Framework. And I also have to remimplement the mouse events in the view and the scene to do custom things. So how can I for example detect the the item is being dragged and not the view, if view and item both react to the mouse move event?
    Store additional information somewhere that you have already handled the event and check that information on every level (view, scene, item) of event handling.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 9
    Last Post: 22nd June 2008, 22:26
  2. Replies: 2
    Last Post: 2nd April 2008, 14:19
  3. Weird behaviour of mouse events and QMenu pop-ups
    By Ishark in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 07:46
  4. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13
  5. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25

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
  •  
Qt is a trademark of The Qt Company.