Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Heritage from QGraphicsSvgItem or QGraphicsItem for a custom item class; Qt5.1

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

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 836 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rhadel
    wrote on last edited by
    #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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved