Results 1 to 2 of 2

Thread: Mouse press event detection

  1. #1
    Join Date
    Jun 2009
    Posts
    29
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Mouse press event detection

    I have drawn a circle from a svg file using QSvgGraphicsItem. Recently, my mousePressEvent(QGraphicsSceneMouseEvent *event) function detects mouse press within the bounding rectangle of my QSvgGraphicsItem. But, I want to get mousepress only for the circular region(when mouse is clicked on the circle), not within the bounding rectangle.

    What Should I do exactly?

    Mahfuz

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Mouse press event detection

    Reimplement QGraphicsItem::shape() and return the circular region.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    A.H.M. Mahfuzur Rahman (14th June 2009)

Similar Threads

  1. Checking for key press on mouse event
    By Cruz in forum Newbie
    Replies: 1
    Last Post: 24th January 2009, 19:18
  2. Replies: 2
    Last Post: 2nd April 2008, 15:19
  3. Replies: 1
    Last Post: 24th October 2007, 19:34
  4. The event fired by the mouse click on the frame
    By Placido Currò in forum Qt Programming
    Replies: 8
    Last Post: 3rd March 2007, 10:05
  5. Draw QtCanvasElipse on mouse press event position
    By YuriyRusinov in forum Newbie
    Replies: 1
    Last Post: 31st May 2006, 12:57

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.