Problems with Open-Source Downloads read and

Heritage from QGraphicsSvgItem or QGraphicsItem for a custom item class; Qt5.1

  • Hi,

    In order to manage my own events, I want to inherit from QGraphicsSvgItem. Most examples are designed for heritage from QGraphicsItem; I ve noticed that some methods in QGraphicsScene work for both classes (QGraphicsSvgItem and QGraphicsItem), like "addItem" method.

    But in docs, it seems like Qt designers want to differentiate between both classes. While SVG class seems to be more "hidden" and inherits from QGraphicsObject, the other one has a nice sub-classes collection and it seems to have a larger collection of methods.

    Whats the best way to handle my items in my CustomView (QGraphicsView)? I have some SVG with the icons that i want to use in, but SVG class seems less flexible than QGraphicsItem and its child. Why Qt designers didn't inherit QGraphicsSvgItem from QtGraphicsItem directly in order to treat QtGraphicsSvgItem just as a QGraphicsItem?

    Thank you for your replies.

Log in to reply