Results 1 to 4 of 4

Thread: overlapping QGraphicsItem problem!!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    37
    Thanked 53 Times in 40 Posts

    Default Re: overlapping QGraphicsItem problem!!

    Quote Originally Posted by boss_bhat View Post
    I mean to say the square which has the mouse press event should be the top surface when it is overlapping with another square.
    I am sorry as I couldn't understand your problem properly. Any way I feel you are looking for QGraphicsItem::setZvalue(). (Not sure though)
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

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

    Default Re: overlapping QGraphicsItem problem!!

    yes he will have to use setZValue... the z values set initially remain so during the program.If you need that the item should come on top, set the zvalue to a highest value on mouse press so that it is drawn on top of others...
    dont forget to set it back to original zvalue, if u are manipulating the items based on zvalue

  3. #3
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    37
    Thanked 53 Times in 40 Posts

    Default Re: overlapping QGraphicsItem problem!!

    Looks like there is again problem with boundingRect() as you did it here

    boundingRect() should return the bounding area of the item appropriately (For eg square of dim 0,0,100,100 should return not more or less than QRectF(0,0,100,100) ) otherwise it will cause all nuisances like above and also will significantly slow down your program.
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

Similar Threads

  1. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 11:31
  2. QGraphicsItem problem - how to save items info ??
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 17th October 2006, 13:17
  3. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 13:54
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 22:36
  5. Replies: 16
    Last Post: 7th March 2006, 16: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
  •  
Qt is a trademark of The Qt Company.