'Temporarily display the bounding rect of an item and lines connecting to the center of the view.
This is useful for determining the location of items that may be out of the range of the ViewBox.
if allChildren is True, then the bounding rect of all item\'s children will be shown instead.'

def locate(self, item, timeout=3.0, children=False):

    self.clearLocate()
    if (item.scene() is not self.scene()):
        raise Exception('Item    does    not    share    a    scene    with    this    ViewBox.')
    c = self.viewRect().center()
    if children:
        br = self.mapFromItemToView(item, item.childrenBoundingRect()).boundingRect()
    else:
        br = self.mapFromItemToView(item, item.boundingRect()).boundingRect()
    g = ItemGroup()
    g.setParentItem(self.childGroup)
    self.locateGroup = g
    g.box = QtGui.QGraphicsRectItem(br)
    g.box.setParentItem(g)
    g.lines = []
    for p in (br.topLeft(), br.bottomLeft(), br.bottomRight(), br.topRight()):
        line = QtGui.QGraphicsLineItem(c.x(), c.y(), p.x(), p.y())
        line.setParentItem(g)
        g.lines.append(line)
    for item in g.childItems():
        item.setPen(fn.mkPen(color='y', width=3))
    g.setZValue(1000000)
    if children:
        g.path = QtGui.QGraphicsPathItem(g.childrenShape())
    else:
        g.path = QtGui.QGraphicsPathItem(g.shape())
    g.path.setParentItem(g)
    g.path.setPen(fn.mkPen('g'))
    g.path.setZValue(100)
    QtCore.QTimer.singleShot((timeout * 1000), self.clearLocate)
