Skip to content

PythonQt.Qt.QGraphicsItem

QGraphicsItem

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

It provides a light-weight foundation for writing your own custom items. This includes defining the item's geometry, collision detection, its painting implementation and item interaction through its event handlers. QGraphicsItem is part of the Graphics View Framework

For convenience, Qt provides a set of standard graphics items for the most common shapes. These are:

All of an item's geometric information is based on its local coordinate system. The item's position, pos(), is the only function that does not operate in local coordinates, as it returns a position in parent coordinates. The Graphics View Coordinate System describes the coordinate system in detail.

You can set whether an item should be visible (i.e., drawn, and accepting events), by calling setVisible(). Hiding an item will also hide its children. Similarly, you can enable or disable an item by calling setEnabled(). If you disable an item, all its children will also be disabled. By default, items are both visible and enabled. To toggle whether an item is selected or not, first enable selection by setting the ItemIsSelectable flag, and then call setSelected(). Normally, selection is toggled by the scene, as a result of user interaction.

To write your own graphics item, you first create a subclass of QGraphicsItem, and then start by implementing its two pure virtual public functions: boundingRect(), which returns an estimate of the area painted by the item, and paint(), which implements the actual painting. For example:

class SimpleItem : public QGraphicsItem
{
public:
    QRectF boundingRect() const override
    {
        qreal penWidth = 1;
        return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,
                      20 + penWidth, 20 + penWidth);
    }

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
               QWidget *widget) override
    {
        painter->drawRoundedRect(-10, -10, 20, 20, 5, 5);
    }
};

The boundingRect() function has many different purposes. QGraphicsScene bases its item index on boundingRect(), and QGraphicsView uses it both for culling invisible items, and for determining the area that needs to be recomposed when drawing overlapping items. In addition, QGraphicsItem's collision detection mechanisms use boundingRect() to provide an efficient cut-off. The fine grained collision algorithm in collidesWithItem() is based on calling shape(), which returns an accurate outline of the item's shape as a QPainterPath.

QGraphicsScene expects all items boundingRect() and shape() to remain unchanged unless it is notified. If you want to change an item's geometry in any way, you must first call prepareGeometryChange() to allow QGraphicsScene to update its bookkeeping.

Collision detection can be done in two ways:

  1. Reimplement shape() to return an accurate shape for your item, and rely on the default implementation of collidesWithItem() to do shape-shape intersection. This can be rather expensive if the shapes are complex.
  2. Reimplement collidesWithItem() to provide your own custom item and shape collision algorithm.

The contains() function can be called to determine whether the item contains a point or not. This function can also be reimplemented by the item. The default behavior of contains() is based on calling shape().

Items can contain other items, and also be contained by other items. All items can have a parent item and a list of children. Unless the item has no parent, its position is in parent coordinates (i.e., the parent's local coordinates). Parent items propagate both their position and their transformation to all children.

Transformations

QGraphicsItem supports projective transformations in addition to its base position, pos(). There are several ways to change an item's transformation. For simple transformations, you can call either of the convenience functions setRotation() or setScale(), or you can pass any transformation matrix to setTransform(). For advanced transformation control you also have the option of setting several combined transformations by calling setTransformations().

Item transformations accumulate from parent to child, so if both a parent and child item are rotated 90 degrees, the child's total transformation will be 180 degrees. Similarly, if the item's parent is scaled to 2x its original size, its children will also be twice as large. An item's transformation does not affect its own local geometry; all geometry functions (e.g., contains(), update(), and all the mapping functions) still operate in local coordinates. For convenience, QGraphicsItem provides the functions sceneTransform(), which returns the item's total transformation matrix (including its position and all parents' positions and transformations), and scenePos(), which returns its position in scene coordinates. To reset an item's matrix, call resetTransform().

Certain transformation operations produce a different outcome depending on the order in which they are applied. For example, if you scale an transform, and then rotate it, you may get a different result than if the transform was rotated first. However, the order you set the transformation properties on QGraphicsItem does not affect the resulting transformation; QGraphicsItem always applies the properties in a fixed, defined order:

Painting

The paint() function is called by QGraphicsView to paint the item's contents. The item has no background or default fill of its own; whatever is behind the item will shine through all areas that are not explicitly painted in this function. You can call update() to schedule a repaint, optionally passing the rectangle that needs a repaint. Depending on whether or not the item is visible in a view, the item may or may not be repainted; there is no equivalent to QWidget::repaint() in QGraphicsItem.

Items are painted by the view, starting with the parent items and then drawing children, in ascending stacking order. You can set an item's stacking order by calling setZValue(), and test it by calling zValue(), where items with low z-values are painted before items with high z-values. Stacking order applies to sibling items; parents are always drawn before their children.

Sorting

All items are drawn in a defined, stable order, and this same order decides which items will receive mouse input first when you click on the scene. Normally you don't have to worry about sorting, as the items follow a "natural order", following the logical structure of the scene.

An item's children are stacked on top of the parent, and sibling items are stacked by insertion order (i.e., in the same order that they were either added to the scene, or added to the same parent). If you add item A, and then B, then B will be on top of A. If you then add C, the items' stacking order will be A, then B, then C.

This example shows the stacking order of all limbs of the robot from the Drag and Drop Robot example. The torso is the root item (all other items are children or descendants of the torso), so it is drawn first. Next, the head is drawn, as it is the first item in the torso's list of children. Then the upper left arm is drawn. As the lower arm is a child of the upper arm, the lower arm is then drawn, followed by the upper arm's next sibling, which is the upper right arm, and so on.

For advanced users, there are ways to alter how your items are sorted:

  • You can call setZValue() on an item to explicitly stack it on top of, or under, other sibling items. The default Z value for an item is 0. Items with the same Z value are stacked by insertion order.
  • You can call stackBefore() to reorder the list of children. This will directly modify the insertion order.
  • You can set the ItemStacksBehindParent flag to stack a child item behind its parent.

The stacking order of two sibling items also counts for each item's children and descendant items. So if one item is on top of another, then all its children will also be on top of all the other item's children as well.

Events

QGraphicsItem receives events from QGraphicsScene through the virtual function sceneEvent(). This function distributes the most common events to a set of convenience event handlers:

You can filter events for any other item by installing event filters. This functionality is separate from Qt's regular event filters (see QObject::installEventFilter()), which only work on subclasses of QObject. After installing your item as an event filter for another item by calling installSceneEventFilter(), the filtered events will be received by the virtual function sceneEventFilter(). You can remove item event filters by calling removeSceneEventFilter().

Custom Data

Sometimes it's useful to register custom data with an item, be it a custom item, or a standard item. You can call setData() on any item to store data in it using a key-value pair (the key being an integer, and the value is a QVariant). To get custom data from an item, call data(). This functionality is completely untouched by Qt itself; it is provided for the user's convenience.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsitem.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
CacheMode attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
DeviceCoordinateCache attribute Any (shared captured text)
Extension attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
GraphicsItemChange attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
GraphicsItemFlag attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
GraphicsItemFlags attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
ItemAcceptsInputMethod attribute Any (shared captured text)
ItemChildAddedChange attribute Any (shared captured text)
ItemChildRemovedChange attribute Any (shared captured text)
ItemClipsChildrenToShape attribute Any (shared captured text)
ItemClipsToShape attribute Any (shared captured text)
ItemContainsChildrenInShape attribute Any (shared captured text)
ItemCoordinateCache attribute Any (shared captured text)
ItemCursorChange attribute Any (shared captured text)
ItemCursorHasChanged attribute Any (shared captured text)
ItemDoesntPropagateOpacityToChildren attribute Any (shared captured text)
ItemEnabledChange attribute Any (shared captured text)
ItemEnabledHasChanged attribute Any (shared captured text)
ItemFlagsChange attribute Any (shared captured text)
ItemFlagsHaveChanged attribute Any (shared captured text)
ItemHasNoContents attribute Any (shared captured text)
ItemIgnoresParentOpacity attribute Any (shared captured text)
ItemIgnoresTransformations attribute Any (shared captured text)
ItemIsFocusScope attribute Any (shared captured text)
ItemIsFocusable attribute Any (shared captured text)
ItemIsMovable attribute Any (shared captured text)
ItemIsPanel attribute Any (shared captured text)
ItemIsSelectable attribute Any (shared captured text)
ItemMatrixChange attribute Any (shared captured text)
ItemNegativeZStacksBehindParent attribute Any (shared captured text)
ItemOpacityChange attribute Any (shared captured text)
ItemOpacityHasChanged attribute Any (shared captured text)
ItemParentChange attribute Any (shared captured text)
ItemParentHasChanged attribute Any (shared captured text)
ItemPositionChange attribute Any (shared captured text)
ItemPositionHasChanged attribute Any (shared captured text)
ItemRotationChange attribute Any (shared captured text)
ItemRotationHasChanged attribute Any (shared captured text)
ItemScaleChange attribute Any (shared captured text)
ItemScaleHasChanged attribute Any (shared captured text)
ItemSceneChange attribute Any (shared captured text)
ItemSceneHasChanged attribute Any (shared captured text)
ItemScenePositionHasChanged attribute Any (shared captured text)
ItemSelectedChange attribute Any (shared captured text)
ItemSelectedHasChanged attribute Any (shared captured text)
ItemSendsGeometryChanges attribute Any (shared captured text)
ItemSendsScenePositionChanges attribute Any (shared captured text)
ItemStacksBehindParent attribute Any (shared captured text)
ItemStopsClickFocusPropagation attribute Any (shared captured text)
ItemStopsFocusHandling attribute Any (shared captured text)
ItemToolTipChange attribute Any (shared captured text)
ItemToolTipHasChanged attribute Any (shared captured text)
ItemTransformChange attribute Any (shared captured text)
ItemTransformHasChanged attribute Any (shared captured text)
ItemTransformOriginPointChange attribute Any (shared captured text)
ItemTransformOriginPointHasChanged attribute Any (shared captured text)
ItemUsesExtendedStyleOption attribute Any (shared captured text)
ItemVisibleChange attribute Any (shared captured text)
ItemVisibleHasChanged attribute Any (shared captured text)
ItemZValueChange attribute Any (shared captured text)
ItemZValueHasChanged attribute Any (shared captured text)
NoCache attribute Any (shared captured text)
NonModal attribute Any (shared captured text)
PanelModal attribute Any (shared captured text)
PanelModality attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
SceneModal attribute Any (shared captured text)
Type attribute Any (shared captured text)
UserExtension attribute Any (shared captured text)
UserType attribute Any (shared captured text)
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
acceptDrops function (self) -> bool X.acceptDrops() -> bool (shared captured text)
acceptHoverEvents function (self) -> bool X.acceptHoverEvents() -> bool (shared captured text)
acceptTouchEvents function (self) -> bool X.acceptTouchEvents() -> bool (shared captured text)
acceptedMouseButtons function (self) -> Any Returns the mouse buttons that this item accepts mouse events for. (shared captured text)
addToIndex function (self) -> None (shared captured text)
advance function (self, phase: int) -> None This virtual function is called twice for all items by the [QGraphicsScene::advance](https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#advance)() slot. (shared captured text)
boundingRect function (self) -> Any X.boundingRect() -> PythonQt.QtCore.QRectF (shared captured text)
boundingRegion function (self, itemToDeviceTransform: Any) -> Any X.boundingRegion(itemToDeviceTransform) -> PythonQt.QtGui.QRegion (shared captured text)
boundingRegionGranularity function (self) -> float X.boundingRegionGranularity() -> float (shared captured text)
cacheMode function (self) -> Any Returns the cache mode for this item. (shared captured text)
childItems function (self) -> tuple X.childItems() -> tuple (shared captured text)
childrenBoundingRect function (self) -> Any X.childrenBoundingRect() -> PythonQt.QtCore.QRectF (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
clearFocus function (self) -> None Takes keyboard input focus from the item. (shared captured text)
clipPath function (self) -> Any X.clipPath() -> PythonQt.QtGui.QPainterPath (shared captured text)
collidesWithItem function (self, other: Any, mode: Any) -> bool X.collidesWithItem(other, mode) -> bool (shared captured text)
collidesWithPath function (self, path: Any, mode: Any) -> bool X.collidesWithPath(path, mode) -> bool (shared captured text)
collidingItems function (self, mode: Any) -> tuple X.collidingItems(mode) -> tuple (shared captured text)
commonAncestorItem function (self, other: Any) -> Any X.commonAncestorItem(other) -> PythonQt.QtGui.QGraphicsItem (shared captured text)
contains function (self, point: Any) -> bool X.contains(point) -> bool (shared captured text)
contextMenuEvent function (self, event: Any) -> None This event handler can be reimplemented in a subclass to process context menu events. (shared captured text)
cursor function (self) -> Any X.cursor() -> PythonQt.QtGui.QCursor (shared captured text)
data function (self, key: int) -> Any X.data(key) -> object (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
deviceTransform function (self, viewportTransform: Any) -> Any X.deviceTransform(viewportTransform) -> PythonQt.QtGui.QTransform (shared captured text)
dragEnterEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive drag enter events for this item. (shared captured text)
dragLeaveEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive drag leave events for this item. (shared captured text)
dragMoveEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive drag move events for this item. (shared captured text)
dropEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive drop events for this item. (shared captured text)
effectiveOpacity function (self) -> float X.effectiveOpacity() -> float (shared captured text)
ensureVisible function (self, x: Any, y: Any, w: Any, h: Any, xmargin: int, ymargin: int) -> None X.ensureVisible(x, y, w, h, xmargin, ymargin) (shared captured text)
enum_1 attribute type Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text)
extension function (self, variant: Any) -> Any X.extension(variant) -> object (shared captured text)
filtersChildEvents function (self) -> bool X.filtersChildEvents() -> bool (shared captured text)
flags function (self) -> Any Returns this item's flags. (shared captured text)
focusInEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive focus in events for this item. (shared captured text)
focusItem function (self) -> Any X.focusItem() -> PythonQt.QtGui.QGraphicsItem (shared captured text)
focusOutEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive focus out events for this item. (shared captured text)
focusProxy function (self) -> Any X.focusProxy() -> PythonQt.QtGui.QGraphicsItem (shared captured text)
focusScopeItem function (self) -> Any X.focusScopeItem() -> PythonQt.QtGui.QGraphicsItem (shared captured text)
grabKeyboard function (self) -> None Grabs the keyboard input. (shared captured text)
grabMouse function (self) -> None Grabs the mouse input. (shared captured text)
graphicsEffect function (self) -> Any X.graphicsEffect() -> PythonQt.QtGui.QGraphicsEffect (shared captured text)
group function (self) -> Any X.group() -> PythonQt.QtGui.QGraphicsItemGroup (shared captured text)
handlesChildEvents function (self) -> bool X.handlesChildEvents() -> bool (shared captured text)
hasCursor function (self) -> bool X.hasCursor() -> bool (shared captured text)
hasFocus function (self) -> bool X.hasFocus() -> bool (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
hide function (self) -> None Hides the item (items are visible by default). (shared captured text)
hoverEnterEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive hover enter events for this item. (shared captured text)
hoverLeaveEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive hover leave events for this item. (shared captured text)
hoverMoveEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive hover move events for this item. (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
inputMethodEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive input method events for this item. (shared captured text)
inputMethodHints function (self) -> Any Returns the current input method hints of this item. (shared captured text)
inputMethodQuery function (self, query: Any) -> Any X.inputMethodQuery(query) -> object (shared captured text)
installSceneEventFilter function (self, filterItem: Any) -> None Installs an event filter for this item on filterItem, causing all events for this item to first pass through filterItem's… (shared captured text)
isActive function (self) -> bool X.isActive() -> bool (shared captured text)
isAncestorOf function (self, child: Any) -> bool X.isAncestorOf(child) -> bool (shared captured text)
isBlockedByModalPanel function (self, blockingPanel: Any) -> bool X.isBlockedByModalPanel(blockingPanel) -> bool (shared captured text)
isClipped function (self) -> bool X.isClipped() -> bool (shared captured text)
isEnabled function (self) -> bool X.isEnabled() -> bool (shared captured text)
isObscured function (self, x: Any, y: Any, w: Any, h: Any) -> bool X.isObscured(x, y, w, h) -> bool (shared captured text)
isObscuredBy function (self, item: Any) -> bool X.isObscuredBy(item) -> bool (shared captured text)
isPanel function (self) -> bool X.isPanel() -> bool (shared captured text)
isSelected function (self) -> bool X.isSelected() -> bool (shared captured text)
isUnderMouse function (self) -> bool X.isUnderMouse() -> bool (shared captured text)
isVisible function (self) -> bool X.isVisible() -> bool (shared captured text)
isVisibleTo function (self, parent: Any) -> bool X.isVisibleTo(parent) -> bool (shared captured text)
isWidget function (self) -> bool X.isWidget() -> bool (shared captured text)
isWindow function (self) -> bool X.isWindow() -> bool (shared captured text)
itemChange function (self, change: Any, value: Any) -> Any X.itemChange(change, value) -> object (shared captured text)
itemTransform function (self, other: Any, ok: Any) -> Any X.itemTransform(other, ok) -> PythonQt.QtGui.QTransform (shared captured text)
keyPressEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive key press events for this item. (shared captured text)
keyReleaseEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive key release events for this item. (shared captured text)
mapFromItem function (self, item: Any, x: Any, y: Any, w: Any, h: Any) -> Any X.mapFromItem(item, x, y, w, h) -> PythonQt.QtGui.QPainterPath (shared captured text)
mapFromParent function (self, x: Any, y: Any, w: Any, h: Any) -> Any X.mapFromParent(x, y, w, h) -> PythonQt.QtGui.QPainterPath (shared captured text)
mapFromScene function (self, x: Any, y: Any, w: Any, h: Any) -> Any X.mapFromScene(x, y, w, h) -> PythonQt.QtGui.QPainterPath (shared captured text)
mapRectFromItem function (self, item: Any, x: Any, y: Any, w: Any, h: Any) -> Any X.mapRectFromItem(item, x, y, w, h) -> PythonQt.QtCore.QRectF (shared captured text)
mapRectFromParent function (self, x: Any, y: Any, w: Any, h: Any) -> Any X.mapRectFromParent(x, y, w, h) -> PythonQt.QtCore.QRectF (shared captured text)
mapRectFromScene function (self, x: Any, y: Any, w: Any, h: Any) -> Any X.mapRectFromScene(x, y, w, h) -> PythonQt.QtCore.QRectF (shared captured text)
mapRectToItem function (self, item: Any, x: Any, y: Any, w: Any, h: Any) -> Any X.mapRectToItem(item, x, y, w, h) -> PythonQt.QtCore.QRectF (shared captured text)
mapRectToParent function (self, x: Any, y: Any, w: Any, h: Any) -> Any X.mapRectToParent(x, y, w, h) -> PythonQt.QtCore.QRectF (shared captured text)
mapRectToScene function (self, x: Any, y: Any, w: Any, h: Any) -> Any X.mapRectToScene(x, y, w, h) -> PythonQt.QtCore.QRectF (shared captured text)
mapToItem function (self, item: Any, x: Any, y: Any, w: Any, h: Any) -> Any X.mapToItem(item, x, y, w, h) -> PythonQt.QtGui.QPainterPath (shared captured text)
mapToParent function (self, x: Any, y: Any, w: Any, h: Any) -> Any X.mapToParent(x, y, w, h) -> PythonQt.QtGui.QPainterPath (shared captured text)
mapToScene function (self, x: Any, y: Any, w: Any, h: Any) -> Any X.mapToScene(x, y, w, h) -> PythonQt.QtGui.QPainterPath (shared captured text)
mouseDoubleClickEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive mouse double-click events for this item. (shared captured text)
mouseMoveEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive mouse move events for this item. (shared captured text)
mousePressEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive mouse press events for this item. (shared captured text)
mouseReleaseEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive mouse release events for this item. (shared captured text)
moveBy function (self, dx: float, dy: float) -> None X.moveBy(dx, dy) (shared captured text)
opacity function (self) -> float X.opacity() -> float (shared captured text)
opaqueArea function (self) -> Any X.opaqueArea() -> PythonQt.QtGui.QPainterPath (shared captured text)
paint function (self, painter: Any, option: Any, widget: Any) -> None X.paint(painter, option, widget) (shared captured text)
panel function (self) -> Any X.panel() -> PythonQt.QtGui.QGraphicsItem (shared captured text)
panelModality function (self) -> Any Returns the modality for this item. (shared captured text)
parentItem function (self) -> Any X.parentItem() -> PythonQt.QtGui.QGraphicsItem (shared captured text)
parentObject function (self) -> Any X.parentObject() -> PythonQt.QtGui.QGraphicsObject (shared captured text)
parentWidget function (self) -> Any X.parentWidget() -> PythonQt.QtGui.QGraphicsWidget (shared captured text)
pos function (self) -> Any X.pos() -> PythonQt.QtCore.QPointF (shared captured text)
prepareGeometryChange function (self) -> None Prepares the item for a geometry change. (shared captured text)
removeFromIndex function (self) -> None (shared captured text)
removeSceneEventFilter function (self, filterItem: Any) -> None Removes an event filter on this item from filterItem. (shared captured text)
resetTransform function (self) -> None Resets this item's transformation matrix to the identity matrix or all the transformation properties to their default values. (shared captured text)
rotation function (self) -> float X.rotation() -> float (shared captured text)
scale function (self) -> float X.scale() -> float (shared captured text)
scene function (self) -> Any X.scene() -> PythonQt.QtGui.QGraphicsScene (shared captured text)
sceneBoundingRect function (self) -> Any X.sceneBoundingRect() -> PythonQt.QtCore.QRectF (shared captured text)
sceneEvent function (self, event: Any) -> bool X.sceneEvent(event) -> bool (shared captured text)
sceneEventFilter function (self, watched: Any, event: Any) -> bool X.sceneEventFilter(watched, event) -> bool (shared captured text)
scenePos function (self) -> Any X.scenePos() -> PythonQt.QtCore.QPointF (shared captured text)
sceneTransform function (self) -> Any X.sceneTransform() -> PythonQt.QtGui.QTransform (shared captured text)
scroll function (self, dx: float, dy: float, rect: Any) -> None X.scroll(dx, dy, rect) (shared captured text)
setAcceptDrops function (self, on: bool) -> None If on is true, this item will accept drag and drop events; otherwise, it is transparent for drag and drop events. (shared captured text)
setAcceptHoverEvents function (self, enabled: bool) -> None If enabled is true, this item will accept hover events; otherwise, it will ignore them. (shared captured text)
setAcceptTouchEvents function (self, enabled: bool) -> None If enabled is true, this item will accept [touch events](https://doc.qt.io/archives/qt-5.15/qtouchevent.html); otherwise, it will ignore them. (shared captured text)
setAcceptedMouseButtons function (self, buttons: Any) -> None Sets the mouse buttons that this item accepts mouse events for. (shared captured text)
setActive function (self, active: bool) -> None If active is true, and the scene is active, this item's panel will be activated. (shared captured text)
setBoundingRegionGranularity function (self, granularity: float) -> None Sets the bounding region granularity to granularity; a value between and including 0 and 1. (shared captured text)
setCacheMode function (self, mode: Any, cacheSize: Any) -> None X.setCacheMode(mode, cacheSize) (shared captured text)
setCursor function (self, cursor: Any) -> None Sets the current cursor shape for the item to cursor. (shared captured text)
setData function (self, key: int, value: Any) -> None X.setData(key, value) (shared captured text)
setEnabled function (self, enabled: bool) -> None If enabled is true, the item is enabled; otherwise, it is disabled. (shared captured text)
setExtension function (self, extension: Any, variant: Any) -> Any X.setExtension(extension, variant) (shared captured text)
setFiltersChildEvents function (self, enabled: bool) -> None If enabled is true, this item is set to filter all events for all its children (i.e., all events intented for any of its children are instead sent to this item); otherwise, if enabled is false,… (shared captured text)
setFlag function (self, arg0: flag, enabled: bool) -> None X.setFlag(flag, enabled) (shared captured text)
setFlags function (self, arg0: flags) -> None Sets the item flags to flags. (shared captured text)
setFocus function (self, focusReason: Any) -> None Gives keyboard input focus to this item. (shared captured text)
setFocusProxy function (self, item: Any) -> None Sets the item's focus proxy to item. (shared captured text)
setGraphicsEffect function (self, effect: Any) -> None Sets effect as the item's effect. (shared captured text)
setGroup function (self, group: Any) -> None Adds this item to the item group group. (shared captured text)
setHandlesChildEvents function (self, enabled: bool) -> None (shared captured text)
setInputMethodHints function (self, hints: Any) -> None Sets the current input method hints of this item to hints. (shared captured text)
setOpacity function (self, opacity: float) -> None Sets this item's local opacity, between 0.0 (transparent) and 1.0 (opaque). (shared captured text)
setPanelModality function (self, panelModality: Any) -> None Sets the modality for this item to panelModality. (shared captured text)
setParentItem function (self, parent: Any) -> None Sets this item's parent item to newParent. (shared captured text)
setPos function (self, x: Any, y: Any) -> None X.setPos(x, y) (shared captured text)
setRotation function (self, angle: float) -> None Sets the clockwise rotation angle, in degrees, around the Z axis. (shared captured text)
setScale function (self, scale: float) -> None Sets the scale factor of the item. (shared captured text)
setSelected function (self, selected: bool) -> None If selected is true and this item is selectable, this item is selected; otherwise, it is unselected. (shared captured text)
setToolTip function (self, toolTip: str) -> None Sets the item's tool tip to toolTip. (shared captured text)
setTransform function (self, matrix: Any, combine: bool) -> None X.setTransform(matrix, combine) (shared captured text)
setTransformOriginPoint function (self, ax: Any, ay: Any) -> None X.setTransformOriginPoint(ax, ay) (shared captured text)
setTransformations function (self, transformations: Any) -> None Sets a list of graphics transformations ([QGraphicsTransform](https://doc.qt.io/archives/qt-5.15/qgraphicstransform.html)) that currently apply to this item. (shared captured text)
setVisible function (self, visible: bool) -> None If visible is true, the item is made visible. (shared captured text)
setX function (self, x: float) -> None Set's the x coordinate of the item's position. (shared captured text)
setY function (self, y: float) -> None Set's the y coordinate of the item's position. (shared captured text)
setZValue function (self, z: float) -> None Sets the Z-value of the item to z. (shared captured text)
shape function (self) -> Any X.shape() -> PythonQt.QtGui.QPainterPath (shared captured text)
show function (self) -> None Shows the item (items are visible by default). (shared captured text)
stackBefore function (self, sibling: Any) -> None Stacks this item before sibling, which must be a sibling item (i.e., the two items must share the same parent item, or must both be toplevel items). (shared captured text)
supportsExtension function (self, extension: Any) -> bool X.supportsExtension(extension) -> bool (shared captured text)
toGraphicsObject function (self) -> Any X.toGraphicsObject() -> PythonQt.QtGui.QGraphicsObject (shared captured text)
toolTip function (self) -> str X.toolTip() -> str (shared captured text)
topLevelItem function (self) -> Any X.topLevelItem() -> PythonQt.QtGui.QGraphicsItem (shared captured text)
topLevelWidget function (self) -> Any X.topLevelWidget() -> PythonQt.QtGui.QGraphicsWidget (shared captured text)
transform function (self) -> Any X.transform() -> PythonQt.QtGui.QTransform (shared captured text)
transformOriginPoint function (self) -> Any X.transformOriginPoint() -> PythonQt.QtCore.QPointF (shared captured text)
transformations function (self) -> tuple X.transformations() -> tuple (shared captured text)
type function (self) -> int X.type() -> int (shared captured text)
ungrabKeyboard function (self) -> None Releases the keyboard grab. (shared captured text)
ungrabMouse function (self) -> None Releases the mouse grab. (shared captured text)
unsetCursor function (self) -> None Clears the cursor from this item. (shared captured text)
update function (self, x: Any, y: Any, width: Any, height: Any) -> None X.update(x, y, width, height) (shared captured text)
updateMicroFocus function (self) -> None Updates the item's micro focus. (shared captured text)
wheelEvent function (self, event: Any) -> None This event handler, for event event, can be reimplemented to receive wheel events for this item. (shared captured text)
window function (self) -> Any X.window() -> PythonQt.QtGui.QGraphicsWidget (shared captured text)
x function (self) -> float X.x() -> float (shared captured text)
y function (self) -> float X.y() -> float (shared captured text)
zValue function (self) -> float X.zValue() -> float (shared captured text)