UIGraphicsItem — pyqtgraph 0.11.0rc0 documentation

# UIGraphicsItem

class `pyqtgraph.` `UIGraphicsItem`(bounds=None, parent=None)

  Base class for graphics items with boundaries relative to a GraphicsView or ViewBox. The purpose of this class is to allow the creation of GraphicsItems which live inside a scalable view, but whose boundaries will always stay fixed relative to the view’s boundaries. For example: GridItem, InfiniteLine

  The view can be specified on initialization or it can be automatically detected when the item is painted.

  NOTE: Only the item’s boundingRect is affected; the item is not transformed in any way. Use viewRangeChanged to respond to changes in the view.

  `__init__`(bounds=None, parent=None)

    Arguments: |
    bounds | QRectF with coordinates relative to view box. The default is QRectF(0,0,1,1), which means the item will have the same bounds as the view.

  `boundingRect`(self) → PySide2.QtCore.QRectF
  `dataBounds`(axis, frac=1.0, orthoRange=None)

    Called by ViewBox for determining the auto-range bounds. By default, UIGraphicsItems are excluded from autoRange.

  `itemChange`(self, change: PySide2.QtWidgets.QGraphicsItem.GraphicsItemChange, value: typing.Any) → typing.Any
  `mouseShape`()

    Return the shape of this item after expanding by 2 pixels

  `paint`(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Union[PySide2.QtWidgets.QWidget, NoneType] = None)
  `setNewBounds`()

    Update the item’s bounding rect to match the viewport

  `setPos`(self, pos: PySide2.QtCore.QPointF)

    setPos(self, x: float, y: float)

  `viewRangeChanged`()

    Called when the view widget/viewbox is resized/rescaled