Results 1 to 5 of 5

Thread: QGraphicsItem -> boundingRect()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    33
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QGraphicsItem -> boundingRect()

    hi,

    i've got a problem with a QGraphicsItem. I wrote a class GraphicsLine:
    Qt Code:
    1. GraphicsLine::GraphicsLine( int id, qreal x1, qreal y1, qreal x2, qreal y2 ) : QGraphicsItem()
    To copy to clipboard, switch view to plain text mode 

    In order to do so, i had to reimplementent boundingRect. I want each Object of GraphicsLine to change it's color to red if the mouse is hovered above it.
    So far, everything works fine.

    But if two lines cross each other, only the most recently painted one changes it color because it's bounding box lies above the other one.

    Example attached

    how can i mark all lines underneath the mouse pointer?
    Attached Images Attached Images
    Last edited by harakiri; 6th March 2008 at 13:11.

Similar Threads

  1. QGraphicsView, QGraphicsItem, QGraphicsScene
    By Shuchi Agrawal in forum Newbie
    Replies: 10
    Last Post: 23rd March 2011, 20:50
  2. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  3. rotation of an animated QGraphicsItem
    By darksaga in forum Qt Programming
    Replies: 9
    Last Post: 9th September 2007, 08:11
  4. Force the painting of a QGraphicsItem
    By fabietto in forum Qt Programming
    Replies: 3
    Last Post: 2nd July 2007, 21:28
  5. QGraphicsItem and signals
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2006, 11:19

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.