Skip to content

PythonQt.QtGui.QGraphicsScene · declarations 001

Back to PythonQt.QtGui.QGraphicsScene

AllLayers instance-attribute

AllLayers: Any

BackgroundLayer instance-attribute

BackgroundLayer: Any

BspTreeIndex instance-attribute

BspTreeIndex: Any

ForegroundLayer instance-attribute

ForegroundLayer: Any

ItemIndexMethod instance-attribute

ItemIndexMethod: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

ItemLayer instance-attribute

ItemLayer: Any

NoIndex instance-attribute

NoIndex: Any

SceneLayer instance-attribute

SceneLayer: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

SceneLayers instance-attribute

SceneLayers: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

activePanel

activePanel() -> Any

X.activePanel() -> PythonQt.QtGui.QGraphicsItem

Supplemental documentation: Qt 5 reference:

QGraphicsItem *QGraphicsScene::activePanel() const

Returns the current active panel, or nullptr if no panel is currently active.

This function was introduced in Qt 4.6.

See also QGraphicsScene::setActivePanel().

Upstream PySide2 reference signatures (binding differences may apply):

activePanel(self) -> PySide2.QtWidgets.QGraphicsItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#activePanel

activeWindow

activeWindow() -> Any

X.activeWindow() -> PythonQt.QtGui.QGraphicsWidget

Supplemental documentation: Qt 5 reference:

QGraphicsWidget *QGraphicsScene::activeWindow() const

Returns the current active window, or nullptr if no window is currently active.

This function was introduced in Qt 4.4.

See also QGraphicsScene::setActiveWindow().

Upstream PySide2 reference signatures (binding differences may apply):

activeWindow(self) -> PySide2.QtWidgets.QGraphicsWidget

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#activeWindow

addEllipse

addEllipse(x: Any, y: Any, w: Any, h: Any, pen: Any, brush: Any) -> Any

X.addEllipse(x, y, w, h, pen, brush) -> PythonQt.QtGui.QGraphicsEllipseItem

Supplemental documentation: Qt 5 reference:

QGraphicsEllipseItem *QGraphicsScene::addEllipse(const QRectF \&rect, const QPen \&pen \= QPen(), const QBrush \&brush \= QBrush())

Creates and adds an ellipse item to the scene, and returns the item pointer. The geometry of the ellipse is defined by rect, and its pen and brush are initialized to pen and brush.

Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

See also addLine(), addPath(), addPixmap(), addRect(), addText(), addItem(), and addWidget().

QGraphicsEllipseItem *QGraphicsScene::addEllipse(qreal x, qreal y, qreal w, qreal h, const QPen \&pen \= QPen(), const QBrush \&brush \= QBrush())

This convenience function is equivalent to calling addEllipse(QRectF(x, y, w, h), pen, brush).

This function was introduced in Qt 4.3.

Upstream PySide2 reference signatures (binding differences may apply):

addEllipse(self, rect: PySide2.QtCore.QRectF, pen: PySide2.QtGui.QPen=..., brush: PySide2.QtGui.QBrush=...) -> PySide2.QtWidgets.QGraphicsEllipseItem
addEllipse(self, x: float, y: float, w: float, h: float, pen: PySide2.QtGui.QPen=..., brush: PySide2.QtGui.QBrush=...) -> PySide2.QtWidgets.QGraphicsEllipseItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addEllipse

addItem

addItem(item: Any) -> None

X.addItem(item)

Supplemental documentation: Qt 5 reference:

void QGraphicsScene::addItem(QGraphicsItem *item)

Adds or moves the item and all its children to this scene. This scene takes ownership of the item.

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

If the item is already in a different scene, it will first be removed from its old scene, and then added to this scene as a top-level.

QGraphicsScene will send ItemSceneChange notifications to item while it is added to the scene. If item does not currently belong to a scene, only one notification is sent. If it does belong to scene already (i.e., it is moved to this scene), QGraphicsScene will send an addition notification as the item is removed from its previous scene.

If the item is a panel, the scene is active, and there is no active panel in the scene, then the item will be activated.

