'Return the bounds (in item coordinates) of this item\'s ViewBox or GraphicsWidget'

def viewRect(self):

    view = self.getViewBox()
    if (view is None):
        return None
    bounds = self.mapRectFromView(view.viewRect())
    if (bounds is None):
        return None
    bounds = bounds.normalized()
    return bounds
