Results 1 to 2 of 2

Thread: QGrapchisSvgItem childItems list empty

  1. #1
    Join Date
    Feb 2010
    Location
    Cuba
    Posts
    35
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QGrapchisSvgItem childItems list empty

    I managed to create a QGraphicsSvgItem to render the contents of SVG file. Now, this file has several elements within it, but when I access the childItems() function that returns a list of this QGraphicsSvgItem's children, the length of this list is 0. This was unexpected. To access all elements of a SVG file(each one of them separately), I must to load each one separately?? I mean, I need to create a QGraphicsSvgItem for each graphic element of the svg file and display them in a interactive QGraphicsView.
    Any Idea?
    Sorry my English and thanks in advanced!

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGrapchisSvgItem childItems list empty

    Yes, you need to specifiy which element your item should represent. But you can use a shared QSvgRenderer if I understand the documentation correctly:

    http://doc.trolltech.com/latest/qgra...m.html#details

    Joh

Similar Threads

  1. Getting Child Items from QStandardItemModel
    By nikhilqt in forum Qt Programming
    Replies: 4
    Last Post: 4th June 2013, 15:10
  2. QTreeView different item delegate for child items possible?
    By Royceybaby in forum Qt Programming
    Replies: 4
    Last Post: 7th January 2010, 21:14
  3. QTreeWidget Infinity Child items
    By aekilic in forum Qt Programming
    Replies: 2
    Last Post: 1st June 2009, 13:19
  4. Replies: 5
    Last Post: 17th February 2009, 04:35
  5. Problem inserting child items into a QAbstractItemModel
    By Valheru in forum Qt Programming
    Replies: 5
    Last Post: 14th October 2006, 18:35

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.