See also removeItem(), addEllipse(), addLine(), addPath(), addPixmap(), addRect(), addText(), addWidget(), and Sorting.

Upstream PySide2 reference signatures (binding differences may apply):

addItem(self, item: PySide2.QtWidgets.QGraphicsItem) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addItem

addLine

addLine(x1: Any, y1: Any, x2: Any, y2: Any, pen: Any) -> Any

X.addLine(x1, y1, x2, y2, pen) -> PythonQt.QtGui.QGraphicsLineItem

Supplemental documentation: Qt 5 reference:

QGraphicsLineItem *QGraphicsScene::addLine(const QLineF \&line, const QPen \&pen \= QPen())

Creates and adds a line item to the scene, and returns the item pointer. The geometry of the line is defined by line, and its pen is initialized to pen.

Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

See also addEllipse(), addPath(), addPixmap(), addRect(), addText(), addItem(), and addWidget().

QGraphicsLineItem *QGraphicsScene::addLine(qreal x1, qreal y1, qreal x2, qreal y2, const QPen \&pen \= QPen())

This convenience function is equivalent to calling addLine(QLineF(x1, y1, x2, y2), pen).

This function was introduced in Qt 4.3.

Upstream PySide2 reference signatures (binding differences may apply):

addLine(self, line: PySide2.QtCore.QLineF, pen: PySide2.QtGui.QPen=...) -> PySide2.QtWidgets.QGraphicsLineItem
addLine(self, x1: float, y1: float, x2: float, y2: float, pen: PySide2.QtGui.QPen=...) -> PySide2.QtWidgets.QGraphicsLineItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addLine

addPath

addPath(path: Any, pen: Any, brush: Any) -> Any

X.addPath(path, pen, brush) -> PythonQt.QtGui.QGraphicsPathItem

Supplemental documentation: Qt 5 reference:

QGraphicsPathItem *QGraphicsScene::addPath(const QPainterPath \&path, const QPen \&pen \= QPen(), const QBrush \&brush \= QBrush())

Creates and adds a path item to the scene, and returns the item pointer. The geometry of the path is defined by path, and its pen and brush are initialized to pen and brush.

Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

See also addEllipse(), addLine(), addPixmap(), addRect(), addText(), addItem(), and addWidget().

Upstream PySide2 reference signatures (binding differences may apply):

addPath(self, path: PySide2.QtGui.QPainterPath, pen: PySide2.QtGui.QPen=..., brush: PySide2.QtGui.QBrush=...) -> PySide2.QtWidgets.QGraphicsPathItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addPath

addPixmap

addPixmap(pixmap: Any) -> Any

X.addPixmap(pixmap) -> PythonQt.QtGui.QGraphicsPixmapItem

Supplemental documentation: Qt 5 reference:

QGraphicsPixmapItem *QGraphicsScene::addPixmap(const QPixmap \&pixmap)

Creates and adds a pixmap item to the scene, and returns the item pointer. The pixmap is defined by pixmap.

Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

See also addEllipse(), addLine(), addPath(), addRect(), addText(), addItem(), and addWidget().

Upstream PySide2 reference signatures (binding differences may apply):

addPixmap(self, pixmap: PySide2.QtGui.QPixmap) -> PySide2.QtWidgets.QGraphicsPixmapItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addPixmap

addPolygon

addPolygon(polygon: Any, pen: Any, brush: Any) -> Any

X.addPolygon(polygon, pen, brush) -> PythonQt.QtGui.QGraphicsPolygonItem

Supplemental documentation: Qt 5 reference:

QGraphicsPolygonItem *QGraphicsScene::addPolygon(const QPolygonF \&polygon, const QPen \&pen \= QPen(), const QBrush \&brush \= QBrush())

Creates and adds a polygon item to the scene, and returns the item pointer. The polygon is defined by polygon, and its pen and brush are initialized to pen and brush.

Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

See also addEllipse(), addLine(), addPath(), addRect(), addText(), addItem(), and addWidget().

Upstream PySide2 reference signatures (binding differences may apply):

