Results 1 to 2 of 2

Thread: MouseEvent in QGraphics Scene?

  1. #1
    Join Date
    Sep 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default MouseEvent in QGraphics Scene?

    Qt Code:
    1. void DragDropImage::mousePressEvent(QGraphicsSceneMouseEvent *event)
    2. {
    3. // how can i find out witch item was pressed on the QGraphicsScene ?
    4. }
    To copy to clipboard, switch view to plain text mode 

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: MouseEvent in QGraphics Scene?

    The event has a point. You can use that point to get the item from the scene via itemAt(...)

Similar Threads

  1. Animation and QGraphics
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2009, 00:31
  2. mouseEvent with two mice
    By yun in forum Newbie
    Replies: 0
    Last Post: 6th May 2009, 10:25
  3. Creating a scene from piece of another scene
    By maverick_pol in forum Qt Programming
    Replies: 3
    Last Post: 23rd August 2007, 17:51
  4. Deleting a scene from QGraphicsItem mouseEvent
    By JonathanForQT4 in forum Qt Programming
    Replies: 5
    Last Post: 10th April 2007, 11:27
  5. MouseEvent & QTextEdit
    By Sarma in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2006, 23:06

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.