GraphicsObject

class pyqtgraph.GraphicsObject(*args)

Extends QGraphicsObject with a few important functions. (Most of these assume that the object is in a scene with a single view)

This class also generates a cache of the Qt-internal addresses of each item so that GraphicsScene.items() can return the correct objects (this is a PyQt bug)

__init__(*args)
deviceTransform(viewportTransform=None)

Return the transform that converts item coordinates to device coordinates (usually pixels). Extends deviceTransform to automatically determine the viewportTransform.

getBoundingParents()

Return a list of parents to this item that have child clipping enabled.

getViewBox()

Return the first ViewBox or GraphicsView which bounds this item’s visible space. If this item is not contained within a ViewBox, then the GraphicsView is returned. If the item is contained inside nested ViewBoxes, then the inner-most ViewBox is returned. The result is cached; clear the cache with forgetViewBox()

getViewWidget()

Return the view widget for this item. If the scene has multiple views, only the first view is returned. The return value is cached; clear the cached value with forgetViewWidget()

pixelLength(direction)

Return the length of one pixel in the direction indicated (in local coordinates)

pixelVectors()

Return vectors in local coordinates representing the width and height of a view pixel.

viewRect()

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

viewTransform()

Return the transform that maps from local coordinates to the item’s ViewBox coordinates If there is no ViewBox, return the scene transform. Returns None if the item does not have a view.

Previous topic

ButtonItem

Next topic

GraphicsWidget

This Page