addPolygon(self, polygon: PySide2.QtGui.QPolygonF, pen: PySide2.QtGui.QPen=..., brush: PySide2.QtGui.QBrush=...) -> PySide2.QtWidgets.QGraphicsPolygonItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addPolygon

addRect

addRect(x: Any, y: Any, w: Any, h: Any, pen: Any, brush: Any) -> Any

X.addRect(x, y, w, h, pen, brush) -> PythonQt.QtGui.QGraphicsRectItem

Supplemental documentation: Qt 5 reference:

QGraphicsRectItem *QGraphicsScene::addRect(const QRectF \&rect, const QPen \&pen \= QPen(), const QBrush \&brush \= QBrush())

Creates and adds a rectangle item to the scene, and returns the item pointer. The geometry of the rectangle is defined by rect, and its pen and brush are initialized to pen and brush.

Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0). For example, if a QRect(50, 50, 100, 100) is added, its top-left corner will be at (50, 50) relative to the origin in the item's coordinate system.

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

See also addEllipse(), addLine(), addPixmap(), addPixmap(), addText(), addItem(), and addWidget().

QGraphicsRectItem *QGraphicsScene::addRect(qreal x, qreal y, qreal w, qreal h, const QPen \&pen \= QPen(), const QBrush \&brush \= QBrush())

This convenience function is equivalent to calling addRect(QRectF(x, y, w, h), pen, brush).

This function was introduced in Qt 4.3.

Upstream PySide2 reference signatures (binding differences may apply):

addRect(self, rect: PySide2.QtCore.QRectF, pen: PySide2.QtGui.QPen=..., brush: PySide2.QtGui.QBrush=...) -> PySide2.QtWidgets.QGraphicsRectItem
addRect(self, x: float, y: float, w: float, h: float, pen: PySide2.QtGui.QPen=..., brush: PySide2.QtGui.QBrush=...) -> PySide2.QtWidgets.QGraphicsRectItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addRect

addSimpleText

addSimpleText(text: str, font: Any) -> Any

X.addSimpleText(text, font) -> PythonQt.QtGui.QGraphicsSimpleTextItem

Supplemental documentation: Qt 5 reference:

QGraphicsSimpleTextItem *QGraphicsScene::addSimpleText(const QString \&text, const QFont \&font \= QFont())

Creates and adds a QGraphicsSimpleTextItem to the scene, and returns the item pointer. The text string is initialized to text, and its font is initialized to font.

The item's position is initialized to (0, 0).

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

See also addEllipse(), addLine(), addPixmap(), addPixmap(), addRect(), addItem(), and addWidget().

Upstream PySide2 reference signatures (binding differences may apply):

addSimpleText(self, text: str, font: PySide2.QtGui.QFont=...) -> PySide2.QtWidgets.QGraphicsSimpleTextItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addSimpleText

addText

addText(text: str, font: Any) -> Any

X.addText(text, font) -> PythonQt.QtGui.QGraphicsTextItem

Supplemental documentation: Qt 5 reference:

QGraphicsTextItem *QGraphicsScene::addText(const QString \&text, const QFont \&font \= QFont())

Creates and adds a text item to the scene, and returns the item pointer. The text string is initialized to text, and its font is initialized to font.

The item's position is initialized to (0, 0).

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

See also addEllipse(), addLine(), addPixmap(), addPixmap(), addRect(), addItem(), and addWidget().

Upstream PySide2 reference signatures (binding differences may apply):

addText(self, text: str, font: PySide2.QtGui.QFont=...) -> PySide2.QtWidgets.QGraphicsTextItem

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addText

addWidget

addWidget(widget: Any, wFlags: Any) -> Any

X.addWidget(widget, wFlags) -> PythonQt.QtGui.QGraphicsProxyWidget

Supplemental documentation: Qt 5 reference:

QGraphicsProxyWidget *QGraphicsScene::addWidget(QWidget *widget, Qt::WindowFlags wFlags \= Qt::WindowFlags())

Creates a new QGraphicsProxyWidget for widget, adds it to the scene, and returns a pointer to the proxy. wFlags set the default window flags for the embedding proxy widget.

The item's position is initialized to (0, 0).

