Results 1 to 2 of 2

Thread: Increasing the selection area for a qgraphicsPathitem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Posts
    39
    Thanks
    10

    Default Increasing the selection area for a qgraphicsPathitem

    Hi all

    I am having a problem with my QGraphicView framework. I want to select an QGraphcsPathItem by clicking on an an area surrounding the item. This area is +5 pixels on all sides on the item's bounding rect. I did the following:

    QRectF boundingRect() const
    { return QGraphicsItem::boundingRect().adjusted(-5, -5, +5, +5); }

    bool contains(const QPointF &point) const
    { return boundingRect().contains(point); }
    The mouse click on the area surrounding the boundingRect is received by the item. I checked this by subclassing the mousePressEvent(). But the item is not getting selected this way. The item is a pathItem. So would it only get selected if clicked on the path?

    Thanks
    Arjun
    Last edited by arjunasd; 17th August 2007 at 22:38.

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.