Results 1 to 9 of 9

Thread: QGraphicsItemGroup childItems() returns only count()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Location
    Moscow, Russia
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsItemGroup childItems() returns only count()

    Em... The initial position is hardly 0,0... Look at the picture attached. Black dots are points.

  2. #2
    Join Date
    Feb 2011
    Posts
    2
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QGraphicsItemGroup childItems() returns only count()

    Hi Kefir,

    you should use scenePos() to get the position of your items AFIK the pos() method will return 0,0 i.e origin of the item itself in local coordinates. Though Qt documentation says that a parent less item will return position coordinates in terms of Scene. From the code and snap shot it seems that you are developing a GIS application. I would appreciate if you could share some information on your application I am also into GIS application development.

    With regards
    Sukesh

  3. #3
    Join Date
    Mar 2011
    Location
    Moscow, Russia
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsItemGroup childItems() returns only count()

    Thank you, Sukesh!

    But I have doubts that pos() returns origin of the item, as it
    Returns the position of the item in parent coordinates. If the item has no parent, its position is given in scene coordinates.
    ... But I'll try thinking in this direction...

    Actually it is GIS API. So far I succesfully load google/openstreet/yandex and GeoServer tiles, zoom in/out, add features by coordinate. I'm afraid I can't give you my sources as this development is for my company and it is not opensource. However I answer some questions and give you links that may help you)

Similar Threads

  1. QGrapchisSvgItem childItems list empty
    By Hogwarts in forum Qt Programming
    Replies: 1
    Last Post: 6th April 2011, 12:18
  2. problem in QGraphicsItemGroup
    By wagmare in forum Qt Programming
    Replies: 1
    Last Post: 14th May 2009, 08:27
  3. Add two QGraphicsItemGroup
    By ashishsaryar in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2008, 18:00
  4. QGraphicsItemGroup problem
    By init2null in forum Qt Programming
    Replies: 2
    Last Post: 20th November 2006, 22:45
  5. setZValue of QGraphicsItemGroup
    By forrestfsu in forum Qt Programming
    Replies: 3
    Last Post: 6th November 2006, 19:40

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.