Results 1 to 2 of 2

Thread: GraphicsView Framework

  1. #1
    Join Date
    Sep 2008
    Posts
    18
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question GraphicsView Framework

    I know this is probably a stupid question, but if you put say two QGraphicsPixmapItems into a scene and you view it with QGraphicsView, how do you keep the Items from overlapping?

    *Sorry, just noticed I posted my other one in the wrong thread...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GraphicsView Framework

    If you want to force items not to overlap, reimplement QGraphicsItem::itemChange() for them - detect a collision and move the item so that it doesn't overlap.There is an example in the docs how to do it (only that in the example it makes sure not to move the item outside current scene bounds).

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

    RY (2nd October 2008)

Similar Threads

  1. Newbie: Circuits and GraphicsView
    By RY in forum Newbie
    Replies: 10
    Last Post: 1st October 2008, 06:12
  2. Newbie: GraphicsView Framework
    By RY in forum Qt Programming
    Replies: 1
    Last Post: 10th September 2008, 06:09
  3. Qt 4.3 incompatible with .NET framework 2.0 servicepack?
    By jobrandt in forum Installation and Deployment
    Replies: 3
    Last Post: 23rd February 2008, 10:40
  4. Generic Component Framework
    By prashanthudupa in forum Qt-based Software
    Replies: 5
    Last Post: 4th October 2007, 13:16
  5. Integrating Qt applications in a Framework
    By kewltea in forum Newbie
    Replies: 1
    Last Post: 15th November 2006, 08:01

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.