If the item is visible (i.e., QGraphicsItem::isVisible() returns true), QGraphicsScene will emit changed() once control goes back to the event loop.

Note that widgets with the Qt::WA_PaintOnScreen widget attribute set and widgets that wrap an external application or controller are not supported. Examples are QOpenGLWidget and QAxWidget.

See also addEllipse(), addLine(), addPixmap(), addPixmap(), addRect(), addText(), addSimpleText(), and addItem().

Upstream PySide2 reference signatures (binding differences may apply):

addWidget(self, widget: PySide2.QtWidgets.QWidget, wFlags: PySide2.QtCore.Qt.WindowFlags=...) -> PySide2.QtWidgets.QGraphicsProxyWidget

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#addWidget

advance

advance() -> None

X.advance()

Supplemental documentation: Qt 5 reference:

[slot] void QGraphicsScene::advance()

This slot advances the scene by one step, by calling QGraphicsItem::advance() for all items on the scene. This is done in two phases: in the first phase, all items are notified that the scene is about to change, and in the second phase all items are notified that they can move. In the first phase, QGraphicsItem::advance() is called passing a value of 0 as an argument, and 1 is passed in the second phase.

Note that you can also use the Animation Framework for animations.

See also QGraphicsItem::advance() and QTimeLine.

Upstream PySide2 reference signatures (binding differences may apply):

