class_docstr: **Bases:** :class:`object`
  
  Abstract class providing useful methods to GraphicsObject and GraphicsWidget.
  (This is required because we cannot have multiple inheritance with QObject subclasses.)
  
  A note about Qt's GraphicsView framework:
  
  The GraphicsView system places a lot of emphasis on the notion that the graphics within the scene should be device independent--you should be able to take the same graphics and display them on screens of different resolutions, printers, export to SVG, etc. This is nice in principle, but causes me a lot of headache in practice. It means that I have to circumvent all the device-independent expectations any time I want to operate in pixel coordinates rather than arbitrary scene coordinates. A lot of the code in GraphicsItem is devoted to this task--keeping track of view widgets and device transforms, computing the size and shape of a pixel in local item coordinates, etc. Note that in item coordinates, a pixel does not have to be square or even rectangular, so just asking how to increase a bounding rect by 2px can be a rather complex task.
code: def setParentItem(self, parent):
      ## Workaround for Qt bug: https://bugreports.qt-project.org/browse/QTBUG-18616
      if parent is not None:
          pscene = parent.scene()
          if pscene is not None and self.scene() is not pscene:
              pscene.addItem(self)
      return self._qtBaseClass.setParentItem(self, parent)
  
imports: import operator
  import weakref
  from collections import OrderedDict
  from functools import reduce
  from math import hypot
  from typing import Optional
  from xml.etree.ElementTree import Element
  from ..None import functions
  from ..GraphicsScene import GraphicsScene
  from ..Point import Point
  from ..Qt import QtCore, QtWidgets, isQObjectAlive
label_desc: Use image node_id 26 for calling the GraphicsItem obj's underlying member method code with example usage: obj.setParentItem(parent) and returns: self