Results 1 to 3 of 3

Thread: Send a mouse right click into QGRaphicsScene

  1. #1
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Send a mouse right click into QGRaphicsScene

    Hi,

    how can I perform a mouse press button by code into a QGraphicsView/QGraphicsScene?

    I tried to create a QMouseEvent and execute a myView::QGraphicsMouseEvent(event) but it doesn't seem to work.

    any other idea?

    thanks!

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Send a mouse right click into QGRaphicsScene

    Try sending event with QApplication::sendEvent

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Send a mouse right click into QGRaphicsScene

    I tried to create a QMouseEvent and execute a myView::QGraphicsMouseEvent(event) but it doesn't seem to work.
    You need to set call QGraphicsView::mousePressEvent(event) at the end of yourView::mousePressEvent(event) method in order to catch it in the scene.

Similar Threads

  1. Replies: 2
    Last Post: 1st August 2008, 16:58
  2. how to send a emulated mouse event to QListWidget
    By yxmaomao in forum Qt Programming
    Replies: 4
    Last Post: 22nd July 2008, 02:49
  3. QListWidget right-mouse click
    By Skizmo in forum Qt Programming
    Replies: 6
    Last Post: 20th June 2007, 13:13
  4. QGraphicsScene Click / Double Click
    By philentropist in forum Qt Programming
    Replies: 1
    Last Post: 9th February 2007, 04:32
  5. mouse click in QGprahicsScene
    By Morea in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2006, 08:21

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.