advance(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#advance

backgroundBrush instance-attribute

backgroundBrush: QBrush

Qt 5 reference:

backgroundBrush : QBrush

This property holds the background brush of the scene.

Set this property to changes the scene's background to a different color, gradient or texture. The default background brush is Qt::NoBrush. The background is drawn before (behind) the items.

Example:

QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();

// a blue background
scene.setBackgroundBrush(Qt::blue);

// a gradient background
QRadialGradient gradient(0, 0, 10);
gradient.setSpread(QGradient::RepeatSpread);
scene.setBackgroundBrush(gradient);

QGraphicsScene::render() calls drawBackground() to draw the scene background. For more detailed control over how the background is drawn, you can reimplement drawBackground() in a subclass of QGraphicsScene.

Access functions:

QBrush backgroundBrush() const
void setBackgroundBrush(const QBrush \&brush)

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#backgroundBrush

bspTreeDepth instance-attribute

bspTreeDepth: int

Qt 5 reference:

bspTreeDepth : int

This property holds the depth of QGraphicsScene's BSP index tree

This property has no effect when NoIndex is used.

This value determines the depth of QGraphicsScene's BSP tree. The depth directly affects QGraphicsScene's performance and memory usage; the latter growing exponentially with the depth of the tree. With an optimal tree depth, QGraphicsScene can instantly determine the locality of items, even for scenes with thousands or millions of items. This also greatly improves rendering performance.

By default, the value is 0, in which case Qt will guess a reasonable default depth based on the size, location and number of items in the scene. If these parameters change frequently, however, you may experience slowdowns as QGraphicsScene retunes the depth internally. You can avoid potential slowdowns by fixating the tree depth through setting this property.

The depth of the tree and the size of the scene rectangle decide the granularity of the scene's partitioning. The size of each scene segment is determined by the following algorithm:

QSizeF segmentSize = sceneRect().size() / pow(2, depth - 1);

The BSP tree has an optimal size when each segment contains between 0 and 10 items.

This property was introduced in Qt 4.3.

Access functions:

int bspTreeDepth() const
void setBspTreeDepth(int depth)

See also itemIndexMethod.

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#bspTreeDepth

changed

changed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QGraphicsScene.changed; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QGraphicsScene::changed(const QList\<QRectF> \&region)

This signal is emitted by QGraphicsScene when control reaches the event loop, if the scene content changes. The region parameter contains a list of scene rectangles that indicate the area that has been changed.

See also QGraphicsView::updateScene().

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#changed

clear

clear() -> None

X.clear()

Supplemental documentation: Qt 5 reference:

[slot] void QGraphicsScene::clear()

Removes and deletes all items from the scene, but otherwise leaves the state of the scene unchanged.

This function was introduced in Qt 4.4.

See also addItem().

Upstream PySide2 reference signatures (binding differences may apply):

clear(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#clear

clearFocus

clearFocus() -> None

X.clearFocus()

Supplemental documentation: Qt 5 reference:

void QGraphicsScene::clearFocus()

Clears focus from the scene. If any item has focus when this function is called, it will lose focus, and regain focus again once the scene regains focus.

A scene that does not have focus ignores key events.

See also hasFocus(), setFocus(), and setFocusItem().

Upstream PySide2 reference signatures (binding differences may apply):

clearFocus(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#clearFocus

clearSelection

clearSelection() -> None

X.clearSelection()

Supplemental documentation: Qt 5 reference:

[slot] void QGraphicsScene::clearSelection()

Clears the current selection.

See also setSelectionArea() and selectedItems().

Upstream PySide2 reference signatures (binding differences may apply):

clearSelection(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#clearSelection

collidingItems

collidingItems(item: Any, mode: Any) -> tuple

X.collidingItems(item, mode) -> tuple

Supplemental documentation: Qt 5 reference:

QList\<QGraphicsItem *> QGraphicsScene::collidingItems(const QGraphicsItem *item, Qt::ItemSelectionMode mode \= Qt::IntersectsItemShape) const

Returns a list of all items that collide with item. Collisions are determined by calling QGraphicsItem::collidesWithItem(); the collision detection is determined by mode. By default, all items whose shape intersects item or is contained inside item's shape are returned.

The items are returned in descending stacking order (i.e., the first item in the list is the uppermost item, and the last item is the lowermost item).

See also items(), itemAt(), QGraphicsItem::collidesWithItem(), and Sorting.

Upstream PySide2 reference signatures (binding differences may apply):

collidingItems(self, item: PySide2.QtWidgets.QGraphicsItem, mode: PySide2.QtCore.Qt.ItemSelectionMode=...) -> typing.List[PySide2.QtWidgets.QGraphicsItem]

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#collidingItems

contextMenuEvent

contextMenuEvent(event: Any) -> None

X.contextMenuEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *contextMenuEvent)

This event handler, for event contextMenuEvent, can be reimplemented in a subclass to receive context menu events. The default implementation forwards the event to the topmost visible item that accepts context menu events at the position of the event. If no items accept context menu events at this position, the event is ignored.

Note: See items() for a definition of which items are considered visible by this function.

See also QGraphicsItem::contextMenuEvent().

Upstream PySide2 reference signatures (binding differences may apply):

contextMenuEvent(self, event: PySide2.QtWidgets.QGraphicsSceneContextMenuEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#contextMenuEvent

createItemGroup

createItemGroup(items: Any) -> Any

X.createItemGroup(items) -> PythonQt.QtGui.QGraphicsItemGroup

Supplemental documentation: Qt 5 reference:

QGraphicsItemGroup *QGraphicsScene::createItemGroup(const QList\<QGraphicsItem *> \&items)

Groups all items in items into a new QGraphicsItemGroup, and returns a pointer to the group. The group is created with the common ancestor of items as its parent, and with position (0, 0). The items are all reparented to the group, and their positions and transformations are mapped to the group. If items is empty, this function will return an empty top-level QGraphicsItemGroup.

QGraphicsScene has ownership of the group item; you do not need to delete it. To dismantle (ungroup) a group, call destroyItemGroup().

See also destroyItemGroup() and QGraphicsItemGroup::addToGroup().

Upstream PySide2 reference signatures (binding differences may apply):

createItemGroup(self, items: typing.Sequence[PySide2.QtWidgets.QGraphicsItem]) -> PySide2.QtWidgets.QGraphicsItemGroup

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#createItemGroup

destroyItemGroup

destroyItemGroup(group: Any) -> None

X.destroyItemGroup(group)

Supplemental documentation: Qt 5 reference:

void QGraphicsScene::destroyItemGroup(QGraphicsItemGroup *group)

Reparents all items in group to group's parent item, then removes group from the scene, and finally deletes it. The items' positions and transformations are mapped from the group to the group's parent.

See also createItemGroup() and QGraphicsItemGroup::removeFromGroup().

Upstream PySide2 reference signatures (binding differences may apply):

destroyItemGroup(self, group: PySide2.QtWidgets.QGraphicsItemGroup) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#destroyItemGroup

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QGraphicsScene.destroyed; argument details are not documented.

dragEnterEvent

dragEnterEvent(event: Any) -> None

X.dragEnterEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsScene::dragEnterEvent(QGraphicsSceneDragDropEvent *event)

This event handler, for event event, can be reimplemented in a subclass to receive drag enter events for the scene.

The default implementation accepts the event and prepares the scene to accept drag move events.

See also QGraphicsItem::dragEnterEvent(), dragMoveEvent(), dragLeaveEvent(), and dropEvent().

Upstream PySide2 reference signatures (binding differences may apply):

dragEnterEvent(self, event: PySide2.QtWidgets.QGraphicsSceneDragDropEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#dragEnterEvent

dragLeaveEvent

dragLeaveEvent(event: Any) -> None

X.dragLeaveEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsScene::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)

This event handler, for event event, can be reimplemented in a subclass to receive drag leave events for the scene.

See also QGraphicsItem::dragLeaveEvent(), dragEnterEvent(), dragMoveEvent(), and dropEvent().

Upstream PySide2 reference signatures (binding differences may apply):

dragLeaveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneDragDropEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#dragLeaveEvent

dragMoveEvent

dragMoveEvent(event: Any) -> None

X.dragMoveEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsScene::dragMoveEvent(QGraphicsSceneDragDropEvent *event)

This event handler, for event event, can be reimplemented in a subclass to receive drag move events for the scene.

Note: See items() for a definition of which items are considered visible by this function.

See also QGraphicsItem::dragMoveEvent(), dragEnterEvent(), dragLeaveEvent(), and dropEvent().

Upstream PySide2 reference signatures (binding differences may apply):

dragMoveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneDragDropEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#dragMoveEvent

drawBackground

drawBackground(painter: Any, rect: Any) -> None

X.drawBackground(painter, rect)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsScene::drawBackground(QPainter *painter, const QRectF \&rect)

Draws the background of the scene using painter, before any items and the foreground are drawn. Reimplement this function to provide a custom background for the scene.

All painting is done in scene coordinates. The rect parameter is the exposed rectangle.

If all you want is to define a color, texture, or gradient for the background, you can call setBackgroundBrush() instead.

See also drawForeground() and drawItems().

Upstream PySide2 reference signatures (binding differences may apply):

drawBackground(self, painter: PySide2.QtGui.QPainter, rect: PySide2.QtCore.QRectF) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#drawBackground

drawForeground

drawForeground(painter: Any, rect: Any) -> None

X.drawForeground(painter, rect)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsScene::drawForeground(QPainter *painter, const QRectF \&rect)

Draws the foreground of the scene using painter, after the background and all items have been drawn. Reimplement this function to provide a custom foreground for the scene.

All painting is done in scene coordinates. The rect parameter is the exposed rectangle.

If all you want is to define a color, texture or gradient for the foreground, you can call setForegroundBrush() instead.

See also drawBackground() and drawItems().

Upstream PySide2 reference signatures (binding differences may apply):

drawForeground(self, painter: PySide2.QtGui.QPainter, rect: PySide2.QtCore.QRectF) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#drawForeground

drawItems

drawItems(painter: Any, numItems: Any, items: Any, options: Any, widget: Any) -> Any

X.drawItems(painter, numItems, items, options, widget)

dropEvent

dropEvent(event: Any) -> None

X.dropEvent(event)

Supplemental documentation: Qt 5 reference:

[virtual protected] void QGraphicsScene::dropEvent(QGraphicsSceneDragDropEvent *event)

This event handler, for event event, can be reimplemented in a subclass to receive drop events for the scene.

See also QGraphicsItem::dropEvent(), dragEnterEvent(), dragMoveEvent(), and dragLeaveEvent().

Upstream PySide2 reference signatures (binding differences may apply):

dropEvent(self, event: PySide2.QtWidgets.QGraphicsSceneDragDropEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qgraphicsscene.html#dropEvent