Results 1 to 3 of 3

Thread: How to don't fitInView a QGraphicsItem

  1. #1
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default How to don't fitInView a QGraphicsItem

    Hi,

    in my app some QGraphicsItems are created when the user clicks on the scene, and my idea is to create it in the place the user's click.

    But, the view moves and it's created on the center of the screen (if there are no other items), is ok for other items, but not specifically for those.

    I was checking fitInViewand ensureVisible, but they do the opposite.

    thanks!

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: How to don't fitInView a QGraphicsItem

    Hi,

    If it's moving then , after each movement you need to re-set the positions of your existing items currently in the scene one by one. Have you ever tried it?

  3. #3
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: How to don't fitInView a QGraphicsItem

    mmmh... yep, it could be a solution; but if Qt has "ensureVisible" and "center()" and all of this stuff it should have something to disable those functions. Because my problem is not the position of my items, I think my problem comes because any automatic function of the view or a flag I'm not able to find or something like that.

Similar Threads

  1. QGraphicsItem doesn't inherit QObject?
    By xyzt in forum Qt Programming
    Replies: 6
    Last Post: 26th September 2011, 14:59
  2. Replies: 2
    Last Post: 25th March 2011, 09:18
  3. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  4. Replies: 11
    Last Post: 2nd July 2009, 00:41
  5. Replies: 1
    Last Post: 25th February 2009, 00:34

Tags for this Thread

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.